Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#3729 closed defect (invalid)

ST_Intersects works incorrect for simple MULTIPOLYGON

Reported by: biog Owned by: pramsey
Priority: medium Milestone: PostGIS 2.3.3
Component: postgis Version: 2.3.x
Keywords: Cc:


I got strange result for ST_Intersects function

SELECT ST_Intersects( ST_GeographyFromText('SRID=4326;MULTIPOLYGON(((-131.66015625 50.7121128961851,-131.30859375 23.2060096376488,-59.58984375 22.8825014343701,-60.64453125 51.1552316115623,-131.66015625 50.7121128961851)))'), ST_GeographyFromText('SRID=4326;POINT(-80.265919 26.068188)'));
(1 row)

I'm 100% sure that point intersects multipolygon.

It works as expected for geometry type:

SELECT ST_Intersects( ST_GeomFromText('MULTIPOLYGON(((-131.66015625 50.7121128961851,-131.30859375 23.2060096376488,-59.58984375 22.8825014343701,-60.64453125 51.1552316115623,-131.66015625 50.7121128961851)))', 4326), ST_GeomFromText('POINT(-80.265919 26.068188)', 4326));
(1 row)

I use latest PostgreSQL 9.6.2 on Debian Jessie.

SELECT PostGIS_full_version();
 POSTGIS="2.3.2 r15302" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="0.11.99" RASTER
(1 row)

Change History (3)

comment:1 Changed 2 years ago by pramsey

Resolution: invalid
Status: newclosed

You think your polygon looks like this

But it doesn't, it looks like this, in geography space

comment:2 Changed 2 years ago by pramsey

Here's one w/ your point on it too.

comment:3 Changed 2 years ago by biog

Thanks pramsey, you are right! Now I understand why this point doesn't intersect polygon. It seems I have to change my data type from geography to geometry.

Note: See TracTickets for help on using tickets.