private static double compute3DPerimeter ( Geometry geometry ) { double sum = 0 ; for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geometry . getGeometryN ( i ) ; if ( subGeom instanceof Polygon ) { sum += ST_3DLength . length3D ( ( ( Polygon ) subGeom ) . getExteriorRing ( ) ) ; } } return sum ; }
Compute the 3D perimeter