/** * @return the longitude value relative to the Greenwich Meridian, expressed in the radians. */ public double getLongitudeAsRadian() { return getAngularUnit().convert( getLongitude(), Unit.RADIAN ); }
result = new PrimeMeridian( unit, gwLongitude, id ); CRSCodeType[] codes = PrimeMeridian.GREENWICH.getCodes(); CRSCodeType[] foundCodes = id.getCodes(); CRSCodeType[] resultCodes = new CRSCodeType[codes.length + foundCodes.length]; id = new CRSIdentifiable( resultCodes, id.getNames(), id.getVersions(), id.getDescriptions(), id.getAreasOfUse() ); result = new PrimeMeridian( Unit.RADIAN, 0, id );
/** * @param reader * to use * @return the next PrimeMeridian or null if no more definitions were found. * @throws XMLStreamException */ protected PrimeMeridian parsePrimeMeridian( XMLStreamReader reader ) throws XMLStreamException { if ( reader == null || !moveReaderToFirstMatch( reader, PM_ELEMENT ) ) { LOG.debug( "Could not get prime meridian no more definitions found." ); return null; } CRSResource id = parseIdentifiable( reader ); Unit units = parseUnit( reader, true ); double longitude = 0; try { longitude = super.parseLatLonType( reader, new QName( CRS_NS, "Longitude" ), true, 0 ); } catch ( XMLParsingException e ) { throw new CRSConfigurationException( e ); } return getStore().addIdToCache( new PrimeMeridian( units, longitude, id ), false ); }
pm.setAngularUnit( unit ); datum.setPrimeMeridian( pm );
/** * @param meridianId * the id to search for. * @return the primeMeridian with given id or <code>null</code> * @throws CRSConfigurationException * if the longitude was not set or the units could not be parsed. */ public PrimeMeridian getPrimeMeridianForId( String meridianId ) throws CRSConfigurationException { if ( meridianId == null || "".equals( meridianId.trim() ) ) { return null; } PrimeMeridian result = getStore().getCachedIdentifiable( PrimeMeridian.class, meridianId ); if ( result == null ) { try { result = parsePrimeMeridian( getConfigReader() ); while ( result != null && !result.hasId( meridianId, false, true ) ) { result = parsePrimeMeridian( getConfigReader() ); } } catch ( XMLStreamException e ) { throw new CRSConfigurationException( e ); } } return result; }
codes[i] = CRSCodeType.valueOf( ids[i] ); result = new PrimeMeridian( Unit.RADIAN, longitude, codes, names, meridianVersions, descs, aous );
pm.setAngularUnit( unit ); datum.setPrimeMeridian( pm );
/** * @param targetUnit * The unit in which to express longitude. * @return the longitude value relative to the Greenwich Meridian, expressed in the specified units. This * convenience method make easier to obtains longitude in degrees (<code>getLongitude(Unit.DEGREE)</code>), * no matter the underlying angular unit of this prime meridian. */ public double getLongitude( final IUnit targetUnit ) { return getAngularUnit().convert( getLongitude(), targetUnit ); }
code = new CRSCodeType( name ); return new PrimeMeridian( Unit.RADIAN /* temporarily, until parsing the Unit of the wrapping CRS */, longitude, new CRSIdentifiable( new CRSCodeType[] { code }, new String[] { name }, null, null, null ) );