public GeometryType getGeometryType ( String name ) { Variable geometryVar = ds . findVariable ( name ) ; if ( geometryVar == null ) return null ; // CFConvention if ( ds . findGlobalAttribute ( CF . CONVENTIONS ) != null ) if ( ucar . nc2 . dataset . conv . CF1Convention . getVersion ( ds . findGlobalAttribute ( CF . CONVENTIONS ) . getStringValue ( ) ) >= 8 ) { Attribute geometryTypeAttr = null ; String geometry_type = null ; geometryTypeAttr = geometryVar . findAttribute ( CF . GEOMETRY_TYPE ) ; if ( geometryTypeAttr == null ) return null ; geometry_type = geometryTypeAttr . getStringValue ( ) ; switch ( geometry_type ) { case CF . POLYGON : return GeometryType . POLYGON ; case CF . LINE : return GeometryType . LINE ; case CF . POINT : return GeometryType . POINT ; default : return null ; } } return null ; }
Given a variable name returns the geometry type which that variable is associated with . If the variable has no simple geometry information null will be returned .