Convert shape file (.shp) to xml / json

I am working with a shapefile (.shp, .dbf, etc.) and would like to convert it to xml. I am on a mac and it is difficult for me to find an application that will help me with the conversion. Does anyone know a way to convert this file format to an XML file?

+65
xml file-format gis
Feb 08 2018-10-18
source share
6 answers

What did Dassuki say. Get GDAL from http://www.kyngchaos.com/software:frameworks . Use it to convert a shapefile to GeoJSON as follows:

$ ogr2ogr -f "GeoJSON" output.json input.shp 

eg

 $ ogr2ogr -f "GeoJSON" /tmp/world.json world_borders.shp world_borders $ cat /tmp/world.json { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "CAT": 1.000000, "FIPS_CNTRY": "AA", "CNTRY_NAME": "Aruba", "AREA": 193.000000, "POP_CNTRY": 71218.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -69.882233, ... ... 
+91
Feb 12 2018-10-12
source share

GDAL is your friend. Use the ogr2ogr libraries, and here is the cheat sheet .

If you want to use a good GIS application, install QGIS and download the gdal converter plugin

+45
Feb 08 2018-10-18
source share

I found this site that converts many Geo formats: http://mygeodata.eu/apps/converter/index_en.html

In less than 2 minutes, I was able to convert the ShapeFile zip to a GeoJson file!

(I tried GDAL at the same time and still downloaded ...)

+31
Nov 28 2018-11-11T00:
source share

This online converter worked for me

http://mapshaper.org/

I uploaded my .shp file, then exported it to GeoJson.

+6
Aug 02 '15 at 10:29
source share

I can also offer a very round answer.

Place the geoserver on your computer (you can download a standalone zip file)

Set up a data warehouse that points to your shapefile.

Set up a layer pointing to the data warehouse

Go to the preview layers page and ask for WFS as a GML preview

Voila - xml view of your shapefile.

+3
Feb 09 2018-10-10T00
source share

I tried all the solutions and see that @ iYazee6 answer is the easiest! thanks to him

-one
Jul 14 '19 at 20:19
source share



All Articles