c# - convert geoJson data to sql server spatial data type (GIS) -
i've downloaded openstreetmaps administrative borders (city, region, country, etc...) in geojson format.
i'm trying store json data related polygons in ms sql server using spatial data. since i've never parsed such complex json file i've got difficulties in manually creating c# object store parsed data.
i'm using newtonsoftjson.json, read geojson file , create object. use reflection properties related object. quite tedious task because in cases objects nested in more 4 levels in geojson file. since i've got store polygons cities in world, need faster , accurate way of doing it.
- what best method of achieving goal?
- i guess json schemas of great help, how?
- is there standard geojson schema, in sense if use schema openstreetmaps , other gis framework (google maps), compatible?
in sql server 2016 can parse geojson format using openjson function , can convert table of coordinates spatial types. each nested geojson level handled 1 additional cross apply call. also, can load geojson spatial columns if don't use sql server 2016 or want use logic in app layer, way json.net.
Comments
Post a Comment