Map Tile API Developer's Guide

POI Map Tile filtered for specific Category

This article shows how to make a request for a tile with specific POI category information.

User story

The user wants to see a certain location in the center of Berlin showing the well known Brandenburg Gate. In order to do that the user first requests the maptile as follows.

https://2.base.maps.cit.api.here.com
/maptile/2.1/maptile/newest/normal.day/20/563253/343903/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}

This requests renders the following tile

Figure 1. Center of Berlin in the location of the Brandenburg Gate

After checking that the tile is the expected one, the user requests the metadata information of the tile to figure out what category is the POI.

https://2.base.maps.cit.api.here.com
/maptile/2.1/maptile/newest/normal.day/20/563254/343903/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&pois
&mgen=2
&metadata=metaonly

The result of the previous requests is a JSON object containing the information of the POIs of the tile.


{ "metadata" : {
"street labels":[ { "name":"Pariser Platz", "font size":"13", "vertices": [ 168.73, 138.98, 204.18, 134.84, 215.62, 133.47, 243.81, 131.50 ] } ],
"labels":[],
"city center labels":[],
"buildings":[ { "id": "1609370975087560592", "sectors": [ { "info": { "bottom height": 0, "height": 8 }, "vertices": [ 8.44, 0, 10, 13.56, 110.66, 0 ], "polygons": [ [ 0, 1, 2]], "outlines": [ [ 2, 1, 0 ]] }, { "info": { "bottom height": 0, "height": 19.875 }, "vertices": [ 160, 220.62, 148, 115.44, 10, 13.56, 0, 13.56, 0, 48.62, 23.66, 256, 163.83, 256, 110.66, 0, 132.39, 0, 158, 112.19, 144.72, 0, 168, 220.62, 172.31, 256, 0, 48.62 ], "polygons": [ [ 0, 1, 2, 3, 4, 5, 6], [ 7, 2, 1, 8], [ 8, 1, 9, 10], [ 11, 0, 6, 12]], "outlines": [ [ 5, 13 ], [ 3, 2, 7 ], [ 10, 9, 1, 0, 11, 12 ]] } ] } ],
"transit stops":[  ],
"POIs":[ { "name":"Brandenburg Gate","geoposition":{"latitude":52.516279, "longitude":13.377700},"bounding boxes":[ { "icon box":[ 89, 177.50, 14, 14 ] }, { "annotation box":[ 53.55, 165.50, 84.91, 10.50 ] } ],"info": [{"PLACE NAME":"Brandenburg Gate", "PLACE CATEGORY":"Historical Monument", "PLACE ID":"800842663"}] } ]
}
}

Checking the result, we can see that Brandenburg Gate has the category Historical Monument. Therefore, after checking /meta/pois resource, the filter is created to display that category and the resulting tile request is shown below.

Request Summary

The following list summarizes the elements required to create a request matching the user story and shows, in square brackets, how those elements are used in the example(s) below. Note that the request example also uses the authentication parameters.

Resource: maptile [maptile], see also (resource) type
URL variables: {map id} [newest], see also Requesting the Right Map Version
  {scheme} [normal.day], see also scheme
  {zoom}/{column}/{row} [20/563254/343903], see also The Mercator Projection
  {size} [256], see also size
  {format} [png8], see also format
Parameters: pois=000000001, see also pois

Request

The code block below demonstrates the request with the filtered POI category.

https://2.base.maps.cit.api.here.com
/maptile/2.1/maptile/newest/normal.day/20/563254/343903/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&pois=000000001

Response

This request results in the following image that contains the icon for the Brandenburg Gate.

Figure 2. Center of Berlin showing the filtered POI Category