public String getGeometryType ( Geometry geometry , GeometryIndex index ) throws GeometryIndexNotFoundException { if ( index != null && index . getType ( ) == GeometryIndexType . TYPE_GEOMETRY ) { if ( geometry . getGeometries ( ) != null && geometry . getGeometries ( ) . length > index . getValue ( ) ) { return getGeometryType ( geometry . getGeometries ( ) [ index . getValue ( ) ] , index . getChild ( ) ) ; } else { throw new GeometryIndexNotFoundException ( "Can't find the geometry referred to in the given index." ) ; } } return geometry . getGeometryType ( ) ; }
What is the geometry type of the sub - geometry pointed to by the given index? If the index points to a vertex or edge the geometry type at the parent level is returned .