Creating GeoJSON

Let’s say I have a shapefile and I’d like to convert it to GeoJSON. It’s simple to do in QGIS!


First, open up your layer to import it into QGIS. When I double-click it opens for me, but you might need to do Layer > Add Vector Layer. It will appear on the list of layers on the left-hand side.

Add Vector Layer

Layer opened

Now, right-click the layer and select Save as...

Save as...

  1. Pick GeoJSON from the Format dropdown.
  2. Select the place you’d like to export it to
  3. Instead of Layer CRS, which is probably the default, change it to Selected CRS. Then click ‘Browse’ and select NAD83 (or WGS 84, which is slightly better for the non-USA world [and I mean SLIGHTLY]).

it should look something like this:

Save as GeoJSON

NOTE: Selecting NAD83 or WGS84 as your CRS makes the output be in latitude and longitude. Your shapefile might not have been, though! For example, New York uses this thing called the NY State Plane system which is basically a grid just around New York, and 100% not latitude/longitude. I think using lat/lon keeps everything simpler.

Too big?

Your GeoJSON might be unimaginably large now! Or even just kind of large. Take a look at making geojson smaller

Want to hear when I release new things?
My infrequent and sporadic newsletter can help with that.