Map Tile API Developer's Guide

Metadata generation parameter

This article shows requests for metainfo map tiles.

User story

The user wants to obtain metadata information for an image showing a map tile for an area near Friedenau in Berlin, Germany in order to know the position of the labels to enable interactivity.

Note: Two possible metainfo requests are shown as examples, using the mgen parameter. See also Metainfo Tiles for more information about metainfo tile requests.

Original map tile

The tile that the user wants to find more information about is obtained by the following request:

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

The response to the request delivers the following image:

Figure 1. Map Tile

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} [14/8799/5376], see also The Mercator Projection
  {size} [256], see also size
  {format} [png8], see also format
Parameters: metadata [metaonly], see also metadata

Request

The code block below demonstrates a complete request for a metadata map tile.

https://2.base.maps.cit.api.here.com
/maptile/2.1/maptile/newest/normal.day/14/8799/5376/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&metadata=metaonly

Response

The response to the request delivers the following Meta Info Tile as a JSON object:


{ "metadata" : {
"street labels":[
{ "name":"Hauptstraße", "font size":"13", "vertices": [ { "x": 139, "y": 0 },  { "x": 177, "y": -35 },  { "x": 183, "y": -40 },  { "x": 196, "y": -49 } ] },
{ "name":"Hauptstraße", "font size":"12", "vertices": [ { "x": 15, "y": 158 },  { "x": 20, "y": 152 },  { "x": 24, "y": 147 },  { "x": 28, "y": 141 },  { "x": 32, "y": 136 },  { "x": 42, "y": 123 },  { "x": 45, "y": 119 },  { "x": 49, "y": 115 },  { "x": 59, "y": 104 } ] },
],
"labels":[
{"name":"Friedenau", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":31, "top":240, "width":12, "height":12 } ] },
{"name":"Schöneberg", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":157, "top":40, "width":12, "height":12 } ] },
{"name":"Innsbrucker Platz", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":55, "top":85, "width":24, "height":12 } ] },
{"name":"Friedenau", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":12, "top":227, "width":51, "height":11 } ] },
{"name":"Schöneberg", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":134, "top":27, "width":59, "height":11 } ] },
{"name":"Innsbrucker Platz", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":23, "top":72, "width":87, "height":11 } ] },
{"name":"Cheruskerpark", "type": "TEXT", "bounding boxes": [ { "left":182, "top":0, "width":74, "height":11 } ] },
{"name":"Dominicus-Sportplatz", "type": "TEXT", "bounding boxes": [ { "left":179, "top":123, "width":57, "height":24 } ] },
{"name":"103", "type": "ROADSIGN", "bounding boxes": [ { "left":62, "top":198, "width":28, "height":20 } ] },
{"name":"100", "type": "ROADSIGN", "bounding boxes": [ { "left":212, "top":163, "width":28, "height":20 } ] },
{"name":"1", "type": "ROADSIGN", "bounding boxes": [ { "left":188, "top":73, "width":22, "height":15 } ] },
{"name":"Friedhof Eisackstraße", "type": "TEXT", "bounding boxes": [ { "left":71, "top":113, "width":65, "height":24 } ] }
],
"city center labels":[
]
}
}

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} [14/8799/5376], see also The Mercator Projection
  {size} [256], see also size
  {format} [png8], see also format
Parameters: metadata [metaonly], see also metadata
  mgen [2], see also mgen

Request with mgen=2

The code block below demonstrates a complete request for a metadata map tile with the parameter mgen.

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

Response with mgen=2

The response to the request delivers the following Meta Info Tile as a JSON object:


{ "metadata" : {
"street labels":[ { "name":"Hauptstraße", "font size":"13", "vertices": [ 139, -0.16, 173.71, -31.71, 177.21, -34.88, 182.53, -39.48, 196.24, -48.32 ] },
{ "name":"Hauptstraße", "font size":"12", "vertices": [ 15.56, 157.88, 24.34, 146.43, 28.46, 141.05, 32.66, 135.54, 35.49, 131.84, 39.04, 127.21, 41.89, 123.49, 44.53, 120.12, 48.46, 115.19, 58.68, 104.25 ] },
{ "name":"Rubensstraße", "font size":"11", "vertices": [ 67.27, 133.72, 67.78, 140.16, 68.25, 146.35, 68.83, 152.70, 69.39, 158.71, 69.99, 164.94, 70.29, 170.27, 70.74, 175.61, 71.09, 179.84, 71.41, 183.71, 71.95, 189.46, 72.06, 203.11 ] },
{ "name":"Feurigstraße", "font size":"10", "vertices": [ 173.56, 2.40, 177.10, -0.60, 181.27, -4.16, 185.58, -7.82, 188.28, -10.09, 190.09, -11.61, 194.45, -15.36, 198.12, -18.49, 201.03, -20.96, 203.66, -23.38, 217.48, -34.38 ] },
{ "name":"Werdauer Weg", "font size":"10", "vertices": [ 120.04, 169.50, 121.46, 161.66, 122.50, 156.07, 123.53, 151.95, 125.92, 146.19, 128.57, 141.21, 131.89, 136.39, 135.01, 131.90, 140.11, 124.80, 152.69, 108.97 ] } ],
"labels":[{ "name": "Cheruskerpark", "type":"TEXT", "bounding boxes": [ { "box 2":[ 207.27, -3.72, 74.72, 11.75 ] } ] },
{ "name": "Dominicus-Sportplatz", "type":"TEXT", "bounding boxes": [ { "box 2":[ 177.91, 124.21, 58.42, 24.75 ] } ] },
{ "name": "100", "type":"ROADSIGN", "bounding boxes": [ { "box 1":[ 144.59, 151.48, 28, 20 ] } ], "region": "DEU", "category": 0, "route name": "A100", "route level": 2, "uri": "http://image.maps.api.here.com/mia/1.6/roadsign?category=0&region=DEU&label=A100&route_level=2&app_id=%7BYOUR_APP_ID&app_code=%7BYOUR_APP_CODE%7D" },
{ "name": "103", "type":"ROADSIGN", "bounding boxes": [ { "box 1":[ 123.26, 176.52, 28, 20 ] } ], "region": "DEU", "category": 0, "route name": "A103", "route level": 2, "uri": "http://image.maps.api.here.com/mia/1.6/roadsign?category=0&region=DEU&label=A103&route_level=2&app_id=%7BYOUR_APP_ID&app_code=%7BYOUR_APP_CODE%7D" },
{ "name": "1", "type":"ROADSIGN", "bounding boxes": [ { "box 1":[ 186.39, 71.12, 22, 15 ] } ], "region": "DEU", "category": 1, "route name": "B1", "route level": 3, "uri": "http://image.maps.api.here.com/mia/1.6/roadsign?category=1&region=DEU&label=B1&route_level=3&app_id=%7BYOUR_APP_ID&app_code=%7BYOUR_APP_CODE%7D" }],
"city center labels":[],
"buildings":[  ],
"transit stops":[ { "name": "Friedenau", "bounding boxes": [ { "box 1":[ 32, 240.20, 11, 12 ] }, { "box 2":[ 11.96, 227.20, 51.08, 11.75 ] } ], "info": [ { "position": {"latitude":52.469909, "longitude":13.340621}, "official name": "Friedenau", "places id": "721680032", "operating hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] }, "parking hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] } } ]},
{ "name": "Innsbrucker Platz", "bounding boxes": [ { "box 1":[ 55.75, 85.06, 23, 12 ] }, { "box 2":[ 23.18, 72.06, 88.14, 11.75 ] } ], "info": [ { "position": {"latitude":52.478020, "longitude":13.343174}, "official name": "Innsbrucker Platz", "places id": "721680137", "operating hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] }, "parking hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] } } ]},
{ "name": "Rathaus Schöneberg", "bounding boxes": [ { "box 1":[ 47.75, -11.41, 12, 12 ] } ], "info": [ { "position": {"latitude":52.483063, "longitude":13.342016}, "official name": "Rathaus Schöneberg", "places id": "721680825", "operating hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] }, "parking hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] } } ]},
{ "name": "Schöneberg", "bounding boxes": [ { "box 1":[ 158, 40.32, 11, 12 ] }, { "box 2":[ 132.82, 27.32, 61.36, 11.75 ] } ], "info": [ { "position": {"latitude":52.480359, "longitude":13.351436}, "official name": "Schöneberg", "places id": "721680033", "operating hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] }, "parking hours": { "Monday":[["0:0:0","24:0:0"]], "Tuesday":[["0:0:0","24:0:0"]], "Wednesday":[["0:0:0","24:0:0"]], "Thursday":[["0:0:0","24:0:0"]], "Friday":[["0:0:0","24:0:0"]], "Saturday":[["0:0:0","24:0:0"]], "Sunday":[["0:0:0","24:0:0"]], "Holiday":[["0:0:0","24:0:0"]] } } ]} ],
"POIs":[  ]
}