Tag Archives: QGis

[SOLVED] QGis Invalid export geojson result

I need to convert a .shp file to .geojson for my leaflet based web map. When i export the layer to geojson it’s says successful and the result looks like just OK. But wait…

Leaflet normally ask geojson formatted like this:

Look at coordinates list. The latitude must be between -90 to 90 and -180 to 180 for longitude. But what i got is number about hundred thousand. After a quick googling, i got this stackexchange answer:

Try to change the layer CRS with Rightclick ->Set Layer CRS to EPSG:3857. To verify that your data is in the correct place you can load the openlayers plugin with Google or Openstreetmap background.

For Geojson export, the target CRS must be EPSG:4326. You have to set that manually when using Rightclick->Save As....