Geovisualization Developer's Guide

Creating a Dataset

Using the access token from the previous step and your app_id and app_code, you will upload a sample data source into your own account. Then, as an example of an API call, you can view sample data from the earthquake data source.

A Note about Datasets

Geovisualization processes data via structured datasets organized into rows and columns. Each column represents an attribute of the data (e.g. Region) and the rows represent samples of the data (e.g. Berlin, Utah, Wales). A Geovisualization dataset will typically include columns for latitude and longitude for plotting data onto a map.

You upload your own data into Geovisualization as comma-separated value (CSV) files, by loading the file directly or by specifying a URL that points to the file. For details about how to prepare your data, see Managing your Data and Data Format Guidelines.

We have sample datasets that you can use for practice and training purposes. See Uploading Data from a File and Uploading Data from a URL for more details on how to do this, and Sample Data Sources for information about the sample sets available.

Create an Empty Dataset

Create an empty dataset with a POST request including the following content as the request body:
https://datalens.api.here.com/v1/datasets?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}
                    
{
  "name": "Name of your new dataset",
  "description": "Description of your new dataset, can be empty"
}

You can also use the datasets endpoint in the 03. Datasets List/Search folder of our Postman collection.

You will receive a response body that contains the new dataset ID.
Note: The supported protocols for the URL are HTTP, HTTPS and SFTP. For SFTP, the URL must point to a directory instead of a file. All csv, csv.gz or zip files in that directory are downloaded and added to the dataset. The dataset must have a predefined schema and all files in the directory must conform to it.

Upload the Earthquake Dataset

In this tutorial, we will use a sample dataset containing information about recorded earthquakes. The dataset contains information about earthquake events, each represented by its location as a pair of geographical coordinates (latitude and longitude), as well as each earthquake's magnitude, depth and region. (The dataset actually contains more columns than these, but we select only some of the columns in our example query. For more information about this dataset, see Sample Data Sources.)

To load the earthquake dataset into your Geovisualization account, you call the (datasets/_ID_) resource on the Geo-visualization REST API with the ID of the dataset you received above.

You need to provide your authentication credentials (app_id and app_code) as URL parameters and your authentication token in the Authorization field of the header, appended to the string "Bearer ", as shown in the following figure:

Figure 1. Authorization String = Bearer + Token
POST to the following endpoint with the url of the data source in the request body:
https://datalens.api.here.com/v1/datasets/[dataset_id]?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}          
      
{
  "source": {"url":"http://js.cit.datalens.api.here.com/datasets/starter_pack/Earthquakes_7day.csv"}
}
You can also use the datasets/_ID_ endpoint in the 04.1. Dataset Import folder of our Postman collection.

Get Sample Data from the Dataset

You can call the Geo-visualization REST API to return sample data from a dataset. If you wish, you can request sample data from the earthquake dataset to get an idea of the data this tutorial will be visualizing.

To do this, send a GET request to the Geo-visualization REST API with an empty request body:

https://datalens.api.here.com/v1/datasets/[dataset_id]/sample?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}

You can also use the datasets endpoint in the 03. Datasets List/Search folder of our Postman collection.

Be sure to include your token in the Authorization field of the request header, as described above. The response includes a columns property that lists as strings all the column names in the dataset, and a rows property that lists the first 30 rows of data. For example:

Figure 2. Sample Data from the Dataset

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.