Opened 9 years ago

Closed 9 years ago

#3202 closed defect (fixed)

ST_DistanceSphere allows operations on mixed SRIDs

Reported by: Mike Taves Owned by: pramsey
Priority: low Milestone: PostGIS 2.2.0
Component: postgis Version: master
Keywords: Cc:

Description

With PostGIS 1.5, using ST_Distance_Sphere with mixed SRIDs raised an error:

SELECT ST_Distance_Sphere(ST_SetSRID(p1, 4326), p2) AS q1,
  ST_Distance_Sphere(p1, ST_SetSRID(p2, 4326)) AS q2,
  ST_Distance_Sphere(ST_SetSRID(p1, 4269), ST_SetSRID(p2, 4326)) AS q3
FROM (
    SELECT ST_MakePoint(0, 0) AS p1, ST_MakePoint(0, 1) AS p2
) f;
ERROR:  geometry_distance_spheroid: Operation on two GEOMETRIES with different SRIDs

But with recent versions of PostGIS, these queries are permitted without error or notice.

Change History (2)

comment:1 by pramsey, 9 years ago

See also #2642

comment:2 by pramsey, 9 years ago

Resolution: fixed
Status: newclosed

Fixed at r13826

Note: See TracTickets for help on using tickets.