Opened 13 years ago

Closed 13 years ago

#1243 closed defect (fixed)

ST_Distance_Sphere regress failure

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

I'm pretty sure I've tested my tiger geocoder in earlier versions of PostGIS 2.0, so I suspect this is a new regression failure.

My tiger_geocoder reverse geocoder regressions are failing now.

I isolated it to this issue. In my 1.5.3 build this works:

 SELECT ST_Distance_Sphere(ST_GeomFromText('LINESTRING(-93.225708 44.944981,-93.2257 44.94317)',4269),ST_SetSRID(ST_Point(-71.27593,42.33891),4269));

In 2.0 — it no longer does and gives a:

ERROR: Only SRID 4326 is currently supported in geography.

The unknown case still works however so not a super big deal:

 SELECT ST_Distance_Sphere(ST_GeomFromText('LINESTRING(-93.225708 44.944981,-93.2257 44.94317)',-1),ST_Point(-71.27593,42.33891));

Prior versions used to assume WGS84 (4326) for the geometries I think and not consider the SRIDs at all. I don't care too much about the tiger gecoder case since that is an easy fix for me to patch, but I fear it will break other people's code used to using census data and not realizing the srid is 4269 (which for all intents and purposes is the same as 4326 except its the answer to life and sex under one roof). That could make a lot of Americans mad. You don't want to know what happens when Americans get mad :).

Change History (3)

comment:1 by robe, 13 years ago

Paul,

Any plans to fix this regression failure or is this something I should note in the docs. I'd like to note it now before I forget if you do not plan to fix. I can see why you would choose not to and in that event I'm sure the pitch forks will be lining up on your next US speaking event :).

Thanks, Regina

comment:2 by pramsey, 13 years ago

I can patch around it to force the behavior to remain the same, it's sort of duct taping… thinking about it.

comment:3 by pramsey, 13 years ago

Resolution: fixed
Status: newclosed

OK, you inspired me to do the "right" fix, which is just to support alternate spheroids all the way to the bottom. See #1538 for the commit.

Note: See TracTickets for help on using tickets.