[Geoserver-users] epsg to srs code matching for 1.7.0rc2 GET requests

Hi there,

i've run into a problem with GET requests going to geoserver, oracle
is the datasource, openlayers is the client.

In this case i'm overlaying a google map, but the problem also exists
even when its a straight epsg:4326 map.

It seems that openlayers asks this of the WFS to render a WFS layer:

http://localhost/geoserver/wfs?typename=acted%3ALOCATION_PROFILES&VERSION=1.1.1&SERVICE=WFS&REQUEST=GetFeature&SRS=EPSG%23900913&BBOX=31.327875542134397,17.681011813612997,101.64037553932717,46.82662679640924

easier to read version:
http://localhost/geoserver/wfs
?typename=acted%3ALOCATION_PROFILES
&VERSION=1.1.0
&SERVICE=WFS
&REQUEST=GetFeature
&SRS=EPSG%23900913
&BBOX=31.327875542134397,17.681011813612997,101.64037553932717,46.82662679640924

that results in a null SRID going to oracle, and the stack trace shows
oracle bitching about that.

if however you fix the above url so the hash (#) is not url encoded,
the request works fine.. but strangely the value of the epsg code
given makes no difference to the coordinates or features returned. In
fact as long as the SRS parameter contains the hash it works, if not
it never does. No use of URN_blah or the EPSG:xxxx method works.
(grumbles bout how many ways to define a srs there needs to be).
Looking closer, geoserver isn't applying a spatial filter to the query
unless there is a hash in the url, in which case it never matches the
epsg to the SRID.

geoserver is 1.7.0RC2, running on tomcat 5.5.

WMS is working fine with reprojections in 1.7.0rc2.

To fix this i downloaded 1.6.4b, and here it seems the SRS parameter
is completely ignored (can be missing or wrong) so the problem goes
away.

keeping track of which geoserver version uses what srs descriptor for
each wfs version and which ones are optional and which ones make a
difference to what service is a challenge.. is there a table/doco
somewhere ?

incidentally after downloading 'stable' 1.6.4b i find it doesn't work
with WMS coz of this bug:
http://www.nabble.com/Problem-Geoserver-1.6.4-and-Oracle-Spatial-(10.2)-td19182679.html

shouldn't these fixes be moved to the 'stable production' download ?

so i'm all fixed but i just wanted to report this possible problem
with the WFS requests for the latest RC

thanks peoples,

-i

Ivan Price ha scritto:

Hi there,

i've run into a problem with GET requests going to geoserver, oracle
is the datasource, openlayers is the client.

In this case i'm overlaying a google map, but the problem also exists
even when its a straight epsg:4326 map.

It seems that openlayers asks this of the WFS to render a WFS layer:

http://localhost/geoserver/wfs?typename=acted%3ALOCATION_PROFILES&VERSION=1.1.1&SERVICE=WFS&REQUEST=GetFeature&SRS=EPSG%23900913&BBOX=31.327875542134397,17.681011813612997,101.64037553932717,46.82662679640924

easier to read version:
http://localhost/geoserver/wfs
?typename=acted%3ALOCATION_PROFILES
&VERSION=1.1.0
&SERVICE=WFS
&REQUEST=GetFeature
&SRS=EPSG%23900913
&BBOX=31.327875542134397,17.681011813612997,101.64037553932717,46.82662679640924

Wow, what a mess (see below) :slight_smile:

that results in a null SRID going to oracle, and the stack trace shows
oracle bitching about that.

I see various issues. OL cannot handle GML3, so it should be using
WFS 1.0, not 1.1, and not even 1.1.1 as it appears in the original
sample.

WFS 1.0 does not officially support reprojection, so the SRS parameter
is ignored by most WFS 1.0 servers. In the case of GeoServer, we implemented it anyways for 1.0 especially to support OL editing atop
Google Maps background (with your data in another SRS).

You should also consider that that box is invalid, in WFS 1.1 you have
to express in bbox in lat/lon order, and you'll get back data in that
order as well unless you reproject the output (see
http://geoserver.org/display/GEOSDOC/2.+WFS). OL does not support
lat/lon ordered data btw.

The srs parameter is also wrong, no WFS specification uses that, if you
want the output to be reprojected, the name is srsName. It seems to
me the above request is making a lot of confusion with the WMS protocol.

So, a proper request would look like:

http://localhost:8080/geoserver/wfs?typename=topp:ora_states&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&BBOX=-127.6,23,-64,50&srsName=epsg:900913

Now, as you say, it does not work... there is a bug that must
be fixed in how GeoServer encodes filters like bbox, that do not
name the column to be used for filtering.

I've opened a jira issue for this, I should be fixing it shortly:
http://jira.codehaus.org/browse/GEOS-2204

if however you fix the above url so the hash (#) is not url encoded,
the request works fine.. but strangely the value of the epsg code
given makes no difference to the coordinates or features returned. In
fact as long as the SRS parameter contains the hash it works, if not
it never does. No use of URN_blah or the EPSG:xxxx method works.
(grumbles bout how many ways to define a srs there needs to be).
Looking closer, geoserver isn't applying a spatial filter to the query
unless there is a hash in the url, in which case it never matches the
epsg to the SRID.

geoserver is 1.7.0RC2, running on tomcat 5.5.

WMS is working fine with reprojections in 1.7.0rc2.

To fix this i downloaded 1.6.4b, and here it seems the SRS parameter
is completely ignored (can be missing or wrong) so the problem goes
away.

keeping track of which geoserver version uses what srs descriptor for
each wfs version and which ones are optional and which ones make a
difference to what service is a challenge.. is there a table/doco
somewhere ?

incidentally after downloading 'stable' 1.6.4b i find it doesn't work
with WMS coz of this bug:
http://www.nabble.com/Problem-Geoserver-1.6.4-and-Oracle-Spatial-(10.2)-td19182679.html

shouldn't these fixes be moved to the 'stable production' download ?

And it is, it has been fixed in 1.6.5, which still hasn't been released:
http://jira.codehaus.org/browse/GEOS-1946
Btw, 1.6.5 will be the last release, after that the 1.6.x series is dead
unless anyone steps up to backport the fixes and make further releases.

Cheers
Andrea

Andrea Aime ha scritto:

I've opened a jira issue for this, I should be fixing it shortly:
http://jira.codehaus.org/browse/GEOS-2204

Hum, it seems 1.6.5 is already in the making and the associated
GeoTools release has already been cut, meaning I'm too late to
fix it for the 1.6.x series...
Anyways, I'm still in time for 1.7.0-rc3, so I'm shooting for it.

Cheers
Andrea

Thanks Andrea thats excellent news. I'm up and working using
1.6.4(latest), maybe some text such as yours here should go on the
openlayers wfs-reproject example page ? 1.7 is looking really great
btw.. very impressed by the latest work with openlayers and
reprojection/sld/cacheing stuff !

cheers,

-i

2008/9/8 Andrea Aime <aaime@anonymised.com>:

Andrea Aime ha scritto:

I've opened a jira issue for this, I should be fixing it shortly:
http://jira.codehaus.org/browse/GEOS-2204

Hum, it seems 1.6.5 is already in the making and the associated
GeoTools release has already been cut, meaning I'm too late to
fix it for the 1.6.x series...
Anyways, I'm still in time for 1.7.0-rc3, so I'm shooting for it.

Cheers
Andrea