Martin Raie ( https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b6986f523300129cc446b3c ) *created* an issue
GeoServer ( https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) / Bug ( https://osgeo-org.atlassian.net/browse/GEOS-10911?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) GEOS-10911 ( https://osgeo-org.atlassian.net/browse/GEOS-10911?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) WFS getFeature does double reprojection if other SRS is set ( https://osgeo-org.atlassian.net/browse/GEOS-10911?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) Issue Type: Bug Assignee: Unassigned Created: 27/Mar/23 6:04 PM Priority: Medium Reporter: Martin Raie ( https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b6986f523300129cc446b3c ) If remote WFS service has features which define OtherSRS and if such layer CRS is configured as “Reproject native to declared” in Geoserver then Geoserver does reprojection twice when making getFeature request. To reproduce the issue, add following url as Web Feature Server (NG) store: https://teenus.maaamet.ee/ows/gpa?service=WFS ( https://teenus.maaamet.ee/ows/gpa?service=WFS ) and configure layer “ms_kohalik_vork”, setting native SRS: EPSG:3301, declared SRS: EPSG:3857, SRS handling: “Reproject native to declared”. When making query http://geoserver/geoserver/workspace/wfs?SERVICE=WFS&VERSION=1.3.0&REQUEST=GetFeature&typeName=workspace:ms_kohalik_vork&PROPERTYNAME=msGeometry&FEATUREID=kohalik_vork.33056 ( http://geoserver/geoserver/workspace/wfs?SERVICE=WFS&VERSION=1.3.0&REQUEST=GetFeature&typeName=workspace:ms_kohalik_vork&PROPERTYNAME=msGeometry&FEATUREID=kohalik_vork.33056 ) the result coordinates are following: <gml:pos> 8737543.97761727 578481.77163451 </gml:pos> The original coordinates from the service https://teenus.maaamet.ee/ows/gpa?PROPERTYNAME=msGeometry&REQUEST=GetFeature&FEATUREID=kohalik_vork.33056&VERSION=2.0.0&TYPENAMES=ms%3Akohalik_vork&SERVICE=WFS ( https://teenus.maaamet.ee/ows/gpa?PROPERTYNAME=msGeometry&REQUEST=GetFeature&FEATUREID=kohalik_vork.33056&VERSION=2.0.0&TYPENAMES=ms%3Akohalik_vork&SERVICE=WFS ) in EPSG:3301 are <gml:pos> 6562201.382000 714182.960000 </gml:pos> When converting 6562201.382000 714182.960000 in EPSG:3301 to EPSG:3857 the expected result should have been <gml:pos> 3088480.32010006 8211704.47330954 </gml:pos> The result 8737543.97761727 578481.77163451 can be achieved when doing EPSG:3301->EPSG:3857 conversion twice. When using some similar WFS service which doesn’t define OtherSRS then results are correct. I believe the problem is using both ReprojectFeatureResults and ReprojectFeatureReader classes. If OtherSRS is not set, following row in code sets coordinateSystem null and everything works correctly: https://github.com/geoserver/geoserver/blob/main/src/main/src/main/java/org/vfny/geoserver/global/GeoServerFeatureSource.java#L584 ( https://github.com/geoserver/geoserver/blob/main/src/main/src/main/java/org/vfny/geoserver/global/GeoServerFeatureSource.java#L584 ) If OtherSRS is set and coordinateSystem is not null then code reaches here: https://github.com/geotools/geotools/blob/ea553f72c8b02b4c0075fa454fce04891d881ded/modules/unsupported/wfs-ng/src/main/java/org/geotools/data/wfs/WFSFeatureSource.java#L356 ( https://github.com/geotools/geotools/blob/ea553f72c8b02b4c0075fa454fce04891d881ded/modules/unsupported/wfs-ng/src/main/java/org/geotools/data/wfs/WFSFeatureSource.java#L356 ) and second reprojection is done with ReprojectFeatureReader. ( https://osgeo-org.atlassian.net/browse/GEOS-10911#add-comment?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) Add Comment ( https://osgeo-org.atlassian.net/browse/GEOS-10911#add-comment?atlOrigin=eyJpIjoiZTI3NDM3MmYwNWE1NDJmMmFhZDQ0ZTg4NmMzNTU2M2MiLCJwIjoiaiJ9 ) Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:ac3e918 )
_______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-devel