[Geoserver-devel] WFS, POST and coordinate transfo

Hi all,

I am sending the following POST to geoserver (1.3.0 RC1) :
-----
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature xmlns="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
handle="geoserverQuery" outputFormat="GML2">
<Query handle="q04" typeName="bdtopo:surfdeau">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:PropertyName>regimede</ogc:PropertyName>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsLike escape="!" singleChar="?" wildCard="*">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Surface d*</ogc:Literal>
</ogc:PropertyIsLike>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>regimede</ogc:PropertyName>
<ogc:Literal>Permanent </ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:BBOX>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Box srsName="EPSG:3044">
<gml:coordinates>329033.2,5256716.9 362958.7,5297026.3
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:And>
</ogc:Filter>
</Query>
</GetFeature>
-----

The postgreSQL datastore holds data under EPSG:27572 (not
EPSG:3044). Looking at the log, I've got :
-----
...
^@256828178 [FIN] org.geotools.filter.FilterSAXParser -
escape char is !
^@256828179 [FIN] org.geotools.filter.FilterSAXParser - if
null get new : !
^@256828189 [FIN]
org.vfny.geoserver.wfs.requests.readers.GetFeatureXmlReader
- just parsed: org.xml.sax.InputSource@anonymised.com
^@256828190 [INFO]
org.vfny.geoserver.servlets.AbstractService - handling request:
Request: null
output format:GML2
max features:2147483647
version:
queries:
  Query [q04]
   feature type: bdtopo:surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]

^@255400695 [FIN]
org.vfny.geoserver.servlets.AbstractService - strategy is:
org.vfny.geoserver.servlets.SpeedStrategy@anonymised.com
^@255400697 [FIN] org.vfny.geoserver.global.Data - getting
type bdtopo:surfdeau
^@255400698 [FIN] org.geotools.data.postgis.PostgisDataStore
- get Feature source called on surfdeau
^@255400699 [FIN] org.geotools.data.postgis.PostgisDataStore
- returning pg feature locking
^@255052313 [FIN] DefaultFactory - Unavailable factory:
European Petroleum Survey Group
^@255056830 [FIN]
org.geotools.referencing.factory.DatumAliases - Loading
datum aliases from
"file:/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/geoserver130RC1/loader/org/geotools/referencing/factory/DatumAliasesTable.txt".
^@255400701 [FIN]
org.vfny.geoserver.wfs.responses.FeatureResponse - Query is
  Query [q04]
   feature type: bdtopo:surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]
To gt2: Query: [q04]
   feature type: surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]
^@255400723 [FIN] org.geotools.data.jdbc.JDBCDataStore -
calling sql builder with filter [[ regimede = Permanent ]
AND [ the_geom bbox POLYGON ((329033.2 5256716.94, 329033.2
5297026.26, 362958.71 5297026.26, 362958.71 5256716.94,
329033.2 5256716.94)) ]]
^@255400725 [FIN] org.geotools.data.jdbc.JDBCDataStore - sql
is SELECT "layerid", "gid", "nature", "regimede" FROM
"surfdeau" WHERE ("regimede" = 'Permanent ' AND "the_geom"
&& GeometryFromText('POLYGON ((329033.2 5256716.94, 329033.2
5297026.26, 362958.71 5297026.26, 362958.71 5256716.94,
329033.2 5256716.94))', 27572))
...
-----

It seems that the requested SRS (3044) is not taken into
account and the queried bbox is sent as is (SRS 27572) (is
it related to EPSG default factory not found?), leading in
having no data (needless to say that everything works fine
when asking with the 27572 SRS)!

Any idea ?

didier

************************ ADSL JUSQU'A 8 MEGA + 3 MOIS DE TELEPHONE GRATUIT ************************
L'ultra haut débit à 15EUR/mois seulement ! Et vous téléphonez gratuitement en France vers les postes fixes,
hors numéros spéciaux pendant 3 mois.
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ (voir conditions sur le site)

Coordinate transforms aren't really supported by the wfs 1.0 spec. They
never comment on doing what you did, like how to report if the srs is not
handled or any of that. It's basically a hole in the spec, and GeoServer
just assumes that you're asking for the same coordinate system (as all
wfs's do afaik).

The good news is that it's in the 1.1 spec, so GeoServer will implement
it. And it shouldn't be hard at all, since WMS already does it. They
have specific properties in the GetFeature request for coordinate system
requests, instead of just specifying the bbox in a different system. If
you were interested in implementing I could point you at how to. Should
not be too hard, just add a few things to the Query request in geoserver,
get the parsers to read them in, and then have the response pass it to
gt2. It should be all geoserver work, since the datastores are all crs
aware.

