[postgis-devel] [PostGIS] #1235: cast to unknown-srid typmod fails

PostGIS trac at osgeo.org
Thu Dec 22 16:38:51 PST 2011


#1235: cast to unknown-srid typmod fails
---------------------+------------------------------------------------------
 Reporter:  strk     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 strk -- is this a geography table you are casting to geometry?

 I'm not sure I consider this a bug (except it is the unknown srid), but
 remember unknonwn is the same as not specifying an srid at all so I would
 expect it to maintain the same srid.
  I would think the proper way to do this is:

 ST_SetSRID(geom:geometry,0)::geometry('multipolygon',0);


 The reason I think that is that there are two ways you can cast -- you can
 cast by doing a transform or set the srid explicitly.  I don't think we
 should be making assumptions about how people want the translation to
 happen.

 For example if you had a linestring and tried to do this

 geom::geometry(LINESTRING)

 That would be illegal.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/1235#comment:2>
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-devel mailing list