[Geoserver-users] Incorrect Results With Geometry Filter

I am trying to find a substitute for the Relates(T********) function in
Geoserver. Technically, filtering features which intersect and do not
touch the geometry should give the same results but I'm getting invalid
responses with Geoserver 1.3.2.

The filter I am sending to Geoserver is listed at the end of this email
for any interested in trying this out themselves. It is essentially a
INTERSECTS AND NOT TOUCHES filter (with an additional property filter to
limit results for debugging purposes). When I check the geometries of
the resultant features returned by Geoserver using JTS, 20 of the 23
evaluate to true for filterGeom.touches(featureGeom). The other three
evaluate to true for filterGeom.equals(featureGeom), which are the three
results I'm interested in.

Is the second condition ignored, or does Geoserver not support TOUCHES
properly? I'll file a bug if there's no known issue already, or if I'm
not doing something wrong with my filter.

***********************
Filter as sent to http://openmaps.gov.bc.ca/geoserver/wfs/GetFeature

<?xml version="1.0" encoding="UTF-8"?>
<GetFeature xmlns="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot; version="1.0.0" service="WFS"
outputFormat="GML2" maxFeatures="500"><Query
typeName="prod:orthobc"><ogc:Filter><ogc:And><ogc:Intersects><ogc:Proper
tyName>the_geom</ogc:PropertyName>
<gml:Polygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#3005&quot;&gt;&lt;gml:outerBoundar
yIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts="
">1338138.22848097,654291.00726857 1338431.04451064,654310.91803012
1338723.85936789,654330.84602621 1339016.67305171,654350.79125676
1339309.4855611,654370.75372172 1339602.29689502,654390.73342099
1339895.10705247,654410.73035453 1340187.91603243,654430.74452226
1340480.72383389,654450.7759241 1340773.53045584,654470.82456
1341066.33589726,654490.89042988 1341359.14015713,654510.97353367
1341651.94323444,654531.0738713 1341944.74512818,654551.19144271
1342237.54583733,654571.32624781 1342530.34536088,654591.47828656
1342823.14369782,654611.64755886 1343115.94084712,654631.83406466
1343408.73680778,654652.03780388 1343701.53157878,654672.25877645
1343994.32515911,654692.49698231 1344287.11754775,654712.75242138
1344579.90874368,654733.0250936 1344871.33720467,654753.22060606
1345165.48755339,654773.62213717 1345458.27516514,654793.94650839
1345751.06158012,654814.28811248 1346043.84679733,654834.64694935
1346336.63081576,654855.02301895 1346629.41363438,654875.4163212
1346922.19525219,654895.82685602 1347214.97566816,654916.25462336
1347507.75488129,654936.69962313 1347800.53289056,654957.16185527
1348093.30969496,654977.64131971 1348386.08529347,654998.13801637
1348678.85968508,655018.65194519 1348971.63286877,655039.18310609
1349264.40484353,655059.731499 1349557.17560835,655080.29712385
1349849.9451622,655100.87998058 1350142.71350409,655121.4800691
1350435.48063299,655142.09738935 1350728.24654788,655162.73194125
1351021.01124776,655183.38372474 1351313.77473161,655204.05273974
1351606.53699842,655224.73898619 1351897.93776483,655245.3462275
1352683.63292144,644139.69178598 1352391.58153408,644119.03853414
1352098.16560645,644098.30610077 1351804.74845906,644077.59093731
1351511.33009293,644056.89304385 1351217.91050907,644036.21242044
1350924.4897085,644015.54906716 1350631.06769222,643994.90298408
1350337.64446128,643974.27417127 1350044.22001667,643953.66262881
1349750.79435941,643933.06835676 1349457.36749052,643912.4913552
1349163.93941102,643891.9316242 1348870.51012192,643871.38916383
1348577.07962424,643850.86397415 1348283.647919,643830.35605525
1347990.21500721,643809.8654072 1347696.7808899,643789.39203005
1347403.34556806,643768.93592389 1347109.90904273,643748.49708879
1346816.47131492,643728.07552481 1346523.03238564,643707.67123203
1346229.59225592,643687.28421052 1345936.15092677,643666.91446034
1345641.343818,643646.46737799 1345349.26467423,643626.22677429
1345055.81975288,643605.90883855 1344762.37363617,643585.60817443
1344468.9263251,643565.32478201 1344175.47782071,643545.05866134
1343882.028124,643524.80981251 1343588.57723599,643504.57823557
1343295.1251577,643484.36393061 1343001.67189014,643464.16689769
1342708.21743434,643443.98713688 1342414.7617913,643423.82464825
1342121.30496205,643403.67943187 1341827.84694759,643383.55148782
1341534.38774896,643363.44081615 1341240.92736716,643343.34741694
1340947.46580321,643323.27129027 1340654.00305812,643303.21243619
1340360.53913293,643283.17085478 1340067.07402863,643263.14654611
1339773.60774625,643243.13951025 1339480.1402868,643223.14974726
1339186.6716513,643203.17725722 1338893.20184077,643183.2220402
1338598.36501583,643163.19134384 1337844.04848226,654271.02119584
1338138.22848097,654291.00726857</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Intersects>
<ogc:Not><ogc:Touches><ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Polygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#3005&quot;&gt;&lt;gml:outerBoundar
yIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts="
">1338138.22848097,654291.00726857 1338431.04451064,654310.91803012
1338723.85936789,654330.84602621 1339016.67305171,654350.79125676
1339309.4855611,654370.75372172 1339602.29689502,654390.73342099
1339895.10705247,654410.73035453 1340187.91603243,654430.74452226
1340480.72383389,654450.7759241 1340773.53045584,654470.82456
1341066.33589726,654490.89042988 1341359.14015713,654510.97353367
1341651.94323444,654531.0738713 1341944.74512818,654551.19144271
1342237.54583733,654571.32624781 1342530.34536088,654591.47828656
1342823.14369782,654611.64755886 1343115.94084712,654631.83406466
1343408.73680778,654652.03780388 1343701.53157878,654672.25877645
1343994.32515911,654692.49698231 1344287.11754775,654712.75242138
1344579.90874368,654733.0250936 1344871.33720467,654753.22060606
1345165.48755339,654773.62213717 1345458.27516514,654793.94650839
1345751.06158012,654814.28811248 1346043.84679733,654834.64694935
1346336.63081576,654855.02301895 1346629.41363438,654875.4163212
1346922.19525219,654895.82685602 1347214.97566816,654916.25462336
1347507.75488129,654936.69962313 1347800.53289056,654957.16185527
1348093.30969496,654977.64131971 1348386.08529347,654998.13801637
1348678.85968508,655018.65194519 1348971.63286877,655039.18310609
1349264.40484353,655059.731499 1349557.17560835,655080.29712385
1349849.9451622,655100.87998058 1350142.71350409,655121.4800691
1350435.48063299,655142.09738935 1350728.24654788,655162.73194125
1351021.01124776,655183.38372474 1351313.77473161,655204.05273974
1351606.53699842,655224.73898619 1351897.93776483,655245.3462275
1352683.63292144,644139.69178598 1352391.58153408,644119.03853414
1352098.16560645,644098.30610077 1351804.74845906,644077.59093731
1351511.33009293,644056.89304385 1351217.91050907,644036.21242044
1350924.4897085,644015.54906716 1350631.06769222,643994.90298408
1350337.64446128,643974.27417127 1350044.22001667,643953.66262881
1349750.79435941,643933.06835676 1349457.36749052,643912.4913552
1349163.93941102,643891.9316242 1348870.51012192,643871.38916383
1348577.07962424,643850.86397415 1348283.647919,643830.35605525
1347990.21500721,643809.8654072 1347696.7808899,643789.39203005
1347403.34556806,643768.93592389 1347109.90904273,643748.49708879
1346816.47131492,643728.07552481 1346523.03238564,643707.67123203
1346229.59225592,643687.28421052 1345936.15092677,643666.91446034
1345641.343818,643646.46737799 1345349.26467423,643626.22677429
1345055.81975288,643605.90883855 1344762.37363617,643585.60817443
1344468.9263251,643565.32478201 1344175.47782071,643545.05866134
1343882.028124,643524.80981251 1343588.57723599,643504.57823557
1343295.1251577,643484.36393061 1343001.67189014,643464.16689769
1342708.21743434,643443.98713688 1342414.7617913,643423.82464825
1342121.30496205,643403.67943187 1341827.84694759,643383.55148782
1341534.38774896,643363.44081615 1341240.92736716,643343.34741694
1340947.46580321,643323.27129027 1340654.00305812,643303.21243619
1340360.53913293,643283.17085478 1340067.07402863,643263.14654611
1339773.60774625,643243.13951025 1339480.1402868,643223.14974726
1339186.6716513,643203.17725722 1338893.20184077,643183.2220402
1338598.36501583,643163.19134384 1337844.04848226,654271.02119584
1338138.22848097,654291.00726857</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Touches>
</ogc:Not>
<ogc:PropertyIsEqualTo><ogc:PropertyName>FORMAT_ID</ogc:PropertyName>
<ogc:Literal>2</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
</Query>
</GetFeature>

