[postgis-users] Problem with ST_intersects

James Sewell James.Sewell at lisasoft.com
Sun Jun 26 20:46:58 PDT 2011


Fixed as of 1.5.3 stable.

Cheers,
James Sewell
Developer
LISAsoft

Ph: +61 3 8680 3250 Fax: +61 3 8680 3299
Level 9, 601 Bourke St, Melbourne Vic 3000


LISAsoft is part of the A2end Group of Companies
http://www.ardec.com.au
http://www.lisasoft.com
http://www.terrapages.com

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of James Sewell
Sent: Wednesday, 22 June 2011 10:59 AM
To: PostGIS Users Discussion; postgis-devel at postgis.refractions.net
Subject: Re: [postgis-users] Problem with ST_intersects

Upgraded on CentOS to

  POSTGIS="1.5.3SVN" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.6.26" USE_STATS

And the problem still occurs:

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where a.id =1954;
    id  | st_intersects
  ------+---------------
   1954 | t
  (1 row)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where a.id = 2034 or a.id =1954;
    id  | st_intersects
  ------+---------------
   2034 | t
   1954 | f
  (2 rows)

The problem does not occur with ST_Relate:

plm25new=>  select  a.id, ST_relate(a.the_geom, b.the_geom) from apoly as a, aright as b where a.id = 2034 or a.id =1954;
    id  | st_relate
  ------+-----------
   2034 | 0FFFFF212
   1954 | 0FFFFF212
  (2 rows)


Also it does not seem to occur if I make the point into a tiny polygon:

plm25new=>  select  a.id, ST_intersects(st_buffer(a.the_geom,10e-8), b.the_geom) from apoly as a, aright as b
  where a.id = 2034 or a.id =1954;
  id  | st_intersects
------+---------------
 2034 | t
 1954 | t
(2 rows)


In fact I have just noticed I can cause all sorts of problems by using different where clauses - could it be some sort of caching problem?

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where id=2034  order by a.id;
   id  | st_intersects
  ------+---------------
   2034 | t
  (1 row)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where id=2033  order by a.id;
    id  | st_intersects
  ------+---------------
   2033 | t
  (1 row)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where id=1954  order by a.id;
    id  | st_intersects
  ------+---------------
   1954 | t
  (1 row)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where id=2033 or id=1954 order by a.id;
    id  | st_intersects
  ------+---------------
  1954 | t
  2033 | f
  (2 rows)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where id=2034 or id=1954 order by a.id;
    id  | st_intersects
  ------+---------------
   1954 | f
   2034 | t
  (2 rows)

  plm25new=>  select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b order by a.id;
    id  | st_intersects
  ------+---------------
   1954 | f
   2033 | f
   2034 | t
  (3 rows)


----
James Sewell
Solutions Architect
Ardec International
Office: (03) 86803200
Mobile: 0414 688 892

________________________________________
From: postgis-users-bounces at postgis.refractions.net [postgis-users-bounces at postgis.refractions.net] On Behalf Of James Sewell [James.Sewell at lisasoft.com]
Sent: Wednesday, 22 June 2011 10:10 AM
To: PostGIS Users Discussion; postgis-dev at postgis.refractions.net
Subject: Re: [postgis-users] Problem with ST_intersects

Aha,

http://trac.osgeo.org/postgis/ticket/845

I will upgrade to 1.5.3 and retest!

----
James Sewell
Solutions Architect
Ardec International
Office: (03) 86803200
Mobile: 0414 688 892

________________________________________
From: postgis-users-bounces at postgis.refractions.net [postgis-users-bounces at postgis.refractions.net] On Behalf Of James Sewell [James.Sewell at lisasoft.com]
Sent: Tuesday, 21 June 2011 1:58 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Problem with ST_intersects

Sorry, I forgot to say I have encountered the problem with the following versions / OSes

 CentOS: POSTGIS="1.5.2" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009 " LIBXML="2.6.26" USE_STATS

 Solaris: POSTGIS="1.5.2" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.6.31" USE_STATS

----
James Sewell
Developer
LISAsoft

________________________________________
From: postgis-users-bounces at postgis.refractions.net [postgis-users-bounces at postgis.refractions.net] On Behalf Of James Sewell [James.Sewell at lisasoft.com]
Sent: Tuesday, 21 June 2011 1:50 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Problem with ST_intersects

Hello All,

I think I have found a bug. For the data attached the following commands yield interesting results, with the output of ST_intersects seemingly changed by the where clause.

  plm25=> select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b where a.id = 1954 or a.id =2034 order by id;
    id  | st_intersects
  ------+---------------
   1954 | f
   2034 | t
  (2 rows)

  plm25=> select  a.id, ST_intersects(a.the_geom, b.the_geom) from apoly as a, aright as b  where a.id = 1954 or a.id =2033 order by id;
    id  | st_intersects
  ------+---------------
   1954 | t
   2033 | t
  (2 rows)

Anyone have any ideas why this might be so?

----
James Sewell
Solutions Architect
Ardec International
Office: (03) 86803200
Mobile: 0414 688 892


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.



More information about the postgis-users mailing list