Tutorials /

Make a map with the Data Hub provided by HERE

Last Updated: July 05, 2020


Duration is 1 min

In this tutorial, you will learn to access data in a Data Hub space to make a map.

What you’ll learn

  • How to view data from a Data Hub space on a map
  • How to upload, tag and view larger GeoJSON files
  • How to view the Data Hub space geodata in a variety of mapping tools

View data from a Data Hub Space using the GeoJSON Viewer

Duration is 5 min

Open the GeoJSON Viewer

Open this URL by clicking on the “Load Data” tab and copying and pasting this into the ‘From GeoJSON URL’ option: https://xyz.api.here.com/hub/spaces/x-india-trains/iterate?limit=50&access_token=AcIjODo6UKfvEULPewFlnEk

You should see a map like this:


Note you can also append the data URL to the end of the GeoJSON viewer: http://geojson.tools/index.html?url=https://xyz.api.here.com/hub/spaces/x-india-trains/iterate?limit=50&access_token=AcIjODo6UKfvEULPewFlnEk

Access a Data Hub space via the vector tile endpoint

Duration is 10 min

View a Data Hub space using Web Mercator vector tiles

To access a Data Hub space as GeoJSON vector tiles in a renderer like Tangram, the syntax of the URL would look like this:


Note: Map tile renders will automatically fill in the {x}, {y} and {z} in order to load tiles based on longitude {x}, latitude {y} and zoom level {z}.

If you’re a human, you probably want to click on this link to see rail lines from Mumbai served as vector tiles and rendered by Tangram.

Tangram scene files (YAML)

To access vector tiles in a Tangram scene file, your source: block would look like this:

        url: https://xyz.api.here.com/hub/spaces/YOUR_SPACE_ID/tile/web/{z}_{x}_{y}
            access_token: YOUR_ACCESS_TOKEN
            clip: true
        type: GeoJSON

Don’t forget to paste in your own Data Hub space ID and access token!

Learn more about getting data via tiles.

Note: it is important to include clip: true with vector tile renders, especially when using linestrings or polygons, otherwise each tile will contain the entire geometry of objects it intersects, defeating the benefit of vector tiles.

_Note: If you have previously worked with vector tiles, you may be used to an {z}/{x}/{y} URL schema. The HERE Studio API uses underscores instead of slashes: tile/web/{z}_{x}_{y}_

Upload GeoJSON to make a map with Tangram and vector tiles

Duration is 30 min

In this exercise, you will download data from the Amsterdam Open Data portal, upload and tag them to a Data Hub space, and build a map in Tangram.

First, download “solar panel”, “green roof” and “quarters” (neighborhood) GeoJSON data from the by using the ‘search’ field to find the three datasets and clicking the ‘Download .json(GeoJSON)’ link.

Image of Open Data Amsterdam

You can preview the GeoJSON by opening one of the files in geojson.tools.

Solar Panels in GeoJSON.tools

Now you will make a new space via the Data Hub CLI:

here xyz create -t "Amsterdam open data" -d "Amsterdam open data via https://maps.amsterdam.nl/open_geodata/?LANG=en"

Make note of the HERE Studio spaceID returned by the CLI.

Upload and tag the GeoJSON files using the CLI:

here xyz upload YOURSPACEID -f GROENE_DAKEN.json -t green_roof
here xyz upload YOURSPACEID -f ZONNEPANELEN2017.json -t solar_panels
here xyz upload YOURSPACEID -f GEBIED_BUURTCOMBINATIES.json -t quarters

You may see warnings about duplicate records. This is surprisingly common in many datasets, and deduplication is a feature of the CLI. This can be disabled using the -o option.

In order to share data from your HERE Studio account, you will need an access token. Tokens can have various levels of permissions.

You can generate a list of your tokens using here xyz token.

> here xyz token

id                       type       iat         description                                                                   
-----------------------  ---------  ----------  ----------------

