Hi, i noticed that using
<ogc:BBOX> filter == .Filter
<ogc:Intersects> == STIntersects
The mapping can be found in SQLServerFilterToSQL.visitBinarySpatialOperator.
Because of the use of .Filter, <ogc:BBOX> seem to be returning me the wrong
error.
<ogc:BBOX>
<ogc:PropertyName>er:location</ogc:PropertyName>
<gml:Envelope srsName="EPSG:4326">
<gml:lowerCorner>114 30</gml:lowerCorner>
<gml:upperCorner>115 31</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
From the sqlserver, running the following query generated as a result of the
above bbox using .FILTER returns me
SELECT
CAST("LOCATION".STSrid as VARCHAR) + ':' + "LOCATION".STAsText() as
"LOCATION"
FROM "ER_MININGFEATUREOCCURRENCE"
WHERE "LOCATION".Filter(geometry::STGeomFromText('POLYGON ((114 30, 114 31,
115 31, 115 30, 114 30))', 4326)) = 1
4326:POINT (117.3255 -35.03178)
4326:POINT (117.573097 -35.05859)
4326:POINT (117.791397 -35.041531)
4326:POINT (117.140676 -35.044455)
4326:POINT (117.325104 -35.03162)
4326:POINT (117.325104 -35.03162)
which is way out of range. Changing it to the use of ogc:Intersects yields
the correct result. So is it really accurate to use BBOX with .FILTER?
I post my question to the sqlserver forum and this is their reply
This is expected behaviour - you're using the Filter() method, which
performs only a primary filter of the records from the table - this is a
fast, approximate method that returns a superset of those points that
intersect the supplied polygon.
If you want only those points from the table that definitely intersect the
polygon, use STIntersects() instead of Filter()
--
View this message in context: http://old.nabble.com/sqlserver-BBox-%3D%3D-Filter-incorrect-result-returned-tp30860541p30860541.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.