Map Tile API Developer's Guide

Metadata Generation Parameter

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. For more information about metainfo tile requests, see also Metainfo Tiles.

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 with Metadata Only

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
Note: Parts of the response have been modified as described in the introduction to Examples.

Response with Metadata Only

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 } ]
      },
      ...
    ],
    "labels": [
      {
        "name": "Cheruskerpark",
        "type": "TEXT",
        "bounding boxes": [
          {
            "left": 207,
            "top": -4,
            "width": 74.72,
            "height": 11.75
          }
        ]
      },
      ...,
      {
        "name": "Innsbrucker Platz",
        "type": "TRANSIT_STOP",
        "bounding boxes": [
          {
            "left": 56,
            "top": 84,
            "width": 23,
            "height": 12
          },
          {
            "left": 23,
            "top": 71,
            "width": 88.14,
            "height": 11.75
          }
        ]
      }
    ]
    "city center labels": []
  }
}

Request with mgen=2

In this request, the parameter mgen specifies that the response is to use a metadata map tile. This is a text based (JSON) tile with the relevant objects in it, such as street labels, city labels or icons. Each of these objects have certain properties, such as
  • positioning through bounding boxes
  • latitude and longitude
  • road icons with icon information, for example for highway signs
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 ]
      },
      ...
    ],
    "labels": [
      {
        "name": "Cheruskerpark", "type": "TEXT",
        "bounding boxes": [
          {
            "box 2": [ 207.27, -3.72, 74.72, 11.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={YOUR_APP_ID}&app_code={YOUR_APP_CODE}"
      }
      ...,
    ],
    "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.469995,
              "longitude": 13.340428
            },
            "official name": "Friedenau", "places id": "721680032",
            "operating hours": {
              "Monday": [["0:0:0","24:0:0"]],
              ...,
              "Holiday": [["0:0:0","24:0:0"]],
            },
            "parking hours": {
              "Monday": [["0:0:0","24:0:0"]],
              ...,
              "Holiday": [["0:0:0","24:0:0"]]
            }
          }
        ]
      },
      ...
    ],
    "POIs": []
  }
}
Note: Parts of the response are modified as described in the introduction to Examples.