I'm trying to convert a simple shapefile drawn in GIS to GeoJSON. However, it's not working and I don't know why.

enter image description here

The file converts with QGIS (Save As), but the http://geojsonlint.com/ doesn't plot the shape, nor does my Mapbox application - it plots it as a line.

I've set the CRS to EPSG 3857.

Here's the GeoJSON, http://pastebin.com/93e0wWzA

Do you need the Shapefile to figure this out?


Geojsonlint seems to suppose that GeoJSON is in WGS84 coordinate system which is also the only officially supported CRS in the newest GeoJSON specification (draft) https://tools.ietf.org/html/draft-butler-geojson-04

I converted your GeoJSON into epsg:4326 with ogr2ogr by using command

ogr2ogr -f geojson -s_srs epsg:3857 -t_srs epsg:4326 geojsontest2.json geojsontest.json

The new GeoJSON file does show in geojsonlint.

enter image description here

  • Hello - Can you share your ogr2ogr process? Thank you – SMacFadyen Oct 16 '14 at 11:55
  • I edited my answer. – user30184 Oct 16 '14 at 12:09
  • Thanks. Could there be a possibility that the coordinates would be represented in a different location - the Polygon isn't supposed to be there. Is that related to changing the CRS? – SMacFadyen Oct 16 '14 at 12:21
  • I don't understand. Do you mean that something has gone wrong with the first step when you converted your "simple shapefile drawn in GIS" into geojson? Nobody can say anything about that without making a test with the original shapefile. – user30184 Oct 16 '14 at 12:32
  • Would it be helpful to see the original Shapefile? – SMacFadyen Oct 16 '14 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.