Monday, June 17, 2019

Converting Shapefiles to GeoJson for free


Converting Shape Files into GeoJSON format

     Most of the free spatial data comes in shape files. In this post, I will focus on the spatial data files from Census Bureau spatial data. I received a lot of questions about how to download and convert shape files from Census Bureau. I will show you step by step how to download shape files and convert them into GeoJson format without using any third part tool.

      First step is pretty simple, we go to the Census Bureau and download the shape file you like to use. I will download the states map in the following example.



   Now we have the file, it should be in zip format.  We need to find a way to convert this shape files into GeoJson format. If you are interested, I have a post about how to insert Shape Files into SQL Server and convert the spatial data into GeoJson in SQL Server . If you want to convert the ShapeFiles into GeoJson without SQL Server, you can use some of the free available tools.  Let me introduce you MapShapper The best part about MapShapper is, you don't need to download and install anything. It is a web-based application.


      MapShapper can convert shapefiles into many formats including GeoJson. All you need to do is, to drag and drop files into the first box. It accepts zip files too! You can drag the file you downloaded from Census Bureau to the first box.



   Application reads the file and finds all the polygons and data in shapefile. In this point, all you need to do is, to click on Import button. You should visually see the data in the next page. Click on i button in the top right side to see data of each polygon/state.

    Pretty nice! Kudos to MapShapper creators. To download this data in geoJson, click on the Export button in the right top corner and select the GeoJson option then click on Export to get the file. If you pick geoJson, all data will be in one Json object. If you want to separate Json objects, pick JSON records.


No comments:

Post a Comment