TransWikia.com

sfcgal ST_Volume Issue

Geographic Information Systems Asked on February 17, 2021

ST_Volume works with shape data pasted into the query in this form:

SELECT (abs(ST_Volume(design)) -     
        abs(ST_Volume(ST_3DIntersection(design,scan))))

FROM   (SELECT (ST_MakeSolid('POLYHEDRALSURFACEZ( ...definition goes here...) ')) AS design,

(ST_MakeSolid('POLYHEDRALSURFACEZ(...definition goes here...)'))  AS scan )

AS t;

But if I enter the data into a table and try to read it into the query, in this way, ST_Volume outputs 0:

WITH sd AS (SELECT data_value AS design 
        FROM data
        WHERE data_label = '3D Design TINZ'),
     ss AS      (SELECT data_value AS scan  
        FROM data
        WHERE data_label = '3D Scan TINZ')

SELECT 
sd.design,
ST_IsSolid(sd.design) ,
ST_IsSolid(ST_MakeSolid(sd.design)) ,
ST_Volume(ST_MakeSolid(sd.design)),
ST_Volume(ST_MakeSolid(ST_GeomFromText(sd.design))),
ST_3DArea(sd.design),
ST_3DIntersection(sd.design,ss.scan)
FROM sd,ss; 

Output is:

enter image description here

So the ST_MakeSolid toggles ST_IsSolid from false to true, but the ST_Volume function returns 0, meaning that it does not recognise the input as a solid, or …?

But the ST_3DArea and ST_3DIntersections functions appear to work fine.

One Answer

Not really an answer but a workaround:

Changing the TINZ prefix in the input data file to POLYHEDRALSURFACE Z then works with:

ST_Volume(ST_MakeSolid(sd.design))

Maybe there are some polygons within the data files that are not actually triangles, making the TINZ definition invalid.

Answered by craigL on February 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP