Map Tile API Developer's Guide

Public Transit Additional Information

This article shows how to make a request with metadata parameter to get additional information of a public transit stop, such as:
  • places id
  • operating hours
  • parking size
  • parking hours
Note: Please refer to Selecting Public Transit Stops to get additional information on how to create selectable area.

User story

The user wants to obtain additional information of a Public Transit Stop so that it can be displayed in text mode.

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} [16/35205/21495], 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

The code block below demonstrates a complete request for the public transit stop.

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

Response

The image shown by this tile request not using metadata would be as follows.
Figure 1. Public Transit Map Tile
The response to the request delivers the following JSON object.

{ "metadata" : {
"street labels":[ ... ],
"labels":[],
"city center labels":[],
"buildings":[ ... ],
"transit stops":[ { "name": "Stadtmitte", "bounding boxes": [ { "box 1":[ 136.50, 177.02, 14, 14 ] }, { "box 2":[ 113.22, 163.02, 60.56, 13 ] } ], "info": [ { "position": {"latitude":52.510475, "longitude":13.389920}, "official name": "Stadtmitte", "places id": "721680928", "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":[  ]
}
}
Out of this object there following properties are of interest to get the geo location:
  • places id: contains the places identifier of the transit stop
  • operating hours: contains an array of days and times when the public transit stop operates
  • parking size: contains the parking size (if applicable)
  • parking hours: contains the allowed parking hours (if applicable)
Note: Please note this additional information might not be included when it is not available, so the response might be shorter than what is shown in the example.

Although it is not easy to find locations at the moment that contain places id as a property, the coverage is growing. Mainly the locations in the US contain places id. See example below of a public transit stop in Chicago.

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