Opened 7 years ago

Last modified 7 years ago

#3835 new defect

ST_StraightSkeleton returns degenerate line segments

Reported by: wrog Owned by: robe
Priority: medium Milestone: PostGIS SFCGAL
Component: postgis Version: 2.3.x
Keywords: Cc:

Description

This query

WITH bt(box) AS (
  SELECT st_makebox2d(st_point(1296000,202400),st_point(1297000,212400))
)
SELECT d.path[1], astext(d.geom) 
FROM bt, st_dump( 
  st_straightskeleton(st_difference(st_buffer(box,2000,2),box))
) as d
WHERE st_startpoint(d.geom) = st_endpoint(d.geom);

returns four zero-length line segments (out of 32; the other 28 all appear to make up a plausible straight skeleton for this shape).

Versions of everything: POSTGIS="2.3.3 r15473" GEOS="3.5.1-CAPI-1.9.1 r4246" SFCGAL="1.3.0" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.1.2, released 2016/10/24" LIBXML="2.9.4" LIBJSON="0.12.1" (core procs from "2.3.2 r15302" need upgrade) TOPOLOGY RASTER (raster procs from "2.3.2 r15302" need upgrade)

PostgreSQL 9.6.4 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18) 6.3.0 20170516, 64-bit

[I'm guessing this doesn't depend on LIBJSON or RASTER]

Change History (2)

comment:1 by robe, 7 years ago

Owner: changed from pramsey to robe

No this one would probably depend on SFCGAL. Let me see if I can replicate with newest head of SFCGAL and then I'll report upstream if it is still an issue.

https://github.com/Oslandia/SFCGAL/issues

comment:2 by robe, 7 years ago

Milestone: PostGIS 2.3.4PostGIS SFCGAL

Okay still seems to be an issue with head.

Testing with:

POSTGIS="2.4.0dev r15671" PGSQL="100" GEOS="3.7.0dev-CAPI-1.11.0 8fe2ce6" SFCGAL="1.3.1" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.2.1, released 2017/06/23" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER
WITH bt(box) AS (
  SELECT st_makebox2d(st_point(1296000,202400),st_point(1297000,212400))
)
SELECT d.path[1], St_astext(d.geom) , ST_Length(d.geom)
FROM bt, st_dump( 
  st_straightskeleton(st_difference(st_buffer(box,2000,2),box))
) as d
WHERE st_startpoint(d.geom) = st_endpoint(d.geom);

I get output:

 path |                                   st_astext                                   | st_length
------+-------------------------------------------------------------------------------+-----------
   17 | LINESTRING(1295198.91236738 201598.91236738,1295198.91236738 201598.91236738) |         0
   20 | LINESTRING(1295198.91236738 213201.08763262,1295198.91236738 213201.08763262) |         0
   22 | LINESTRING(1297801.08763262 201598.91236738,1297801.08763262 201598.91236738) |         0
   23 | LINESTRING(1297801.08763262 213201.08763262,1297801.08763262 213201.08763262) |         0
(4 rows)

I've ticketed the issue upstream at https://github.com/Oslandia/SFCGAL/issues/143

and will flag this as a SFCGAL since I don't think it needs fixing in PostGIS

Note: See TracTickets for help on using tickets.