[postgis-devel] [PostGIS] #259: ST_Distance geography throws an error with empty geographies

PostGIS trac at osgeo.org
Mon Oct 5 15:24:53 PDT 2009


#259: ST_Distance geography throws an error with empty geographies
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  postgis 1.5.0
Component:  postgis  |     Version:               
 Keywords:           |  
---------------------+------------------------------------------------------
 I suppose this is technically not a defect, but is not consistent with the
 way ST_Distance behaves with geometry.  ST_Distance returns 0 in this case
 .
 Also its not desirable for queries to fail with empty
 geometries/geoegraphies

 But this:
 SELECT ST_Distance(ST_GeographyFromText('SRID=4326;POLYGON EMPTY'),
 ST_GeographyFromText('SRID=4326;POINT(1 2)'));

 returns:
 ERROR:  Error in geography_distance_sphere calculation.
 CONTEXT:  SQL function "st_distance" statement 1

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/259>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list