wfs json output, coordinates order problem

View: New views
5 Messages — Rating Filter:   Alert me  

wfs json output, coordinates order problem

by sige :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I tried to get wfs feature data from:
http://sigma.openplans.org/geoserver/wfs?request=GetFeature&typename=topp:tasmania_cities&outputformat=json&maxfeatures=10

and display the layer on:
http://openlayers.org/dev/examples/vector-formats.html

and the positions of the features don't look correct.

I found the order of the lat/lon in the coordinates element:
{"coordinates":[lat, lon]} is different from that in the geojson specification which is: {"coordinates":[lon,lat]}(http://geojson.org/geojson-spec.html#positions).

Is there a way of changing the coordinates order?

Thanks,

Sige

Re: wfs json output, coordinates ordor problem

by Rahkonen Jukka :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Have you tried what happens with WFS 1.0.0? Add &service=wfs&version=1.0.0 to your request. It may help. Without version the default is the highest WFS version supported by the server.

-Jukka Rahkonen-



sige wrote:

Hi,

I tried to get wfs feature data from:
http://sigma.openplans.org/geoserver/wfs?request=GetFeature&typename=topp:tasmania_cities&outputformat=json&maxfeatures=10

and display the layer on:
http://openlayers.org/dev/examples/vector-formats.html

and the positions of the features don't look correct.

I found the order of the lat/lon in the coordinates element:
{\coordinates\:[lat,lon]} is different from that in the geojson
specification which is:
{\coordinates\:[lat,lon]}(http://geojson.org/geojson-spec.html#positions).

Is there a way of changing the coordinates order?

Thanks,

Sige
--
View this message in context: http://old.nabble.com/wfs-json-output%2C-coordinates-ordor-problem-tp26225251p26225251.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: wfs json output, coordinates ordor problem

by sige :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, it works. Does this mean that OpenLayers doesn't support the he highest WFS version for GeoJson?

Thanks a lot!

Sige

Rahkonen Jukka wrote:
Hi,

Have you tried what happens with WFS 1.0.0? Add &service=wfs&version=1.0.0 to your request. It may help. Without version the default is the highest WFS version supported by the server.

-Jukka Rahkonen-



sige wrote:

Re: wfs json output, coordinates ordor problem

by Andrea Aime-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sige ha scritto:
> Yes, it works. Does this mean that OpenLayers doesn't support the he highest
> WFS version for GeoJson?

Things are kind of tricky here.
The WFS 1.1 protocol mandates lat/lon order for any geographic
coordinate system (this statement is actually a simplification, but most
of the time it's correct).

Now, GML3 capable clients should know about this and deal with the
ordinates order properly.
When it comes to JSON and Shapefile outputs we're still returning
data in lat/lon order, however basically no JSON/Shapefile
clients that we know of can handle that order

I know we have had a jira issue open about that for quite some time
but... I cannot really find it now :-(

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: wfs json output, coordinates ordor problem

by Roald de Wit-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi sige,

sige wrote:
> Yes, it works. Does this mean that OpenLayers doesn't support the he highest
> WFS version for GeoJson?
>  
OpenLayers does support WFS 1.1 and GMLv3, but you might have to
explicitly tell OL that it should use GMLv3 or tell it to switch the
order of lon/lat to lat/lon (not 100% sure). If you are interested in
following that path, please post a message in the OL users list. I'm
sure there will be a few people able and willing to help you out.

Regards, Roald



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users