Friday, 30 September 2016

polygon - ST_MakeSolid() creating an invalid solid from closed polyhedralsurfaceZ


I am trying to turn a polyhedralsurface object into solid using ST_MakeSolid() SFCGAL function in PostGIS.


SELECT 

ST_Volume(ST_MakeSolid(ST_GeomFromEWKT('SRID=4326;PolyhedralSurface(
((-1.36301 -5.98377 -57.9449 , -1.36302 -5.98389 -58.0362 , -1.36308 -5.98388 -57.9985 , -1.36307 -5.98377 -57.9072, -1.36301 -5.98377 -57.9449 )),
((-1.36298 -5.98374 -65.0797 , -1.363 -5.98392 -65.2304 , -1.36311 -5.98391 -65.1682 , -1.36309 -5.98373 -65.0175, -1.36298 -5.98374 -65.0797 )),
((-1.36301 -5.98377 -57.9449 , -1.36298 -5.98374 -65.0797 , -1.36309 -5.98373 -65.0175, -1.36307 -5.98377 -57.9072, -1.36301 -5.98377 -57.9449 )),
((-1.36301 -5.98377 -57.9449 , -1.36298 -5.98374 -65.0797 , -1.363 -5.98392 -65.2304 , -1.36302 -5.98389 -58.0362 , -1.36301 -5.98377 -57.9449 )),
((-1.36302 -5.98389 -58.0362 , -1.363 -5.98392 -65.2304 , -1.36311 -5.98391 -65.1682 , -1.36308 -5.98388 -57.9985 , -1.36302 -5.98389 -58.0362 )),
((-1.36308 -5.98388 -57.9985 , -1.36311 -5.98391 -65.1682 , -1.36309 -5.98373 -65.0175, -1.36307 -5.98377 -57.9072, -1.36308 -5.98388 -57.9985 ))
)')));

However, when i try to find its volume, an error occurs that the solid is invalid.



ERROR:  Solid is invalid : PolyhedralSurface (shell) 0 is invalid: Polygon 2 is invalid: points don't lie in the same plane : SOLID((((-1534612832025565/1125899906842624 -842140760695961/140737488355328 -8155019689000645/140737488355328,-6138496364098533/45035996

Note that the input geometry must be a closed Polyhedral Surface to obtain a valid solid with ST_MakeSolid(). I checked the polyhedralsurface using ST_IsClosed() and it turns out to be a closed surface. I also checked each of the polygon surfaces making up the polyhedralsurface for validity using ST_Dump() and ST_IsValid() and all turned out to be valid.


Can you please take a look at my solid and help me figure out why is it invalid and how i can resolve this error?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...