I'm having problems with a WFS GetFeature request. I'm using OpenLayers with an OSM map as base layers which use the Google projection. Overlaying the layer with WMS works perfect. When I do a request to return all features within the bounds of a polygon, no features are found.
My layer uses EPSG:28992. the base layer uses: EPSG:900913
My layer configuration in GeoServer:
When I set the declared SRS to EPSG:900913 and set "SRS handling" to "Reproject native to declared" it works fine, but I need OpenLayers to reproject it, not GeoServer.
Below is an example request I would do. I think the problem is that GeoServer does not convert the spatial filter to the native SRS.
http://mydomain.com/wfs?request=GetFeature&version=1.1.0& srsName=epsg:28992& typeName=Namespace:Layer1& propertyName=(*)& CQL_FILTER=year = 2011 and INTERSECTS(geometry,POLYGON((565585.61613069 6816272.786200799,565585.61613069 6817032.3791692,564362.62367835 6817032.3791692,564362.62367835 6816272.786200799,565585.61613069 6816272.786200799)))& outputFormat=GMl2&
I just tried re-projecting some points from OpenLayers (EPSG:900913) via proj4js to EPSG:28992 (PostgreSQL and GeoServer). I took 3 points and compared them. They all showed an offset.
Converted: POINT(233492,24349424947 582191,0681508556)
In Database: POINT(233530,852147064 582315,680920578)
Difference x: 38,60865281453 Difference y: 124,6127697224
Converted: POINT(133459,1980658749 455770,7481867363)
In Database: POINT(133486,356985081 455879,67223342)
Difference x: 27,1589192061 Difference y: 108,9240466837
Converted: POINT(176920,43262818802 317930,36182729155)
In Database: POINT(176954,154083767 318023,515324756)
Difference x: 33,72145557898 Difference y: 93,15349746445
If the offset was constant I could correct it. Now I'm not sure if the offset is caused by GeSserver or by proj4js. I'm guessing proj4js since the WMS layer does not show any offset.