[postgis-users] Problem with Contains in Postgis 1.2.1

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Apr 15 23:30:20 PDT 2007


On Mon, 2007-04-16 at 11:40 +1000, Sean Ashton wrote:
> Hi All,
>    I appear to have some problems when using Contains in Postgis 1.2.1, 
> whereas the same
>    query on Postgis 1.1.7 appears to work.
> 
>    I'm simply trying to work out if a point is within another region.
>    My setup is as follows:
>  	Setup 1. "POSTGIS="1.1.7" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 
> 4.4.9, 29 Oct 2004"
>  	Setup 2. "POSTGIS="1.2.1" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 
> 4.4.9, 29 Oct 2004"
> 
>    When I run the following query
>    select Contains(Buffer(GeomFromText('POINT(152.995672 
> -27.483394)'),1),GeomFromText('POINT(152.995672 -27.483394)'))
> 
>    Setup 1 returns TRUE while Setup 2 returns FALSE.
> 
>    Is there a change in the way Contains works between 1.1.7 and 1.2.1?
> 
>    Could this be related to the
>    	"Fix for bug in Within() caused by point-in-polygon performance 
> shortcut." included in the 1.2.1 release?
> 
>    Any help would be appreciated.
> 
>    Sean


Hi Sean,

I believe there is an additional fix for this in SVN for the 1.2.x
branch. Can you try replacing the file lwgeom_functions_analytic.c from
PostGIS 1.2.1 with the one here:
http://svn.refractions.net/postgis/trunk/lwgeom/lwgeom_functions_analytic.c, rebuilding PostGIS and then trying again to see if that solves the problem?


Kind regards,

Mark.





More information about the postgis-users mailing list