j76utcIYRggKUTclxjtrYKR  PERMANENT  1234567890  xyz-hub=readFeatures                                                          
ckuk36YRyqXku7clutc86fo  PERMANENT  2345678901  xyz-hub=readFeatures                                                          
piyvOf6DoutCotDoltCl4Pg  PERMANENT  3456789012  XYZ Viewer Token                                                              
98yIYVUTYiiyvTDYRXlutdL  PERMANENT  4567890123  XYZ Viewer Token                                                                                                                     
YIRUTFYo8tGILYVIPYFPyV7  PERMANENT  5678901234 xyz-hub=createFeatures,manageSpaces,readFeatures,updateFeatures,deleteFeatures

Be sure to copy one that only has read privileges!

Open this scene in Tangram Play:

  • use your space id to replace the SPACE_ID in the “url parameter” block in the “source” group in line 13
  • use your token to replace the token_id parameter in url_params with your token in line 20
  • uncomment lines 13 and 20 (delete the leading # or highlight the line and press Command /)

Your sources block should look like this:

        url: https://xyz.api.here.com/hub/spaces/YOURSPACEID/tile/web/{z}_{x}_{y} # ADD YOUR SPACE ID
        clip: true
        type: GeoJSON

Note: You may need to reload the page.

As you zoom in, neighborhoods will appear, and then the circles will become proportional, and eventually will show labels.


Note that you can also preview the data in this space using the Tangram-based “Space Invader” tool:

here xyz show YOUR_SPACE_ID -v

This allows you to inspect tags, properties and their values.

Transfer a CSV to make a forest fire map

Duration is 30 mins

In this tutorial, you will transfer a CSV containing 7 days worth of forest fire data from the NASA MODIS active fire dataset to a Data Hub space, and display it using vector tiles in Tangram.

Make a new space via the Data Hub CLI.

here xyz create -t "NASA/NOAA MODIS fire data" -d "https://earthdata.nasa.gov/earth-observation-data/near-real-time/firms/active-fire-data"

Make note of the HERE Studio spaceID returned by the CLI.

Upload the 7 day MODIS file to the Data Hub space using the source data URL:

here xyz upload SPACEID -f "https://firms.modaps.eosdis.nasa.gov/active_fire/c6/text/MODIS_C6_Global_7d.csv" -p acq_date -t modis

Note: -p is using the acq_date property and assigning that value as a tag, while -t is assigning modis as a tag to every feature.

Note: this is taking the CSV of active fire observations from NASA and transferring it directly to a Data Hub space, 100 at a time, without having to download it to your desktop and then upload it.

Copy a read-only token from your here xyz token list .

Open this scene in Tangram Play


Use your space id to replace the SPACEID in the “url parameter” in the “source” group in line 155

Use your access token to replace the access_token parameter in url_params line 158

Your source block should look something like this:

  url: https://xyz.api.here.com/hub/spaces/YOUR_SPACE_ID/tile/web/{z}_{x}_{y}
      access_token: YOUR_TOKEN_ID
      clip: true
  type: GeoJSON

(You may need to reload the page when changing the source.)

This represents the last 7 days of global active fire data as observed by NASA’s MODIS satellite

  • each color change represents a 24 hour slice of data – brighter colors are newer data
  • MODIS data is constantly updating as satellites orbit, so you could upload this file every day (or every hour) and the changes would be uploaded to the Data Hub space without duplicating the data

You can use tags to filter fire data by day: in the modis_fires section of the sources block, add this line directly below clip in url_params:

tags: 2018%2D08%2D20

Your source block should look something like this:

     url: https://xyz.api.here.com/hub/spaces/ZOaZln0t/tile/web/{z}_{x}_{y}
         access_token: YOUR_TOKEN_ID
         clip: true
         tags: 2018%2D08%2D20
     type: GeoJSON

Pan around the map to look for fires. Depending on the season, you may see fires in California, British Columbia, Portugal, Siberia or Australia. Other hotspots include oil well flares in Iraq, agricultural burning in Central Africa, clear cutting in Brazil, and industrial hotspots world-wide (power plants, factories).