Opened 20 months ago

Closed 18 months ago

Last modified 17 months ago

#5226 closed defect (worksforme)

ST_DumpPoints ignores Points

Reported by: DanielGKiel Owned by: pramsey
Priority: medium Milestone: PostGIS 3.3.2
Component: postgis Version: 3.1.x
Keywords: ST_DumpPoints Cc: DanielGKiel

Description

In case of a CURVEPOLYGON consisting of two COMPOUNDCURVEs, ST_DumpPoints does not return the coordinates of the 2nd COMPOUNDCURVE:

SELECT path, ST_AsText(geom)
FROM (
		SELECT (ST_DumpPoints(g.geom)).*
		--SELECT (ST_Dump(g.geom)).*
		FROM (SELECT 'CURVEPOLYGON ZM (COMPOUNDCURVE ZM ((32496392.476 6019012.409 9999.9999 0,32496393.966 6019012.749 9999.9999 0),
			  (32496393.966 6019012.749 9999.9999 0,32496395.495 6019006.162 9999.9999 0),(32496395.495 6019006.162 9999.9999 0,32496420.606 6019012.018 9999.9999 0),
			  (32496420.606 6019012.018 9999.9999 0,32496419.006 6019018.925 9999.9999 0),(32496419.006 6019018.925 9999.9999 0,32496390.707 6019020.046 9999.9999 0),
			  (32496390.707 6019020.046 9999.9999 0,32496392.476 6019012.409 9999.9999 0)),COMPOUNDCURVE ZM ((32496443.977 6019022.162 9999.9999 0,32496440.168 6019039.006 9999.9999 0),
			  (32496440.168 6019039.006 9999.9999 0,32496447.865 6019040.805 9999.9999 0),(32496447.865 6019040.805 9999.9999 0,32496449.535 6019033.668 9999.9999 0),
			  (32496449.535 6019033.668 9999.9999 0,32496454.493 6019034.827 9999.9999 0),(32496454.493 6019034.827 9999.9999 0,32496443.977 6019022.162 9999.9999 0)))'::geometry AS geom
			 ) AS g
) j;

Workaround: Use ST_Dump first to Dump the Points into LINESTRINGs. ST_DumpPoints works correctly on these.

SELECT path, ST_AsText(geom)
FROM (
		SELECT (ST_DumpPoints(j.geom)).*
		FROM (
				SELECT (ST_Dump(g.geom)).*
				FROM (SELECT 'CURVEPOLYGON ZM (COMPOUNDCURVE ZM ((32496392.476 6019012.409 9999.9999 0,32496393.966 6019012.749 9999.9999 0),
			  (32496393.966 6019012.749 9999.9999 0,32496395.495 6019006.162 9999.9999 0),(32496395.495 6019006.162 9999.9999 0,32496420.606 6019012.018 9999.9999 0),
			  (32496420.606 6019012.018 9999.9999 0,32496419.006 6019018.925 9999.9999 0),(32496419.006 6019018.925 9999.9999 0,32496390.707 6019020.046 9999.9999 0),
			  (32496390.707 6019020.046 9999.9999 0,32496392.476 6019012.409 9999.9999 0)),COMPOUNDCURVE ZM ((32496443.977 6019022.162 9999.9999 0,32496440.168 6019039.006 9999.9999 0),
			  (32496440.168 6019039.006 9999.9999 0,32496447.865 6019040.805 9999.9999 0),(32496447.865 6019040.805 9999.9999 0,32496449.535 6019033.668 9999.9999 0),
			  (32496449.535 6019033.668 9999.9999 0,32496454.493 6019034.827 9999.9999 0),(32496454.493 6019034.827 9999.9999 0,32496443.977 6019022.162 9999.9999 0)))'::geometry AS geom
			 ) AS g
		) j
	) l;

Change History (4)

comment:1 by robe, 20 months ago

Milestone: PostGIS 3.2.4PostGIS 3.3.2

comment:2 by robe, 18 months ago

Can you let me know what

SELECT postgis_full_version():

returns for you.

In both your examples I get 22 points back which matches the count of

SELECT ST_NPoints('CURVEPOLYGON ZM (COMPOUNDCURVE ZM ((32496392.476 6019012.409 9999.9999 0,32496393.966 6019012.749 9999.9999 0),
			  (32496393.966 6019012.749 9999.9999 0,32496395.495 6019006.162 9999.9999 0),(32496395.495 6019006.162 9999.9999 0,32496420.606 6019012.018 9999.9999 0),
			  (32496420.606 6019012.018 9999.9999 0,32496419.006 6019018.925 9999.9999 0),(32496419.006 6019018.925 9999.9999 0,32496390.707 6019020.046 9999.9999 0),
			  (32496390.707 6019020.046 9999.9999 0,32496392.476 6019012.409 9999.9999 0)),COMPOUNDCURVE ZM ((32496443.977 6019022.162 9999.9999 0,32496440.168 6019039.006 9999.9999 0),
			  (32496440.168 6019039.006 9999.9999 0,32496447.865 6019040.805 9999.9999 0),(32496447.865 6019040.805 9999.9999 0,32496449.535 6019033.668 9999.9999 0),
			  (32496449.535 6019033.668 9999.9999 0,32496454.493 6019034.827 9999.9999 0),(32496454.493 6019034.827 9999.9999 0,32496443.977 6019022.162 9999.9999 0)))'::geometry);

I tested on PostGIS 3.3.1 and PostGIS 3.4.0dev

comment:3 by robe, 18 months ago

Resolution: worksforme
Status: newclosed

I'm closing this out since I can't replicate the issue. It might have been fixed in a prior micro.

comment:4 by DanielGKiel, 17 months ago

SELECT postgis_full_version():

POSTGIS="3.1.4 ded6c34" [EXTENSION] PGSQL="130" GEOS="3.9.2-CAPI-1.14.3" PROJ="8.1.1" LIBXML="2.9.4" LIBJSON="0.12.1" TOPOLOGY
Note: See TracTickets for help on using tickets.