Opened 9 years ago

Closed 9 years ago

#262 closed defect (fixed)

Possible bug in Geography ST_Covers

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version:
Keywords: Cc:


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_Transform(CAST(poly.the_geog As geometry),32611), 
		ST_Transform(CAST(pt.the_geog As geometry),32611)) As utm,
		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
		( 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.

Change History (4)

comment:1 Changed 9 years ago by pramsey

I get the right (?) answer

          wkt_pt          | geog | utm | pca 
 POINT(-119.5434 34.9438) | t    | t   | t
 POINT(-119.5452 34.9442) | t    | t   | t
 POINT(-119.5434 34.9438) | t    | t   | t
 POINT(-119.5438 34.9443) | t    | t   | t
(4 rows)

as of r4640. Could be the precision issues that manifest in your cunit failures. Those remain on my list (though a ticket wouldn't hurt).

comment:2 Changed 9 years ago by robe

That is the answer I would expect. Mine is still wrong even after r4640. I thought it was maybe a bbox issue again but && returns true on all accounts.

ST_Distance also returns 0 on all accounts. Anyrate I'll put in another ticket for Cunit issue once I've cataloged the various ways its failing on different boxes.

comment:3 Changed 9 years ago by pramsey

I'm still getting the right answer. Has anything changed on your end?

comment:4 Changed 9 years ago by robe

Resolution: fixed
Status: newclosed

Yap works now.

Note: See TracTickets for help on using tickets.