[postgis-tickets] [PostGIS] #3356: geometry to geography cast, always adds a box even for 2 point linestrings

PostGIS trac at osgeo.org
Mon Nov 2 09:10:16 PST 2015


#3356: geometry to geography cast, always adds a box even for 2 point linestrings
---------------------+---------------------------
 Reporter:  robe     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 2.1.9
Component:  postgis  |    Version:  2.1.x
 Keywords:           |
---------------------+---------------------------
 I noticed this when fixing #3355 that geometry to geography cast always
 adds a bounding box.  I had actually copied the solution from that
 function to fix #3355.  For ST_Segmentize it's probably a rare case you'll
 segmentize and still end up with a 2 point linestring, but I can see this
 as being more of an issue when casting between geometry /geography.

 Observe:


 {{{
 SELECT ST_Summary(wkt::geometry) As wkt_geom,
    ST_Summary(wkt::geography) As wkt_geog,
    ST_Summary(wkt::geometry::geography) As geom_geog

 FROM (SELECT
      'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::text As wkt)
 As f;
 }}}

 outputs:


 {{{
           wkt_geom          |           wkt_geog           |
 geom_geog
 ----------------------------+------------------------------+-------------------------------
  LineString[] with 2 points | LineString[GS] with 2 points |
 LineString[BGS] with 2 points
 (1 row)

 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3356>
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