在哪里放置额外的 GeoJson 属性
Where to put extra GeoJson properties
我正在使用 GeoJson 格式为一个国家/地区创建地图,但我想知道在哪里放置额外的国家/地区信息,例如 Name
、Country Code
和一些有用的信息。
我知道我们可以很容易地为特征(在我的例子中是区域数据)做到这一点,但是我可以在哪里放置国家/地区属性?
us.json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"REGION_ID": 1,
"REGION_NAME": "My First Region",
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[1.83, 15.93]
],
...
]
}
}
...
]
}
如果我将其插入 Mapbox geojsonhint,它不会显示任何错误:
{
"type": "FeatureCollection",
"properties": {
"name": "United states of America"
},
"features": [
{
"type": "Feature",
"properties": {
"REGION_ID": 1,
"REGION_NAME": "My First Region"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[1.83, 15.93], [1.83, 15.93], [1.83, 15.93], [1.83, 15.93]
]
]
}
}
]
}
我正在使用 GeoJson 格式为一个国家/地区创建地图,但我想知道在哪里放置额外的国家/地区信息,例如 Name
、Country Code
和一些有用的信息。
我知道我们可以很容易地为特征(在我的例子中是区域数据)做到这一点,但是我可以在哪里放置国家/地区属性?
us.json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"REGION_ID": 1,
"REGION_NAME": "My First Region",
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[1.83, 15.93]
],
...
]
}
}
...
]
}
如果我将其插入 Mapbox geojsonhint,它不会显示任何错误:
{
"type": "FeatureCollection",
"properties": {
"name": "United states of America"
},
"features": [
{
"type": "Feature",
"properties": {
"REGION_ID": 1,
"REGION_NAME": "My First Region"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[1.83, 15.93], [1.83, 15.93], [1.83, 15.93], [1.83, 15.93]
]
]
}
}
]
}