SHP and JSON Mutual transfer (reprint)

Source: Internet
Author: User

For GIS development, these 2 kinds of data formats are too important.

I. SHP to JSON

This is easier, the method is more AH. You want to use SHP to define your own coordinate string json, in fact, the method is still more, there is no direct but indirect many.

(1) SHP->KML/KMZ

Using tools in ArcMap can be converted directly, not much nonsense. No, check it out for yourself.

(2) SHP has published a map service, then by requesting the rest service to return Geomerty, the format is JSON, you can also get



(3) Gdal tool, get the Geojson format AH

Reference http://www.bram.us/2012/03/14/convert-esri-shapefile-shp-to-geojson-json/

Plug-in to see if the Gdal tools, not installed self-installation



Find Ogr2ogr.exe and drag it into CMD.



Input command, mainly the path of the source file shp, the path of the target file JSON, the main conversion has a warning, is not supported in Chinese Ah, and the file directory also do not have Chinese, otherwise it will error.

The main purpose is to get the coordinate string, the result is OK.

(4) ARCGIS10.2 above, support geometry turn Wkt/json

Refer to http://blog.csdn.net/linghe301/article/details/29554257, this buddy's blog is very powerful.

Because I am still 10.0, did not personally try, but certainly is no problem ah.

(5) Online shp transfer Geojson

URL http://shp2json.ronny.tw/

But I don't know how to work it.

(6) Mapshaper, this online is very good, you can drag shp, obviously HTML5 do ah, good!

http://mapshaper.org/

Can not be converted, the main purpose seems to be to simplify the extraction of SHP.

Two. JSON to SHP

It seems not good, I searched for a long time ah.

(1) It is possible to pass the method mentioned in 1 (4). It's the JSON format that ArcGIS knows.

(2) Mapshaper, online conversion Geojson



JSON specific use of the time must be based on their own needs to deal with the above results, specific whether you use the manual or write procedures to deal with the look at their own.

For reference only, if you have a better way, you can exchange learning Ah, thank you!

SHP and JSON Mutual transfer (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.