Opened 12 years ago
Closed 12 years ago
#2320 closed defect (wontfix)
Operator && does not detect mixed SRIDs
Reported by: | darkblueb | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.0 |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: |
Description
given:
- function ST_GeomFromEWKT() creates binary geometry with the SRID "baked-in"
- ST_Intersects() detects, warns and fails on params with mixed SRIDs
select st_intersects( st_geomfromEWKT('SRID=4326;POINT(1 2)'), st_geomfromEWKT('SRID=3310;MULTIPOLYGON( ((0 0, 10 0, 10 10, 0 10, 0 0)) )' )); ERROR: Operation on mixed SRID geometries CONTEXT: SQL function "st_intersects" statement 1
but, the && operator does not warn, and incorrectly succeeds, on mixed SRID geometry
select st_geomfromEWKT('SRID=4326;POINT(1 2)') && st_geomfromEWKT('SRID=3310;MULTIPOLYGON( ((0 0, 10 0 , 10 10, 0 10, 0 0)) )' ); ?column? ---------- t (1 row)
tested on versions 2.0 and 2.1 trunk
Note:
See TracTickets
for help on using tickets.
This has always been an issue from the beginning of time and not one that is easy to fix. Boxes simply don't have srids so to add a check like that would significantly slow things down. && work on the boxes of geometries and in fact usually just touch the index if there is one and rarely the geometry.