Opened 14 years ago
Closed 14 years ago
#3483 closed defect (fixed)
Coordinate system mixup in wfs geometry queries? wfs_filter_projmeter_beyond fails
Reported by: | warmerdam | Owned by: | assefa |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | WFS Server | Version: | unspecified |
Severity: | normal | Keywords: | WFS Filter |
Cc: |
Description
The wfs_filter_projmeter_beyond.xml test in msautotest/wxs/wfs_filter_projmeter.map fails for me in trunk. It returns an empty resultset instead of the expected features.
The request is:
# Verify BEYOND Results: all but Sydney excluded # RUN_PARMS: wfs_filter_projmeter_beyond.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0& REQUEST=GetFeature&TYPENAME=popplace&FILTER=<Filter><Beyond> <PropertyName>Geometry</PropertyName><gml:Point> <gml:coordinates>-60.18,46.10</gml:coordinates></gml:Point> <Distance units='dd'>0.05</Distance></Beyond></Filter>" > [RESULT]
The problem seems to be confusion about coordinate systems. In msQueryByOperator() in this code segment:
/* identify target shapes */ searchrect = qshape->bounds; #ifdef USE_PROJ if(lp->project && msProjectionsDiffer(&(lp->projection), &(map->projection))) msProjectRect(&(map->projection), &(lp->projection), &searchrect); /* project the searchrect to source coords */ else lp->project = MS_FALSE; #endif status = msLayerWhichShapes(lp, searchrect);
the searchrect is initially {minx = -152.77994996202705, miny = -46.499949962027038, maxx = 32.41994996202704, maxy = 138.69994996202703} but the reprojection goes from a map coordinate system of EPSG:3347 (LCC) instead of the geographic coordinate system that would presumably be more appropriate.
I believe lots of other tests are also failing for related reasons, but I picked one to isolate.
fix committed in r10347 for the beyond operator described here. test case now passes.
Note that few tests were failing due to #3173. They now pass.
There are still a couple of equal tests that I need to fix in the wfs test suite.