/** * @param params * the values to get the units or to_meter from. * @return a unit create from the +unit parameter or Unit.METRE if not found. * @throws CRSConfigurationException * if the given unit parameter could not be mapped to a valid deegree-crs unit. */ private Unit createUnit( Map<String, String> params ) throws CRSConfigurationException { Unit result = Unit.METRE; String tmpValue = params.remove( "units" ); if ( tmpValue != null && !"".equals( tmpValue.trim() ) ) { result = Unit.createUnitFromString( tmpValue ); if ( result == null ) { throw new CRSConfigurationException( Messages.getMessage( "CRS_CONFIG_PROJ4_UNKNOWN_UNIT", params.get( EPSG_PRE + "identifier" ), tmpValue ) ); } } else { tmpValue = params.remove( "to_meter" ); if ( tmpValue != null && !"".equals( tmpValue.trim() ) ) { result = new Unit( "Unknown", "unknown", Double.parseDouble( tmpValue ), Unit.METRE ); } } return result; }
result = createUnitFromString( uomAttribute ); if ( result == null ) { LOG.debug( "Trying to resolve the uri: " + uomAttribute + " from a gml:value/@uom node" ); CRSCodeType[] codes = unitID.getCodes(); for ( int i = 0; i < codes.length && result == null; ++i ) { result = createUnitFromString( codes[i].getOriginal() );
throw new UnknownUnitException( "Unit name is missing" ); return Unit.createUnitFromString( name );
if ( ea != 0 ) { if ( ef != 0 || eb != 0 ) { IUnit u = Unit.createUnitFromString( "epsg:" + uom ); if ( u == null ) { LOG.warn( "Could not determine unit of measure of epsg:" + uom );
result = Unit.createUnitFromString( unitId ); if ( result == null ) { throw new CRSConfigurationException( Messages.getMessage( "CRS_CONFIG_PARSE_ERROR", "Units",