Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1780 closed defect (fixed)

ST_GeoHash should support geography type without cast

Reported by: toofishes Owned by: pramsey
Priority: medium Milestone: PostGIS 2.1.0
Component: postgis Version: 2.0.x
Keywords: Cc:

Description

Given that it operates on latitude/longitude coords, and most of the other export/output functions take both geometry and geography, I was surprised to see this one didn't.

database=> select ST_GeoHash('POINT(0 0)');
      st_geohash      
----------------------
 7zzzzzzzzzzzzzzzzzzz
(1 row)

database=> select ST_GeoHash('POINT(0 0)'::geography);
ERROR:  function st_geohash(geography) does not exist
LINE 1: select ST_GeoHash('POINT(0 0)'::geography);
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Change History (4)

comment:1 by pramsey, 12 years ago

Resolution: fixed
Status: newclosed

Fair 'nuff! r10278

comment:2 by strk, 12 years ago

testcase missing!

comment:3 by pramsey, 12 years ago

ok fine, r10280

comment:4 by robe, 12 years ago

and of course I think the below will no longer work

SELECT ST_GeoHash('POINT(0 0)');

Though I haven't confirmed. That'll teach'em — they'll have to do

SELECT ST_GeoHash('POINT(0 0)'::geometry);

If my suspicion is correct, should we catalog this as a breaking change, or add the 'Unknown' hack.

We have same issue with ST_Segmentize BTW.

Anyrate we should probably add the unknown hack to the legacy file if we don't make it part of the core file.

Note: See TracTickets for help on using tickets.