3

I'm trying to generate a GeoJSON file with a feature collection of points to render in QGIS, however, when I load my .geojson file I don't see anything. To figure out what's going on, I've tried to get a trivial file to load. Here is an example:

{ "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-27.4670353, 153.013123]
      },
      "properties": {"prop0": "value0"}
    }
  ]
}

According to the GeoJSON documentation;

The coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) datum, with longitude and latitude units of decimal degrees

Sure enough, when I put the coordinates -27.4670353, 153.013123 into https://coordinates-converter.com/ I get a location somewhere in Brisbane, Australia:

enter image description here

However, when I copy the above JSON file into https://geojson.io/ I get nothing:

enter image description here

When I load the example GeoJSON file at https://gist.github.com/wavded/1200773?short_path=99c1af9 it does seem to work though:

enter image description here

However, to the best of my knowledge, these are not WGS84 decimal coordinates. What's happening here?

1 Answer 1

5

If you carefully look at GeoJSON docs that you cited, you can read

using the World Geodetic System 1984 (WGS 84) datum, with longitude and latitude units of decimal degrees

It clearly states that order of coordinates is [lon, lat], but in your GeoJSON order is reversed. So if you try this in geojson.io:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          153.013123,
          -27.4670353
        ]
      },
      "properties": {
        "prop0": "value0"
      }
    }
  ]
}

you will see this:

enter image description here

1
  • I often find it a good starting point to create a GeoJSON using geojson.io .
    – til_b
    Commented Mar 7 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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