Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

When I do a WFS request to GeoServer and specify the SRS like this:

http://myserver.com/geoserver/wfs?
    service=wfs&
    version=2.0.0&
    request=GetFeature&
    outputFormat=application/json&
    srsName=EPSG:4326&
    typeName=MYWORKSPACE:mylayer

I get exactly what I expect and it works fine.

When I remove the srsName=EPSG:4326 parmeter I get GeoJSON that still identifies itself with:

"crs": {
    "type": "EPSG",
    "properties": {
        "code": "4326"
    }
}

but the order of the coordinates is reversed, so it doesn't work.

Are both of these valid EPSG:4326 output, or is one of them wrong?

The layer I'm working with has these settings:

  • Native SRS: EPSG:4283
  • Declared SRS: EPSG:4326
  • SRS handling: Reproject native to declared
share|improve this question

3 Answers 3

The answer is yes they are both valid - which one you want depends on which version of the coordinate system and OGC standards you are using. See this page for a full discussion of the issues.

If you want to be sure of the order of your coordinates don't use epsg:4326 - check out the OGC URN's mentioned at the bottom of that page so you can be sure of what you are getting.

share|improve this answer

The short answer is that Geoserver confirms to the WFS Spec, which specifies the coordinate order like as; WFS 1.0.0 - longitude/latitude (x/y) WFS 1.1.0 - latitude/longitude (y/x) WFS 2.0.0 - latitude/longitude (y/x)

See http://docs.geoserver.org/stable/en/user/services/wfs/basics.html#axis-ordering

I'm using Leaflet. Switching to WFS 1.0.0 was way easier than some messy javascript workaround.

share|improve this answer

It's actually a bug in GeoServer.

GeoServer in it's WFS implementation specifies the order of coordinates for different versions and projection definitions (link) but GeoJSON states specifically that the order is always the same (x,y,z or lon,lat,alt). See the spec.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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