#3355 closed defect (fixed)
ST_Intersects() return no result with ST_Segmentize()
Reported by: | sdiz | Owned by: | robe |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 2.1.9 |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
The same linestring return 't' when intersects directly, but 'f' when mixed with ST_Segmentize()
db=> select ST_Intersects( 'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography , 'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography); st_intersects --------------- t (1 row)
db=> select ST_Intersects( 'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography , ST_Segmentize('LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography, 47487290)::geography); st_intersects --------------- f (1 row)
The segmented line should be same as input:
db=> select st_astext(ST_Segmentize('LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography, 47487290)::geography); st_astext ----------------------------------------------------- LINESTRING(124.983539 1.419224,91.181596 29.647798) (1 row)
Version:
PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 5.2.1-21) 5.2.1 20151003, 64-bit POSTGIS="2.1.8 r13780" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER Versions of packages postgis depends on: ii postgis 2.1.8+dfsg-4 ii libc6 2.19-22 ii libgdal1i 1.11.3+dfsg-2 ii libgeos-c1v5 3.5.0-1 ii libglib2.0-0 2.46.1-1 ii libgtk2.0-0 2.24.28-1 ii libjson-c2 0.11-4 ii liblwgeom-2.1.8 2.1.8+dfsg-4 ii libpq5 9.4.5-1 ii libproj9 4.9.2-1
Change History (14)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | PostGIS 2.2.1 → PostGIS 2.1.9 |
---|---|
Version: | 2.2.x → 2.1.x |
comment:3 by , 9 years ago
Priority: | high → blocker |
---|
Seems to be something amiss with the boxes. When it comes out of ST_Segmentize, it gets a regular old bounding box instead of a gbox.
I'm tested this on both 2.1.8 and 2.2.0
SELECT ST_Summary(geog_before) As before, ST_Summary(geog_after) As after, ST_Intersects(geog_before,geog_after) FROM (SELECT 'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography As geog_before , ST_Segmentize('LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography, 47487290) As geog_after) AS f;
outputs:
before | after | st_intersects ------------------------------+-----------------------------+--------------- LineString[GS] with 2 points | LineString[S] with 2 points | f
Trying to recast to geography doesn't help because it's already a geography (so guess it doesn't think updating the box is needed, however double casting works:
SELECT ST_Summary(geog_before) As before, ST_Summary(geog_after::geometry::geography) As after, ST_Intersects(geog_before,geog_after::geometry::geography) FROM (SELECT 'LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography As geog_before , ST_Segmentize('LINESTRING(124.983539 1.419224,91.181596 29.647798)'::geography, 47487290) As geog_after) AS f;
outputs:
before | after | st_intersects ------------------------------+-------------------------------+--------------- LineString[GS] with 2 points | LineString[BGS] with 2 points | t
comment:4 by , 9 years ago
Owner: | changed from | to
---|
comment:5 by , 9 years ago
I fixed for 2.3 at r14346, sorry didn't comment right. Will close once backported fix to 2.2 and 2.1
comment:6 by , 9 years ago
comment:7 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The WKB is also the same, but "=" say 'f':