public static MultiLineString createSegments ( Geometry geom ) throws SQLException { if ( geom != null ) { List < LineString > result ; if ( geom . getDimension ( ) > 0 ) { result = new LinkedList < LineString > ( ) ; createSegments ( geom , result ) ; return GEOMETRY_FACTORY . createMultiLineString ( result . toArray ( new LineString [ 0 ] ) ) ; } else { return GEOMETRY_FACTORY . createMultiLineString ( null ) ; } } return null ; }
Converts a geometry into a set of distinct segments stored in a MultiLineString .