[postgis-users] Problem with overlap operator(&&) ?

Rob Tester robtester at gmail.com
Tue Nov 14 14:24:40 PST 2006


I recently (with my install of 1.1.5) have run into something that is 
puzzling me about the overlaps operator. I have two tables that I am 
comparing the geometry objects using the following SQL:

select overlaps(a.wkb_geometry,b.wkb_geometry),a.primaryKey,b.primaryKey 
from az_cr9 a,az_kz b where a.primaryKey=2203 and b.primaryKey=293546 and 
a.wkb_geometry&&b.wkb_geometry

This returns one row:

f;2203;293546

My question is how does the overlaps operator return TRUE and the overlaps 
function return FALSE. In fact the two geometries in question do not close 
to each other. Is this operator broken?

This query returns no rows as expected:

select 
overlaps(a.wkb_geometry,b.wkb_geometry),a.cr_id,b.ogc_fid,b.blockgroupid,b.blockid 
from az_carrierroute9 a,az_kz_calculated_test b where a.ogc_fid=2203 and 
b.ogc_fid=293546 and overlaps(a.wkb_geometry,b.wkb_geometry)


Any help on this?

Rob

----- Original Message ----- 
From: <strk at refractions.net>
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Sent: Tuesday, November 14, 2006 4:22 AM
Subject: Re: [postgis-users] Php interface for loading shp file into postgis


> On Tue, Nov 14, 2006 at 10:14:41AM +0100, Luca Casagrande wrote:
>> Hi to all!
>>
>> I am trying to found a good way to approach this issue:
>>
>> i need to build a php interface that will do those tasks:
>> 1) Load a shp file selected by the user;
>> 2) Check if the file has got a prj file associated with it and if not
>> let the user insert the PROJ code for the current file;
>> 3) Use proj to convert the file to the needed projection;
>> 4) Store the file inside POSTGIS
>>
>> The main thing i am thinking about, is when do the projection swap:
>> is it better to do BEFORE importing the data in POSTGIS or do just after 
>> the data has
>> been inserted inside Postgis?
>
> There's currently no trigger checking for SRID existance added
> to the geometry column, so you can add the spatial_ref_sys
> entry at an arbitrary time.
> Anyway, the .prj => spatial_ref_sys record conversion seems
> a useful enough function to have embedded in shp2pgsql (and
> the reverse in pgsql2shp) so if you intend to implement such
> a feature I think it would be nice to have it implemented
> in C :)
>
> --strk;
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users 




More information about the postgis-users mailing list