Opened 5 weeks ago

Closed 3 weeks ago

#5811 closed defect (duplicate)

Failed Z-axis tolerance in ST_RemoveRepeatedPoints

Reported by: nbvfgh Owned by: pramsey
Priority: high Milestone: PostGIS Fund Me
Component: postgis Version: master
Keywords: Cc:

Description

I have been using a fuzzer to test PostGIS recently.

I used a function called ST_RemoveRepeatedPoint, which takes two parameters, a geometry and a floating-point tolerance. When I tried to use this function to delete two points that are equal on x and y but not equal on the z-axis, a possible logical error occurred:

ST_RemoveRepeatedPoint(geometry geom, float8 tolerance): Returns a version of the given geometry with duplicate consecutive points removed. The function processes only (Multi)LineStrings, (Multi)Polygons and MultiPoints but it can be called with any kind of geometry.If the tolerance parameter is provided, vertices within the tolerance distance of one another are considered to be duplicates.

Query statement:

SELECT ST_AsText(ST_RemoveRepeatedPoints('**MULTIPOINT(10 10 10, 10 10 13)**', 2)); 

The result is:

MULTIPOINT Z ((10 10 13))

It is obvious that the difference between the two points in MULTIPOINT (10 10 10, 10 10 13) on the z-axis is 3, and neither point should be deleted.

And the query statement:

SELECT ST_AsText(ST_RemoveRepeatedPoints('MULTIPOINT(10 10 10, 13 10 10)', 2));

These two points only differ on the x-axis and are 3,resulting in

MULTIPOINT Z ((13 10 10),(10 10 10))

No point was deleted, this is the correct result.

In the official documentation of Postgis, ST_RemoveRepeatedPoints is stated as a function that supports 3D, but it seems to be invalid for tolerance on the z-axis.

Change History (5)

comment:1 by nbvfgh, 5 weeks ago

Cc: nbvfgh removed

comment:2 by nbvfgh, 5 weeks ago

Milestone: PostGIS 3.5.1PostGIS Fund Me

comment:3 by nbvfgh, 5 weeks ago

Version: 3.5.xmaster

comment:4 by nbvfgh, 4 weeks ago

Is this a bug?

comment:5 by robe, 3 weeks ago

Resolution: duplicate
Status: newclosed

this appears to be a duplicate of #5816

Note: See TracTickets for help on using tickets.