John Fletcher
Latitude Geographics Group Ltd.
jfletcher@anonymised.com www.latitudegeo.com
Head Office: 204 Market Square Victoria, BC Canada V8W 3C6
Tel: (250) 381-8130 Fax: (250) 381-8132

Geocortex Internet Mapping (www.geocortex.net) - Helping people succeed
with web-based geography

Go ahead and report this as a bug. This is with shapefile datastore? Is it the same on postgis? Could you also set the logging to 'finer' and attach the logs to the issue you report. Also go ahead and report that the Relates function doesn't work.

best regards,

Chris

John Fletcher wrote:

I am trying to find a substitute for the Relates(T********) function in
Geoserver. Technically, filtering features which intersect and do not
touch the geometry should give the same results but I'm getting invalid
responses with Geoserver 1.3.2.

The filter I am sending to Geoserver is listed at the end of this email
for any interested in trying this out themselves. It is essentially a
INTERSECTS AND NOT TOUCHES filter (with an additional property filter to
limit results for debugging purposes). When I check the geometries of
the resultant features returned by Geoserver using JTS, 20 of the 23
evaluate to true for filterGeom.touches(featureGeom). The other three
evaluate to true for filterGeom.equals(featureGeom), which are the three
results I'm interested in.

Is the second condition ignored, or does Geoserver not support TOUCHES
properly? I'll file a bug if there's no known issue already, or if I'm
not doing something wrong with my filter.

