Geovisualization Developer's Guide

Queries

To retrieve data from your datasets, you need to define a 'query' with the Geovisualization REST API query language. In addition to simply fetching data, you can define a query to aggregate, transform, filter and sort the data before creating a visualization with it. Note that only dataset owners can create queries on a dataset.

A Geovisualization query is not a one-off action like a query in SQL. It corresponds more to the concept of 'prepared statements' in SQL, where you can create a query for later execution. This involves separating the sending of the query's source code and the actual data retrieval.

Query owners can choose to 'publish' a query to make it possible for non-authenticated users to use it. While a query remains private (unpublished), only the query owner can POST it to the Geovisualization REST API. This privacy option allows you to upload a sensitive dataset (for example, records with user information) but make a less sensitive query (for example, aggregating the number of users by country in the result). You can then make only the less sensitive data publicly available by publishing that query.

Fastpath: For examples of queries, we suggest you look at the Geovisualization code examples. These include all the code needed to create the visualizations, which you can copy and use as the basis for your own apps.