In this article we are converting GeoJSON to Shapefile shp format. You might be thinking why would anyone convert GeoJSON in shapefile. Answer is very simple Shapefile is very popular data format with open specification for data interoperability among GIS (Geographical information system) softwares. Before moving towards conversion steps we must look for GeoJSON and Shape file in detail. There Specification is given below.
Here is the Online Converter Tool from GeoJSON To Shapefile
Specification of GeoJSON-
Geojson data is open standard format, contains simple geographical feature with non-spatial data. In type element it has feature collection. That contains name, CRS (coordinate reference system) and features. These features can be line, point, polygon, Multi-Line string and multi-polygon.
Specification of Shapefile-
Shapefile is very popular data format specially among open source GIS softwares. It has some mandatory files, which contains various information such as index of geometry, attribute data and projection information.
- shx- contains geometry index,
- shp- contains geometry,
- dbf- contains attribute data,
- prj- contains projection data.
Convert GeoJSON to Shapefile using MapOG Tool
Convert GeoJSON to Shapefile Shp Using Gdal Utility-
Conversion from geojson to shapefile requires GDAL library in your system. For downloading it you can follow given commands.
To check the availability of library can be check by typing ogr2ogr in command prompt. You can also check the version of GDAL library by typing gdalinfo –version.
To convert data from geojson to shapefile we must have format available in library. To check the formats available you can execute the following command,
–> ogr2ogr –formats
you will get the following list that contains the drivers list. Check for the GeoJSON and Shapefile driver.
Now you can execute the conversion command given below,
–>ogr2ogr -f ‘ESRI Shapefile’ -a_srs EPSG:4326 Output_fileName.shp Input_FileName.geojson
Here Command shows some options of ogr2ogr utility as -f, which shows output file format, -a_srs shows SRS (spatial reference system) assigned to output file. The Generated output file can be seen on QGIS software.
Converted OutputĀ GeoJSON to Shapefile In QGIS software-
In similar way you can also convert Shp to geojson, shp to KML or many more.
Feel free to contact for any help or suggestions by commenting in given comment box.