Skip to main content

Map Format

MOSS designed a two-level road network data structure.

Intermediate GeoJSON format

The first level uses the (GeoJSON) standard, which can be readily converted from publicly available data sources.

RoadNet

RoadNet data consists of two types of geometric elements below.

  1. LineString, corresponding to road in map
  2. MultiPoint, corresponding to junction in map

LineString type field description

Example

{
"type": "Feature",
"id": 25409666,
"geometry": {
"type": "LineString",
"coordinates": [
[
113.902208,
22.590202
],
[
113.894869,
22.59406
]
]
},
"properties": {
"id": 25409666,
"lanes": 3,
"highway": "motorway_link",
"max_speed": 8.333333333333334,
"name": "",
"turn": ["ALS","S","SR"], # Around, Left, Staright | Staright | Staright, Right
"width": 3.2
}
},
fieldtypedescription
geometry.coordinateslist[list[float64]]The latitude and longitude coordinates of the road in WGS84 format
properties.idintThe original id of the road, which is usually different from the id in the generated map
properties.lanesintThe number of lanes on this road
properties.highwaystringRoad level from OpenStreetMap (https://wiki.openstreetmap.org/wiki/Key:highway)
properties.max_speedfloat64The speed limit on this road in meters per second
properties.namestringName of this road
properties.turnlist[string]Optional field: A string representing the allowed turn types for each lane, in order from left to right along the direction of the road. A: Left turn, S: Straight, L: Right turn. A lane can have multiple turn types allowed, e.g. "SL" means the lane can be used for either a straight or a left turn. Allowable turn types are: A (left turn), S (straight), L (right turn)
properties.width, properties.lanewidthfloat64Width (in meters) of each lane on this road
properties.walk_lane_widthfloat64Optional field: Walk lane width (in meters) of each lane on this road
properties.walk_lane_offsetfloat64Optional field: The default offset between sidewalk and the lane centerlines is the average between sidewalk and lane width, this offset is adjusted from the original centerlines, so the real offset will be: (width+walk_lane_width)*0.5+walk_lane_offset (m)

MultiPoint type field description

Example

{
"type": "Feature",
"id": 50000000013,
"geometry": {
"type": "MultiPoint",
"coordinates": [
[
113.906995,
22.552684
]
]
},
"properties": {
"id": 50000000013,
"in_ways": [
974379908
],
"out_ways": [
25436150,
953806719
]
}
},
fieldtypedescription
geometry.coordinateslist[list[float64]]The latitude and longitude coordinates of the junction in WGS84 format
properties.idintThe original id of the junction, which is usually different from the id in the generated map
properties.in_wayslist[int]The original ids of all roads entering this junction
properties.out_wayslist[int]The original ids of all roads exiting this junction

AOIs

fieldtypedescription
geometry.coordinateslist[list[list[float64]]]The latitude and longitude coordinates of the AOI exterior in WGS84 format
properties.idintThe original id of the AOI, which is usually different from the id in the generated map
properties.osm_tagslist[dict]The tags corresponding to the OSM (OpenStreetMap) data for the Area of Interest (AOI) may have a length greater than 1, as the AOI could be a result of merging multiple smaller AOIs. Currently, only five fields within the tags are processed:
1. landuse, leisure, amenity, building: These are used to determine the land use type of the AOI. For a simple manual annotation of the AOI type, choose from the following options:
- "landuse":"residential" - Residential land,
- "landuse":"education" - Educational and research land,
- "landuse":"commercial" - Commercial and service facilities land,
- "landuse":"industrial" - Industrial land,
- "building":"government" - Administrative and office land,
- "landuse":"other" - Other land uses
2. name: This is used to obtain the name of the AOI.

For specific values of these fields and their corresponding meanings, please refer to the OpenStreetMap Wiki at https://wiki.openstreetmap.org/wiki/Key:{key_name}, replacing {key_name} with the respective tag key (e.g., 'landuse', 'leisure', etc.).

Example

{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
31.129645,
29.976933
],
[
31.130864,
29.976937
],
[
31.131819,
29.97694
],
[
31.131828,
29.975046
],
[
31.129654,
29.975039
]
]
]
},
"properties": {
"id": 0,
"osm_tags": [
{
"landuse":"retail",
"name:en": "Pyramid of Khafre",
"name:zh": "卡夫拉金字塔",
}
]
}

POIs