We don't have a strong motivatoin to fully implement the 1.1 spec, but if
users implement any of the new features we will happily roll them in.

best regards,

Chris

On Mon, 20 Jun 2005, dgr@anonymised.com wrote:

Hi all,

I am sending the following POST to geoserver (1.3.0 RC1) :
-----
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature xmlns="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
handle="geoserverQuery" outputFormat="GML2">
<Query handle="q04" typeName="bdtopo:surfdeau">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:PropertyName>regimede</ogc:PropertyName>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsLike escape="!" singleChar="?" wildCard="*">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Surface d*</ogc:Literal>
</ogc:PropertyIsLike>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>regimede</ogc:PropertyName>
<ogc:Literal>Permanent </ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:BBOX>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Box srsName="EPSG:3044">
<gml:coordinates>329033.2,5256716.9 362958.7,5297026.3
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:And>
</ogc:Filter>
</Query>
</GetFeature>
-----

The postgreSQL datastore holds data under EPSG:27572 (not
EPSG:3044). Looking at the log, I've got :
-----
...
^@256828178 [FIN] org.geotools.filter.FilterSAXParser -
escape char is !
^@256828179 [FIN] org.geotools.filter.FilterSAXParser - if
null get new : !
^@256828189 [FIN]
org.vfny.geoserver.wfs.requests.readers.GetFeatureXmlReader
- just parsed: org.xml.sax.InputSource@anonymised.com
^@256828190 [INFO]
org.vfny.geoserver.servlets.AbstractService - handling request:
Request: null
output format:GML2
max features:2147483647
version:
queries:
  Query [q04]
   feature type: bdtopo:surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]

^@255400695 [FIN]
org.vfny.geoserver.servlets.AbstractService - strategy is:
org.vfny.geoserver.servlets.SpeedStrategy@anonymised.com
^@255400697 [FIN] org.vfny.geoserver.global.Data - getting
type bdtopo:surfdeau
^@255400698 [FIN] org.geotools.data.postgis.PostgisDataStore
- get Feature source called on surfdeau
^@255400699 [FIN] org.geotools.data.postgis.PostgisDataStore
- returning pg feature locking
^@255052313 [FIN] DefaultFactory - Unavailable factory:
European Petroleum Survey Group
^@255056830 [FIN]
org.geotools.referencing.factory.DatumAliases - Loading
datum aliases from
"file:/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/geoserver130RC1/loader/org/geotools/referencing/factory/DatumAliasesTable.txt".
^@255400701 [FIN]
org.vfny.geoserver.wfs.responses.FeatureResponse - Query is
  Query [q04]
   feature type: bdtopo:surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]
To gt2: Query: [q04]
   feature type: surfdeau
   filter: [[ nature is like Surface d* ] AND [ regimede =
Permanent ] AND [ the_geom bbox POLYGON ((329033.2
5256716.94, 329033.2 5297026.26, 362958.71 5297026.26,
362958.71 5256716.94, 329033.2 5256716.94)) ]]
   [properties: nature, regimede]
^@255400723 [FIN] org.geotools.data.jdbc.JDBCDataStore -
calling sql builder with filter [[ regimede = Permanent ]
AND [ the_geom bbox POLYGON ((329033.2 5256716.94, 329033.2
5297026.26, 362958.71 5297026.26, 362958.71 5256716.94,
329033.2 5256716.94)) ]]
^@255400725 [FIN] org.geotools.data.jdbc.JDBCDataStore - sql
is SELECT "layerid", "gid", "nature", "regimede" FROM
"surfdeau" WHERE ("regimede" = 'Permanent ' AND "the_geom"
&& GeometryFromText('POLYGON ((329033.2 5256716.94, 329033.2
5297026.26, 362958.71 5297026.26, 362958.71 5256716.94,
329033.2 5256716.94))', 27572))
...
-----

It seems that the requested SRS (3044) is not taken into
account and the queried bbox is sent as is (SRS 27572) (is
it related to EPSG default factory not found?), leading in
having no data (needless to say that everything works fine
when asking with the 27572 SRS)!

Any idea ?

didier

************************ ADSL JUSQU'A 8 MEGA + 3 MOIS DE TELEPHONE GRATUIT ************************
L'ultra haut débit à 15EUR/mois seulement ! Et vous téléphonez gratuitement en France vers les postes fixes,
hors numéros spéciaux pendant 3 mois.
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ (voir conditions sur le site)

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--