Metainfo Tile Format for Metadata Generation One
Every metainfo tile displays the following information in a JSON structure
- metadata – container for the response
- street labels - array of street labels
- name
- font size
- vertices – array of tile coordinates
- x
- y
- labels – array of labels
- name
- type
- bounding boxes – array of boxes
- left
- top
- width
- height
- city center labels – array of city center labels
- name
- text box
- left
- top
- width
- height
- bullet box
- left
- top
- width
- height
- city center info
- type
- name
- alternative names – array of names
- country code
- name
- country code
- position
- latitude
- longitude
- population
- street labels - array of street labels
{
"metadata": {
"street labels": [],
"labels": [],
"city center labels": []
}
}
Street labels
The street labels field displays an array of labels containing the name of the street, the font size used to render it and an array of vertices to draw the polyline that represents the bounding box. The format is as follows:
"name": "",
"font size": "",
"vertices: [
"x":,
"y":
]
Name | Type | Description |
---|---|---|
name | String | Name of the street |
font size | String | Font size used to render the label, it is a number displayed as a string |
vertices | Array of tile coordinates | Array containing all vertices needed to draw a polyline that creates a bounding box on the street label. |
Labels
The labels field only displays information about roadsigns, including the name, the type and the location (bounding box). The format is an array of labels, each one with the following format:
"name": "",
"type": "ROADSIGN",
"bounding boxes": []
Name | Type | Description |
---|---|---|
name | String | Name displayed on the label |
type | String | One of the following types: Roadsign |
bounding boxes | Array of Bounding Box | Array containing all the bounding boxes of the label |
City Center Labels
This field displays an array of city center labels, each one including the name and location (bounding box) of the name, location (bounding box) of the bullet box, which is the small square showing the city center and the city center additional information, which shows the type of city, official displayed name, the alternative names in different languages, the country code, position (latitude and longitude) and population. The format is as follows:
"name": "",
"text box" : {
"left": ,
"top": ,
"width": ,
"height":
},
"bullet box" : {
"left": ,
"top": ,
"width": ,
"height":
},
"city center info": {
"type": "",
"name": "",
"alternative names": [
[
"",
""
]
],
"country code": "",
"position": {
"latitude":,
"longitude":
},
"population":
}
Name | Type | Description |
---|---|---|
name | String | Name of the city |
text box | Bounding Box | Location of the label in the tile |
bullet box | Bounding Box | Location of the bullet in the tile |
city center info | Structure | Structure containing additional information for a city |
Common fields
Field | Name | Type | Description |
---|---|---|---|
Bounding Box | left | Integer | Location of the left coordinate in the tile |
top | Integer | Location of the top coordinate in the tile | |
width | Integer | Width of the bounding box | |
height | Integer | Height of the bounding box | |
Geo coordinate | latitude | Float (6 decimals) | Latitude of the geo coordinate |
longitude | Float (6 decimals) | Longitude of the geo coordinate | |
City Center Info | type | String | Type of city between National Capital, Provincial Capital and Other |
name | String | Official name of the city | |
alternative names | Array of arrays | Alternative names of the city, each array containing the country code as String and the name as String | |
country code | String | Three letter country code following MARC coding | |
position | Geo coordinate | Location of the city center | |
population | Integer | Population of the city | |
Tile Coordinate | x | Integer | Coordinate x of the tile coordinate |
y | Integer | Coordinate y of the tile coordinate |
Two examples are provided in this section, both using mgen=1
, to illustrate the format described above. For additional information about how to use the mgen
parameter, see the Examples topic.
This example shows a parameter in
Urumqi
and the request looks like: https://2.base.maps.hereapi.cn/maptile/2.1/maptile/newest/normal.day/6/47/23/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&metadata=metaonly
&mgen=1
The response looks like:
{ "metadata" : {
"street labels":[
],
"labels":[
{"name":"3015", "type": "ROADSIGN", "bounding boxes": [ { "left":5, "top":4, "width":28, "height":12 } ] },
{"name":"30", "type": "ROADSIGN", "bounding boxes": [ { "left":20, "top":39, "width":18, "height":12 } ] },
{"name":"312", "type": "ROADSIGN", "bounding boxes": [ { "left":207, "top":127, "width":21, "height":12 } ] },
{"name":"3012", "type": "ROADSIGN", "bounding boxes": [ { "left":174, "top":120, "width":28, "height":12 } ] }
],
"city center labels":[
{"name": "乌鲁木齐市", "text box": { "left":151, "top":66, "width":77, "height":16.75 }, "bullet box": { "left":146, "top":79, "width":5, "height":5 }, "city center info": {"type":"PROVINCIAL CAPITAL", "name": "乌鲁木齐市", "alternative names":[["CHI", "乌鲁木齐市"], ["ENG", "Urumqi"]], "country code": "", "position": {"latitude":43.813477, "longitude":87.626953}, "population": 2510000 } }
]
}
}
This other example contains a metadata response for a close-up of a location in
Urumqi
including street labels. The request looks like: https://2.base.maps.hereapi.cn/maptile/2.1/maptile/newest/normal.day/13/6089/2984/256/png8
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&metadata=metaonly
&mgen=1
The response looks like:
{ "metadata" : {
"street labels":[
{ "name":"昆仑东街", "font size":"12", "vertices": [ { "x": 172, "y": -19 }, { "x": 181, "y": -11 }, { "x": 192, "y": -7 }, { "x": 216, "y": -5 } ] },
{ "name":"南湖北路", "font size":"12", "vertices": [ { "x": 168, "y": -8 }, { "x": 170, "y": 16 }, { "x": 172, "y": 28 }, { "x": 174, "y": 40 } ] },
{ "name":"河滩北路", "font size":"12", "vertices": [ { "x": 95, "y": 83 }, { "x": 92, "y": 130 } ] },
{ "name":"河滩北路", "font size":"12", "vertices": [ { "x": 94, "y": -51 }, { "x": 95, "y": -3 } ] },
{ "name":"友好北路", "font size":"12", "vertices": [ { "x": 21, "y": 38 }, { "x": 34, "y": 84 } ] }
],
"labels":[
{"name":"红山公园", "type": "TEXT", "bounding boxes": [ { "left":104, "top":202, "width":46, "height":11.75 } ] },
{"name":"明园客运站", "type": "TRANSIT_STOP", "bounding boxes": [ { "left":20, "top":127, "width":10, "height":10 } ] }
],
"city center labels":[
{"name": "乌鲁木齐市", "text box": { "left":132, "top":46, "width":134.50, "height":30.50 }, "city center info": {"type":"PROVINCIAL CAPITAL", "name": "乌鲁木齐市", "alternative names":[["CHI", "乌鲁木齐市"], ["ENG", "Urumqi"]], "country code": "", "position": {"latitude":43.827209, "longitude":87.617340}, "population": 2510000 } },
{"name": "八一街道", "text box": { "left":-9, "top":130, "width":50, "height":13 }, "city center info": {"type":"OTHER", "name": "八一街道", "alternative names":[["CHI", "八一街道"], ["ENG", "Bayi Neighborhood"]], "country code": "", "position": {"latitude":43.817596, "longitude":87.585754}, "population": 0 } },
{"name": "六道湾", "text box": { "left":205, "top":97, "width":38, "height":13 }, "city center info": {"type":"OTHER", "name": "六道湾", "alternative names":[["CHI", "六道湾"], ["ENG", "Liudaowan"]], "country code": "", "position": {"latitude":43.821716, "longitude":87.621460}, "population": 0 } },
{"name": "六道湾村", "text box": { "left":95, "top":30, "width":50, "height":13 }, "city center info": {"type":"OTHER", "name": "六道湾村", "alternative names":[["CHI", "六道湾村"], ["ENG", "Liudaowan Village"]], "country code": "", "position": {"latitude":43.829956, "longitude":87.603607}, "population": 0 } },
{"name": "友好南路街道", "text box": { "left":-5, "top":175, "width":74, "height":13 }, "city center info": {"type":"OTHER", "name": "友好南路街道", "alternative names":[["CHI", "友好南路街道"], ["ENG", "Youhaonanlu Neighborhood"]], "country code": "", "position": {"latitude":43.812103, "longitude":87.588501}, "population": 0 } },
{"name": "新民路街道", "text box": { "left":169, "top":186, "width":62, "height":13 }, "city center info": {"type":"OTHER", "name": "新民路街道", "alternative names":[["CHI", "新民路街道"], ["ENG", "Xinminlu Neighborhood"]], "country code": "", "position": {"latitude":43.810730, "longitude":87.617340}, "population": 0 } }
]
}
}