/** * Geocentric crs with it's axis pointing to x=front, y=east, z=north. * * @param datum * @param code * @param name */ public GeocentricCRS( IGeodeticDatum datum, CRSCodeType code, String name ) { this( datum, new Axis[] { new Axis( "X", Axis.AO_FRONT ), new Axis( "Y", Axis.AO_EAST ), new Axis( "Z", Axis.AO_NORTH ) }, new CRSCodeType[] { code }, new String[] { name }, null, null, null ); }
/** * Parses an axis element * * @param reader * @return the parsed axis element * @throws XMLStreamException * @throws XMLParsingException */ protected Axis parseAxis( XMLStreamReader reader ) throws XMLStreamException, XMLParsingException { String axisName = getRequiredText( reader, new QName( CRS_NS, "Name" ), true ); Unit unit = parseUnit( reader, true ); String axisOrientation = getRequiredText( reader, new QName( CRS_NS, "AxisOrientation" ), true ); return new Axis( unit, axisName, axisOrientation ); }
/** * @return an Axis * @throws IOException * @throws WKTParsingException * if the axis orientation is not one of the values defined in the WKT reference ( NORTH | SOUTH | WEST * | EAST | UP | DOWN | OTHER ) */ protected Axis parseAxis() throws IOException { passOverWord( "AXIS" ); passOverOpeningBracket(); String name = parseString(); passOverChar( ',' ); tokenizer.nextToken(); String orientation = tokenizer.sval; if ( !( orientation.equalsIgnoreCase( "NORTH" ) || orientation.equalsIgnoreCase( "SOUTH" ) || orientation.equalsIgnoreCase( "WEST" ) || orientation.equalsIgnoreCase( "EAST" ) || orientation.equalsIgnoreCase( "UP" ) || orientation.equalsIgnoreCase( "DOWN" ) || orientation.equalsIgnoreCase( "OTHER" ) ) ) { throw new WKTParsingException( "The tokenizer expects a valid Axis Orientation: NORTH | SOUTH | WEST | EAST | UP | DOWN | OTHER. The current token is " + tokenizer.toString() ); } passOverClosingBracket(); return new Axis( name, "AO_" + orientation ); }
/** * @param rootElement * containing an gml:CoordinateSystemAxis type dom representation. * @return an {@link Axis} instance initialized with values from the given XML-OM fragment or <code>null</code> if * the given root element is <code>null</code> if the axis could not be mapped it's orientation will be * {@link Axis#AO_OTHER} * * @throws XMLParsingException * if the dom tree is not consistent or a required element is missing. */ protected IAxis parseAxis( OMElement rootElement ) throws XMLParsingException { if ( rootElement == null ) { LOG.debug( "The given axis element is null, returning nothing" ); return null; } String name = adapter.getRequiredNodeAsString( rootElement, new XPath( PRE + "axisAbbrev", nsContext ) ); String orientation = adapter.getRequiredNodeAsString( rootElement, new XPath( PRE + "axisDirection", nsContext ) ); IUnit unit = parseUnitOfMeasure( rootElement ); if ( unit == null ) { unit = Unit.METRE; } return new Axis( unit, name, orientation ); }
VerticalDatum verticalDatum = null; IUnit unit = null; Axis axis = new Axis( "", Axis.AO_OTHER ); // in case there is no axis defined CRSCodeType code = CRSCodeType.getUndefined(); while ( true ) {