fieldtypedescription
geometry.coordinateslist[float64]The latitude and longitude coordinates of the POI in WGS84 format
properties.idintThe original id of the POI, which is usually different from the id in the generated map
properties.namestringName of this POI
properties.catgstringCategory code, defined in (https://lbs.qq.com/service/webService/webServiceGuide/webServiceAppendix)

Protobuf Map format

The second level is represented in (Protobuf) format, a compact binary format suitable for computer usage.

Header contains meta data of this map

{
"class": "header",
"data": {
"name": "hangzhou",
"date": "Fri Aug 19 15:12:01 2023",
"north": 20047.15060441926,
"south": -32338.87769681991,
"west": -18106.391120057444,
"east": 23241.800579354865,
"projection": "+proj=tmerc +lat_0=30.2435 +lon_0=120.1648"
}
}
fieldtypedescription
data.namestringName of this map
data.datestringThe time when this map was created
data.north, data.south, data.west,data.eastdoubleBounding box of this map
data.taz_x_step, data.taz_y_stepdoubleStep size of the TAZ in the x and y direction
data.projectionstringProj.4 projection string

Lane

{
"class": "lane",
"data": {
"id": 0,
"type": 1,
"turn": 1,
"max_speed": 11.11111111111111,
"length": 405.77050412705626,
"width": 3.2,
"center_line": {
"nodes": [
{
"x": -333.409877363847,
"y": 3892.689241038861
},
{
"x": -270.3333568115683,
"y": 3896.3202265304885
},
{
"x": -150.42210531337474,
"y": 3900.0537339189864
},
]
},
"predecessors": [
{
"id": 89785,
"type": 2
},
{
"id": 89788,
"type": 2
}
],
"successors": [
{
"id": 89790,
"type": 1
},
{
"id": 89791,
"type": 1
}
],
"left_lane_ids": [],
"right_lane_ids": [],
"parent_id": 200000000,
"overlaps": [],
"aoi_ids": [
500001796,
500010169,
500010170,
]
}
}
fieldtypedescription
data.idintDistinct id of this lane
data.typeintType of this lane. 0: Unspecified, 1: Driving, 2: Walking.
data.turnintTurn type of this lane. 0: Unspecified, 1: Straight, 2: Left, 3: Right, 4: Around.
data.max_speedfloatThe speed limit on this lane in meters per second
data.lengthfloatThe length of this lane
data.widthfloatThe width of this lane
data.center_linedict[string,list[dict]]Centerline geometry points of this lane
data.predecessors, data.successorslist[dict]Predecessor/successor lanes of this lane , including id of connected lane and connection type, 1: connected to the head of other lane, 2: connected to the tail of other lane.
data.left_lane_ids, data.right_lane_idslist[int]Left/Right adjacent lane id in the same road (arranged from near to far)
data.parent_idintThe road id or junction id to which it belongs
data.overlapslist[dict]Overlap points between lanes (valid only within a junction)
data.aoi_idslist[int]All AOI ids connected to this lane

Road

{
"class": "road",
"data": {
"id": 200000000,
"lane_ids": [
0,
63893
],
}
}
fieldtypedescription
data.idintDistinct id of this road
data.lane_idslist[int]The ids of all lanes that make up the road, arranged from left to right along the direction of the road. Driving lane first, then walking lanes.

Junction

{
"class": "junction",
"data": {
"id": 300000000,
"lane_ids": [ # 属于该路口的所有lane(包括车行道和人行道)
89785,
89786,
89787,
89788,
89789,
180968,
]
}
}
fieldtypedescription
data.idintDistinct id of this junction
data.lane_idslist[int]The ids of all lanes that belonging to the junction.

AOI

{
"class": "aoi",
"data": {
"id": 500000000,
"positions": [
{
"x": 871.8707642603008,
"y": 3971.670224670372
},
{
"x": 1145.657731407196,
"y": 4268.304979330834
},
{
"x": 1357.7498147156743,
"y": 4100.025863656549
},
{
"x": 871.8707642603008,
"y": 3971.670224670372
}
],
"area": 11961.66874272599,
"driving_positions": [
{
"lane_id": 9990,
"s": 222.80558616295468
}
],
"driving_gates": [
{
"x": 875.0335524878568,
"y": 3972.2371491341605
}
],
"walking_positions": [
{
"lane_id": 67871,
"s": 223.98105794200876
}
],
"walking_gates": [
{
"x": 878.1963407154128,
"y": 3972.8040735979494
}
],
"poi_ids":[],
"name": "国家大剧院",
"urban_land_use": "A2"
}
}
fieldtypedescription
data.idintDistinct id of this AOI
data.areafloatArea of this AOI
data.positionslist[dict]Exterior geometry points of this AOI
data.driving_positions, data.walking_positionslist[dict]The position of the connection point on the lane (represented by lane id and s, where s is the distance from the starting point of lane to the target point along lane)
data.driving_gates, data.walking_gateslist[dict]The entrances and exits connected to various lanes on the AOI boundary, corresponding one-to-one with the order of driving_positions/walking_positions
data.poi_idslist[int]All POI ids contained in this AOI
data.namestringName of this AOI
data.urban_land_usestringLand use type, according to https://www.planning.org.cn/law/uploads/2013/1383993139.pdf

POI

{
"class": "poi",
"data": {
"id": 700000000,
"name": "悦庭迷你",
"category": "111000",
"position": {
"x": 9198.956125039857,
"y": -15926.569325368913
},
"aoi_id": 500004914,
}
}
fieldtypedescription
data.idintDistinct id of this POI
data.namestringName of this POI
data.categorystringCategory code, defined in (https://lbs.qq.com/service/webService/webServiceGuide/webServiceAppendix)
data.positionsdict[string,float]Point coordinate of this POI
aoi_idintThe id of the AOI which contained this POI