[postgis-users] ST_Intersects(BOOM!)

Aaron Cope aaron at mapzen.com
Mon Aug 28 15:23:49 PDT 2017


Hi,

Apologies if this has been answered elsewhere already. If it has I've
not been able to find it.

We are using PGIS to do point-in-poly lookups and having trouble
involving certain very large records.

SELECT version();
                                                version
--------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit
(1 row)

Specifically:

https://whosonfirst.mapzen.com/spelunker/id/136253057/
https://whosonfirst.mapzen.com/data/136/253/057/136253057.geojson

Whose MBR is:

-179.143503384, -14.532891534, 179.780935092, 71.412502346

This is where it starts to get confusing for me. PGIS indicates that
both the geometry itself and the point we are trying to intersect with
are valid:

SELECT ST_IsValid(geom::geometry) FROM whosonfirst WHERE id=136253057;
 st_isvalid
------------
 t
(1 row)

SELECT ST_IsValid(ST_GeomFromGeoJSON('{"type": "Point", "coordinates":
[145.748209, 15.193315]}')::geometry);
 st_isvalid
------------
 t
(1 row)

However, when try to intersect against the former I trigger the "BOOM!
Could not generate outside point" error:

SELECT id, parent_id, placetype_id, meta FROM whosonfirst WHERE
ST_Intersects(geom, ST_GeomFromGeoJSON('{"type": "Point",
"coordinates": [145.748209, 15.193315]}'));
ERROR:  BOOM! Could not generate outside point!

https://github.com/postgis/postgis/blob/cc3437595e88eac7f20b0f3b780a3816cdc912c9/liblwgeom/lwgeodetic.c#L1536-L1537

We've also been able to reproduce the problem with this record which
has a similarly large MBR:

https://whosonfirst.mapzen.com/spelunker/id/136253037/
https://whosonfirst.mapzen.com/data/136/253/037/136253037.geojson

Am I missing something obvious or is there something else at work here?


Thanks,


More information about the postgis-users mailing list