Opened 10 years ago

Closed 10 years ago

#2855 closed defect (fixed)

ST_MinkowskiSum gives polyhedral surface invalid error

Reported by: robe Owned by: colivier
Priority: medium Milestone: PostGIS 2.1.4
Component: sfcgal Version: 2.1.x
Keywords: Cc:

Description

I think this is a bug, but just trying out ST_MinkowskiSum to try to understand outputs so I may not be using it right

SELECT ST_MinkowskiSum('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)), 
	((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)), 
	((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)), 
	((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)), ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1)) )'::geometry,
	'POLYGON Z ((0.5 0 0.5,0.5 0 1.5,0.5 1 1.5,0.5 1 0.5,0.5 0 0.5))'::geometry
);

Gives error:

NOTICE:  During minkowski_sum(A,B):
NOTICE:    with A: POLYHEDRALSURFACE(((0/1 0/1 0/1,0/1 0/1 1/1,0/1 1/1 1/1,0/1 1/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,0/1 1/1 0/1,1/1 1/1 0/1,1/1 0/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,1/1 0/1 0/1,1/1 0/1 1/1,0/1 0/1 1/1,0/1 0/1 0/1)),((1/1 1/1 0/1,1/1 1/1 1/1,1/1 0/1 1/1,1/1 0/1 0/1,1/1 1/1 0/1)),((0/1 1/1 0/1,0/1 1/1 1/1,1/1 1/1 1/1,1/1 1/1 0/1,0/1 1/1 0/1)),((0/1 0/1 1/1,1/1 0/1 1/1,1/1 1/1 1/1,0/1 1/1 1/1,0/1 0/1 1/1)))
NOTICE:     and B: POLYGON((1/2 0/1 1/2,1/2 0/1 3/2,1/2 1/1 3/2,1/2 1/1 1/2,1/2 0/1 1/2))


ERROR:  PolyhedralSurface is invalid : inconsistant orientation of PolyhedralSurface detected at edge 2 (3-3) of polygon 4 : POLYHEDRALSURFACE(((0/1 0/1,0/1 0/1,0/1 1/1,0/1 1/1,0/1 0/1)),((0/1 0/1,0/1 1/1,1/1 1/1,1/1 0/1,0/1 0/1)),((0/1 0/1,1/1 0/1,1/1 0/1,0/1 0/
********** Error **********

ERROR: PolyhedralSurface is invalid : inconsistant orientation of PolyhedralSurface detected at edge 2 (3-3) of polygon 4 : POLYHEDRALSURFACE(((0/1 0/1,0/1 0/1,0/1 1/1,0/1 1/1,0/1 0/1)),((0/1 0/1,0/1 1/1,1/1 1/1,1/1 0/1,0/1 0/1)),((0/1 0/1,1/1 0/1,1/1 0/1,0/1 0/
SQL state: XX000


I'm using sfcgal 1.0.4

Attachments (1)

2855.patch (1014 bytes ) - added by hmercier 10 years ago.
Fixes st_minkowski doc

Download all attachments as: .zip

Change History (4)

comment:1 by vmo, 10 years ago

The source of the problem is that volumes are not really supported, 3D geom are flattened internally to perform the Minkowski sum, and a flattened volume is an invalid PolyhedralSurface.

We have to fix SFCGAL to have a meaningful error message and improve the function documentation.

by hmercier, 10 years ago

Attachment: 2855.patch added

Fixes st_minkowski doc

comment:2 by hmercier, 10 years ago

SFCGAL 1.0.5 (just released) adds some context message to the error, so you know it happens when a 3D geometry is converted to 2D. I've also added a patch to this ticket that will (hopefully) clarify the documentation.

comment:3 by robe, 10 years ago

Milestone: PostGIS 2.2.0PostGIS 2.1.4
Resolution: fixed
Status: newclosed

documentation patch committed to 2.1.4 at r12916 and trunk (2.2.0) at r12915

Note: See TracTickets for help on using tickets.