[postgis-devel] [PostGIS] #262: Possible bug in Geography ST_Covers

PostGIS trac at osgeo.org
Sat Oct 10 09:43:12 PDT 2009


#262: Possible bug in Geography ST_Covers
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  postgis 1.5.0
Component:  postgis  |     Version:               
 Keywords:           |  
---------------------+------------------------------------------------------
 I would expect the answer to my UTM to agree with Geography answer.  Also
 the platte-care answer is woo really screwed.  That I think is a bug in
 the casting or somethng I don't understand about the casting which I'll
 put in as a separate ticket.
 {{{
 SELECT ST_AsText(pt.the_geog) As wkt_pt, ST_Covers(poly.the_geog,
 pt.the_geog) As geog,
         ST_Covers(
                 ST_Transform(CAST(poly.the_geog As geometry),32611),
                 ST_Transform(CAST(pt.the_geog As geometry),32611)) As utm,
         ST_Covers(
                 CAST(poly.the_geog As geometry),
                 CAST(pt.the_geog As geometry)
         ) As pca
 FROM (SELECT ST_GeographyFromText('SRID=4326;POLYGON((-119.5434
 34.9438,-119.5437 34.9445,-119.5452 34.9442,-119.5434 34.9438))') As
 the_geog)
         As poly
     CROSS JOIN
         (VALUES
                 ( ST_GeographyFromText('SRID=4326;POINT(-119.5434
 34.9438)') ) ,
                 ( ST_GeographyFromText('SRID=4326;POINT(-119.5452
 34.9442)') ) ,
                 ( ST_GeographyFromText('SRID=4326;POINT(-119.5434
 34.9438)') ),
                 ( ST_GeographyFromText('SRID=4326;POINT(-119.5438
 34.9443)')  )
         )
         As pt(the_geog);

 }}}

 I'm expecting all these to yield an answer of true.  Instead I get


 {{{
           wkt_pt          | geog | utm | pca
 --------------------------+------+-----+-----
  POINT(-119.5434 34.9438) | t    | t   | f
  POINT(-119.5452 34.9442) | f    | t   | f
  POINT(-119.5434 34.9438) | t    | t   | f
  POINT(-119.5438 34.9443) | t    | t   | f
 }}}

 The pca answer is particularly troubling which I think is a separate
 issue.

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


More information about the postgis-devel mailing list