***********************
Filter as sent to http://openmaps.gov.bc.ca/geoserver/wfs/GetFeature

<?xml version="1.0" encoding="UTF-8"?>
<GetFeature xmlns="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot; version="1.0.0" service="WFS"
outputFormat="GML2" maxFeatures="500"><Query
typeName="prod:orthobc"><ogc:Filter><ogc:And><ogc:Intersects><ogc:Proper
tyName>the_geom</ogc:PropertyName>
<gml:Polygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#3005&quot;&gt;&lt;gml:outerBoundar
yIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts="
">1338138.22848097,654291.00726857 1338431.04451064,654310.91803012
1338723.85936789,654330.84602621 1339016.67305171,654350.79125676
1339309.4855611,654370.75372172 1339602.29689502,654390.73342099
1339895.10705247,654410.73035453 1340187.91603243,654430.74452226
1340480.72383389,654450.7759241 1340773.53045584,654470.82456
1341066.33589726,654490.89042988 1341359.14015713,654510.97353367
1341651.94323444,654531.0738713 1341944.74512818,654551.19144271
1342237.54583733,654571.32624781 1342530.34536088,654591.47828656
1342823.14369782,654611.64755886 1343115.94084712,654631.83406466
1343408.73680778,654652.03780388 1343701.53157878,654672.25877645
1343994.32515911,654692.49698231 1344287.11754775,654712.75242138
1344579.90874368,654733.0250936 1344871.33720467,654753.22060606
1345165.48755339,654773.62213717 1345458.27516514,654793.94650839
1345751.06158012,654814.28811248 1346043.84679733,654834.64694935
1346336.63081576,654855.02301895 1346629.41363438,654875.4163212
1346922.19525219,654895.82685602 1347214.97566816,654916.25462336
1347507.75488129,654936.69962313 1347800.53289056,654957.16185527
1348093.30969496,654977.64131971 1348386.08529347,654998.13801637
1348678.85968508,655018.65194519 1348971.63286877,655039.18310609
1349264.40484353,655059.731499 1349557.17560835,655080.29712385
1349849.9451622,655100.87998058 1350142.71350409,655121.4800691
1350435.48063299,655142.09738935 1350728.24654788,655162.73194125
1351021.01124776,655183.38372474 1351313.77473161,655204.05273974
1351606.53699842,655224.73898619 1351897.93776483,655245.3462275
1352683.63292144,644139.69178598 1352391.58153408,644119.03853414
1352098.16560645,644098.30610077 1351804.74845906,644077.59093731
1351511.33009293,644056.89304385 1351217.91050907,644036.21242044
1350924.4897085,644015.54906716 1350631.06769222,643994.90298408
1350337.64446128,643974.27417127 1350044.22001667,643953.66262881
1349750.79435941,643933.06835676 1349457.36749052,643912.4913552
1349163.93941102,643891.9316242 1348870.51012192,643871.38916383
1348577.07962424,643850.86397415 1348283.647919,643830.35605525
1347990.21500721,643809.8654072 1347696.7808899,643789.39203005
1347403.34556806,643768.93592389 1347109.90904273,643748.49708879
1346816.47131492,643728.07552481 1346523.03238564,643707.67123203
1346229.59225592,643687.28421052 1345936.15092677,643666.91446034
1345641.343818,643646.46737799 1345349.26467423,643626.22677429
1345055.81975288,643605.90883855 1344762.37363617,643585.60817443
1344468.9263251,643565.32478201 1344175.47782071,643545.05866134
1343882.028124,643524.80981251 1343588.57723599,643504.57823557
1343295.1251577,643484.36393061 1343001.67189014,643464.16689769
1342708.21743434,643443.98713688 1342414.7617913,643423.82464825
1342121.30496205,643403.67943187 1341827.84694759,643383.55148782
1341534.38774896,643363.44081615 1341240.92736716,643343.34741694
1340947.46580321,643323.27129027 1340654.00305812,643303.21243619
1340360.53913293,643283.17085478 1340067.07402863,643263.14654611
1339773.60774625,643243.13951025 1339480.1402868,643223.14974726
1339186.6716513,643203.17725722 1338893.20184077,643183.2220402
1338598.36501583,643163.19134384 1337844.04848226,654271.02119584
1338138.22848097,654291.00726857</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Intersects>
<ogc:Not><ogc:Touches><ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Polygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#3005&quot;&gt;&lt;gml:outerBoundar
yIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts="
">1338138.22848097,654291.00726857 1338431.04451064,654310.91803012
1338723.85936789,654330.84602621 1339016.67305171,654350.79125676
1339309.4855611,654370.75372172 1339602.29689502,654390.73342099
1339895.10705247,654410.73035453 1340187.91603243,654430.74452226
1340480.72383389,654450.7759241 1340773.53045584,654470.82456
1341066.33589726,654490.89042988 1341359.14015713,654510.97353367
1341651.94323444,654531.0738713 1341944.74512818,654551.19144271
1342237.54583733,654571.32624781 1342530.34536088,654591.47828656
1342823.14369782,654611.64755886 1343115.94084712,654631.83406466
1343408.73680778,654652.03780388 1343701.53157878,654672.25877645
1343994.32515911,654692.49698231 1344287.11754775,654712.75242138
1344579.90874368,654733.0250936 1344871.33720467,654753.22060606
1345165.48755339,654773.62213717 1345458.27516514,654793.94650839
1345751.06158012,654814.28811248 1346043.84679733,654834.64694935
1346336.63081576,654855.02301895 1346629.41363438,654875.4163212
1346922.19525219,654895.82685602 1347214.97566816,654916.25462336
1347507.75488129,654936.69962313 1347800.53289056,654957.16185527
1348093.30969496,654977.64131971 1348386.08529347,654998.13801637
1348678.85968508,655018.65194519 1348971.63286877,655039.18310609
1349264.40484353,655059.731499 1349557.17560835,655080.29712385
1349849.9451622,655100.87998058 1350142.71350409,655121.4800691
1350435.48063299,655142.09738935 1350728.24654788,655162.73194125
1351021.01124776,655183.38372474 1351313.77473161,655204.05273974
1351606.53699842,655224.73898619 1351897.93776483,655245.3462275
1352683.63292144,644139.69178598 1352391.58153408,644119.03853414
1352098.16560645,644098.30610077 1351804.74845906,644077.59093731
1351511.33009293,644056.89304385 1351217.91050907,644036.21242044
1350924.4897085,644015.54906716 1350631.06769222,643994.90298408
1350337.64446128,643974.27417127 1350044.22001667,643953.66262881
1349750.79435941,643933.06835676 1349457.36749052,643912.4913552
1349163.93941102,643891.9316242 1348870.51012192,643871.38916383
1348577.07962424,643850.86397415 1348283.647919,643830.35605525
1347990.21500721,643809.8654072 1347696.7808899,643789.39203005
1347403.34556806,643768.93592389 1347109.90904273,643748.49708879
1346816.47131492,643728.07552481 1346523.03238564,643707.67123203
1346229.59225592,643687.28421052 1345936.15092677,643666.91446034
1345641.343818,643646.46737799 1345349.26467423,643626.22677429
1345055.81975288,643605.90883855 1344762.37363617,643585.60817443
1344468.9263251,643565.32478201 1344175.47782071,643545.05866134
1343882.028124,643524.80981251 1343588.57723599,643504.57823557
1343295.1251577,643484.36393061 1343001.67189014,643464.16689769
1342708.21743434,643443.98713688 1342414.7617913,643423.82464825
1342121.30496205,643403.67943187 1341827.84694759,643383.55148782
1341534.38774896,643363.44081615 1341240.92736716,643343.34741694
1340947.46580321,643323.27129027 1340654.00305812,643303.21243619
1340360.53913293,643283.17085478 1340067.07402863,643263.14654611
1339773.60774625,643243.13951025 1339480.1402868,643223.14974726
1339186.6716513,643203.17725722 1338893.20184077,643183.2220402
1338598.36501583,643163.19134384 1337844.04848226,654271.02119584
1338138.22848097,654291.00726857</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Touches>
</ogc:Not>
<ogc:PropertyIsEqualTo><ogc:PropertyName>FORMAT_ID</ogc:PropertyName>
<ogc:Literal>2</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
</Query>
</GetFeature>

John Fletcher
Latitude Geographics Group Ltd.
jfletcher@anonymised.com www.latitudegeo.com
Head Office: 204 Market Square Victoria, BC Canada V8W 3C6
Tel: (250) 381-8130 Fax: (250) 381-8132

Geocortex Internet Mapping (www.geocortex.net) - Helping people succeed
with web-based geography

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44c6b410267901362196140!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org