[postgis-tickets] [PostGIS] #2965: ST_Distance, use_spheroid default

PostGIS trac at osgeo.org
Sat Oct 25 03:13:23 PDT 2014


#2965: ST_Distance, use_spheroid default
-----------------------+----------------------------------------------------
  Reporter:  gitai     |       Owner:  pramsey                  
      Type:  defect    |      Status:  closed                   
  Priority:  critical  |   Milestone:  PostGIS 2.1.5            
 Component:  postgis   |     Version:  2.1.x                    
Resolution:  wontfix   |    Keywords:  ST_Distance, use_spheroid
-----------------------+----------------------------------------------------

Comment(by gitai):

 Replying to [comment:19 robe]:
 > autocast is never done per function, its done with a cast object and
 automatically applies to all function.  The thing that controls it is
 this:
 >
 >
 > {{{
 > CREATE CAST (geometry AS geography)
 >   WITH FUNCTION postgis.geography(geometry)
 >   AS IMPLICIT;
 >
 >
 Ah.. Implicit type conversion.. That’s indeed a different story.

 >
 >
 >
 > }}}
 >
 > Note the term -- IMPLICIT  (that means that if there is a function for
 geography and no equivalent for geometry, then geometry can auto cast
 itself to geography to use it)
 >
 >

 I assume this was implemented in order to maintain a single set of
 constructor functions; however, removing the autocast will probably result
 in more explicit casts.

 I personally don’t think this is less annoying than having two sets of
 constructor functions one for geography and one for geometry.. You
 actually need to type less by convention plus it’s one less “additional
 concern” (e.g cast):

 Geography construction (Geometry function call + cast)

 ST_SetSRID(ST_MakePoint(-74.1960983, 40.739418), 4326)::geography

 Vs

 Geography construction (Geography function call)

 ST_SetSRID(ST_MakeGeogPoint(-74.1960983, 40.739418), 4326)


 BTW, just out of curiosity do constructer functions return geometries
 because geometry usage is more frequent than geography?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2965#comment:20>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list