Skip to main content
idfg-badge

Idaho Fish and Game

Basic Steps for Converting an ArcMap Shapefile to GeoJSON

idfg-jstrickland

The process of converting a shapefile to GeoJSON is straight forward – it just requires a few steps.  While GeoJSON can handle multiple types (e.g., points, lines, and polygons) simultaneously in one file, a single shapefile cannot.  Therefore, this overview asks you to select and use a single shapefile.

 

Step 0.  If necessary, create the point, line, or polygon that you wish to make into a shapefile. Then save as feature (e.g., Drawing -> Convert Graphics to Features -> Save as shapefile).

 

Step 1.  Select a shapefile that you wish to convert.  This shapefile may contain one or more records, but note that everything will be converted.  If you want select records, then you need to select these records and save them to their own shapefile first (e.g., Data -> Export Data -> Selected features to an output feature class).

 

Step 2.  Convert shapefile layer to KML using ArcToolbox (i.e., ArcToolbox -> Conversion Tools -> To KML -> Layer to KML; see Example 1). 

 

Step 3.  Use an online conversion tool to convert KML (.kmz) file to GeoJSON.  One tool is to use http://ogre.adc4gis.com/ to upload the KML (*.kmz) file and convert it to GeoJSON.  Using this web site, in the “Convert to GeoJSON” section, under “File*:” Browse to and choose your file. Then select “Convert to GeoJSON”.  This will generate GeoJSON code and display in a new window (Example 2).

 

Step 4. Clean up GeoJSON code and validate using online tool.  The online KML-to-GeoJSON tool will add some extra (and potentially unnecessary) code to the GeoJSON export file.  You can clean this up by trimming unnecessary stuff at the beginning of the code, if desired (Example 3).  Validate your KML-to-GeoJSON conversion by copying and pasting the GeoJSON code into window at http://geojsonlint.com/, then “Test GeoJSON”.  If code is correct, this will display your location on a map (Example 4).

 

 

Example 1 (for Step 2). ArcMap Layer To KML

 

Example 2 (for Step 3). GeoJSON output:

{

"type": "FeatureCollection",

"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

"features": [

{ "type": "Feature", "properties": { "Name": "3N 2E 14", "Description": " \/head>

3N 2E 14\/td> \/tr>
FID\/td> 0\/td> \/tr>
TRS\/td> T 03 NR 02  E 014\/td> \/tr>
SECTION\/td> 14\/td> \/tr>
TOWNRANGE\/td> T 03 NR 02  E\/td> \/tr>
NAME\/td> 3N 2E 14\/td> \/tr>
SHAPE_area\/td> 2614561.62831\/td> \/tr>
SHAPE_len\/td> 6468.228208\/td> \/tr> \/table> \/td> \/tr> \/table> \/body> \/html>" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -116.173349131967598, 43.592406515151097, 0.0 ], [ -116.173352859582806, 43.593335222258943, 0.0 ], [ -116.173396030892604, 43.596506495703117, 0.0 ], [ -116.173396357521995, 43.596978493872442, 0.0 ], [ -116.173429829365304, 43.600636779777894, 0.0 ], [ -116.1734632166457, 43.60429517589948, 0.0 ], [ -116.178454329840307, 43.604295613848862, 0.0 ], [ -116.183445427704896, 43.604296350172127, 0.0 ], [ -116.185447407007501, 43.604296599339797, 0.0 ], [ -116.188436440883095, 43.604296869883413, 0.0 ], [ -116.193427530174006, 43.604297409623172, 0.0 ], [ -116.193437078656203, 43.602773711537658, 0.0 ], [ -116.193442252650499, 43.60194291747883, 0.0 ], [ -116.193445231076893, 43.600678221453641, 0.0 ], [ -116.193469630636997, 43.597072124086402, 0.0 ], [ -116.193518556624994, 43.593476839137871, 0.0 ], [ -116.193567485386694, 43.589881552188587, 0.0 ], [ -116.188515271107704, 43.589833819143387, 0.0 ], [ -116.183463067880098, 43.589786194180107, 0.0 ], [ -116.178410776930804, 43.589738752944257, 0.0 ], [ -116.173358558431204, 43.589691012943547, 0.0 ], [ -116.173349131967598, 43.592406515151097, 0.0 ] ] ] ] } }

]

}

 

Example 3 (Step 4). Trimmed GeoJSON Code.

{ "type": "MultiPolygon", "coordinates": [ [ [ [ -116.173349131967598, 43.592406515151097, 0.0 ], [ -116.173352859582806, 43.593335222258943, 0.0 ], [ -116.173396030892604, 43.596506495703117, 0.0 ], [ -116.173396357521995, 43.596978493872442, 0.0 ], [ -116.173429829365304, 43.600636779777894, 0.0 ], [ -116.1734632166457, 43.60429517589948, 0.0 ], [ -116.178454329840307, 43.604295613848862, 0.0 ], [ -116.183445427704896, 43.604296350172127, 0.0 ], [ -116.185447407007501, 43.604296599339797, 0.0 ], [ -116.188436440883095, 43.604296869883413, 0.0 ], [ -116.193427530174006, 43.604297409623172, 0.0 ], [ -116.193437078656203, 43.602773711537658, 0.0 ], [ -116.193442252650499, 43.60194291747883, 0.0 ], [ -116.193445231076893, 43.600678221453641, 0.0 ], [ -116.193469630636997, 43.597072124086402, 0.0 ], [ -116.193518556624994, 43.593476839137871, 0.0 ], [ -116.193567485386694, 43.589881552188587, 0.0 ], [ -116.188515271107704, 43.589833819143387, 0.0 ], [ -116.183463067880098, 43.589786194180107, 0.0 ], [ -116.178410776930804, 43.589738752944257, 0.0 ], [ -116.173358558431204, 43.589691012943547, 0.0 ], [ -116.173349131967598, 43.592406515151097, 0.0 ] ] ] ] }

 

Example 4 (Step 4). Validated GeoJSON Code.