private IAxis[] forceXYAxisOrder( IAxis[] axis ) { if ( axis != null && axis.length == 2 && ( axis[0].getOrientation() == Axis.AO_NORTH || axis[0].getOrientation() == Axis.AO_SOUTH ) ) { IAxis[] xyAxis = new IAxis[2]; xyAxis[0] = axis[1]; xyAxis[1] = axis[0]; return xyAxis; } return axis; }
/** * Return the axis index associated with a northing value, if the axis could not be determined (e.g not is * {@link Axis#AO_NORTH} {@link Axis#AO_SOUTH} or {@link Axis#AO_UP} or {@link Axis#AO_DOWN}) 1 will be returned. * * @return the index of the axis which represents the easting/westing component of a coordinate tuple. */ public int getNorthing() { IAxis[] axis = getAxis(); for ( int i = 0; i < axis.length; ++i ) { IAxis a = axis[i]; if ( a != null ) { if ( a.getOrientation() == Axis.AO_NORTH || a.getOrientation() == Axis.AO_SOUTH || a.getOrientation() == Axis.AO_DOWN || a.getOrientation() == Axis.AO_UP ) { return i; } } } return 1; }
/** * Return the axis index associated with an easting value, if the axis could not be determined {@link Axis#AO_OTHER} * 0 will be returned. * * @return the index of the axis which represents the easting/westing component of a coordinate tuple. */ public int getEasting() { IAxis[] axis = getAxis(); for ( int i = 0; i < axis.length; ++i ) { IAxis a = axis[i]; if ( a != null ) { if ( a.getOrientation() == Axis.AO_EAST || a.getOrientation() == Axis.AO_WEST ) { return i; } } } return 0; }
private boolean isXy( final ICRS crs ) { if ( crs == null ) { return true; } final int axisOrientation = crs.getAxis()[0].getOrientation(); return axisOrientation == AO_WEST || axisOrientation == AO_EAST; }
public int getOrientation() { return getReferencedObject().getOrientation(); }
/** * @param axis */ private boolean checkAxisOrientation( IAxis[] axis ) { boolean result = false; if ( axis == null || axis.length != 2 ) { result = false; } else { IAxis first = axis[0]; IAxis second = axis[1]; LOG.debug( "First projected crs Axis: " + first ); LOG.debug( "Second projected crs Axis: " + second ); if ( first != null && second != null ) { if ( Axis.AO_WEST == Math.abs( second.getOrientation() ) ) { result = true; if ( Axis.AO_NORTH != Math.abs( first.getOrientation() ) ) { LOG.warn( "The given projection uses a second axis which is not mappable ( " + second + ") please check your configuration, assuming y, x axis-order." ); } } } } LOG.debug( "Incoming ordinates will" + ( ( result ) ? " " : " not " ) + "be swapped." ); return result; }
/** * @param axis * @return */ private boolean checkAxisOrientation( IAxis[] axis ) { boolean result = false; if ( axis == null || axis.length != 2 ) { result = false; } else { IAxis first = axis[0]; IAxis second = axis[1]; LOG.debug( "First crs Axis: " + first ); LOG.debug( "Second crs Axis: " + second ); if ( first != null && second != null ) { if ( Axis.AO_WEST == Math.abs( second.getOrientation() ) ) { result = true; if ( Axis.AO_NORTH != Math.abs( first.getOrientation() ) ) { LOG.warn( "The given projection uses a second axis which is not mappable ( " + second + ") please check your configuration, assuming y, x axis-order." ); } } } } LOG.debug( "Incoming ordinates will" + ( ( result ) ? " " : " not " ) + "be swapped." ); return result; }
private static boolean isXyOrdered( final ICRS crs ) { return crs == null || crs.getAlias().equals( "CRS:1" ) || crs.getAxis()[0].getOrientation() == AO_EAST; }
private boolean axisFlipped( ICRS crs ) { if ( crs.getAlias().startsWith( "EPSG:" ) ) { crs = CRSManager.getCRSRef( "urn:ogc:def:crs:EPSG::" + crs.getAlias().substring( 5 ) ); } return wmsVersion.equals( VERSION_111 ) || crs.getAxis()[0].getOrientation() == Axis.AO_EAST; }
for ( int srcIndex = 0; srcIndex < dimension; srcIndex++ ) { boolean hasFound = false; final int srcAxe = srcAxis[srcIndex].getOrientation(); final int sourceAxisDirection = Math.abs( srcAxe ); for ( int dstIndex = 0; dstIndex < dimension; dstIndex++ ) { final int dstAxeDirection = dstAxis[dstIndex].getOrientation(); if ( sourceAxisDirection == Math.abs( dstAxeDirection ) ) { if ( hasFound ) {
for ( int i = 0; i < targetAxis.length; ++i ) { final int orientation = targetAxis[i].getOrientation(); if ( Axis.AO_WEST == Math.abs( orientation ) ) { LOG.debug( "Adding prime-meridian translation to axis:" + targetAxis[i] );