GeoJSON format

During javascript programming, json format is a relatively simple and easy to accept a data form, complete key value corresponds to a very good combination with a javascript object. Server-side a lot of class library can be the object of the server to generate json, including simplejson, Newtonsoft.Json and communicate with the server-side, convenient and quick, not included with other information like xml superfluous. Write himap consider use geojson to when the data sources, and arcmap by FME can easily format vector data converted to geojson following instructions geojson 1.0 standard object:

 

Point

{ "type": "Point", "coordinates": [100.0, 0.0] }

LineString

{ “type”: “LineString”,
“coordinates”: [ [100.0, 0.0], [101.0, 1.0] ]
}

Polygon

{ “type”: “Polygon”,
“coordinates”: [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
]
}

with hole:

{ “type”: “Polygon”,
“coordinates”: [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
]
}

MultiPoint

{ “type”: “MultiPoint”,
“coordinates”: [ [100.0, 0.0], [101.0, 1.0] ]
}

MultiLineString

{ “type”: “MultiLineString”,
“coordinates”: [
[ [100.0, 0.0], [101.0, 1.0] ],
[ [102.0, 2.0], [103.0, 3.0] ]
]
}

MultiPolygon

{ “type”: “MultiPolygon”,
“coordinates”: [
[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],
[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
]
}

GeometryCollection

{ “type”: “GeometryCollection”,
“geometries”: [
{ "type": "Point",
"coordinates": [100.0, 0.0]
},
{ “type”: “LineString”,
“coordinates”: [ [101.0, 0.0], [102.0, 1.0] ]
}
]
}

FeatureCollection

{“name”:”subway_point”,”type”:”FeatureCollection”
,”features”:[
{"type":"Feature","geometry":{"type":"Point","coordinates":[116.189086914063,39.9382934570313]},”properties”:{“OBJECTID”:1}}
,{“type”:”Feature”,”geometry”:{“type”:”Point”,”coordinates”:[116.197875976563,39.9296875]},”properties”:{“OBJECTID”:2}}]
}

本文固定链接: http://www.higis.org/en/2012/06/21/geojson/ | Hi,GIS


该日志由 H.J 于2012年06月21日发表在 GIS, Program 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: GeoJSON format | Hi,GIS
关键字: ,

GeoJSON format:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter