/** * @return the longitude value relative to the Greenwich Meridian, expressed in the radians. */ public double getLongitudeAsRadian() { return getAngularUnit().convert( getLongitude(), Unit.RADIAN ); }
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; }
@Override public String toString() { return "name: " + axisName + " orientation: " + getOrientationAsString() + " units: " + units; }
/** * @return the units of the heightAxis. */ public final IUnit getHeightUnits() { return axis[2].getUnits(); }
/** * @return the semiMinorAxis (a) of the ellipsoid of the datum. */ public final double getSemiMinorAxis( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getSemiMinorAxis(); }
/** * @return the semiMajorAxis (a) of the ellipsoid of the datum. */ public final double getSemiMajorAxis( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getSemiMajorAxis(); }
/** * @return the eccentricity of the ellipsoid of the datum. */ public final double getEccentricity( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getEccentricity(); }
/** * @return the eccentricity of the ellipsoid of the datum. */ public final double getSquaredEccentricity( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getSquaredEccentricity(); }
/** * @param longitude * @param units */ public void setLongitude( double longitude, IUnit units ) { this.longitude = units.convert( longitude, Unit.RADIAN ); }
/** * @return the primeMeridian of the datum. */ public IPrimeMeridian getPrimeMeridian( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getPrimeMeridian(); }
/** * @return the ellipsoid of the datum. */ public IEllipsoid getEllipsoid( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid(); }
/** * @return true if this is a base type */ public final boolean isBaseType() { return this.equals( this.baseType ); }
/** * 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 ); }
/** * Convert a value in this unit to the base unit, e.g. degree->radians * * @param value * to be converted * @return the converted value or the same value if this unit is a base unit. */ public final double toBaseUnits( final double value ) { if ( isBaseType() ) { return value; } return value * scale; }
@Override public String toString() { StringBuilder sb = new StringBuilder( super.toString() ); sb.append( "\n - Ellipsoid: " ).append( ellipsoid ); sb.append( "\n - Primemeridian: " ).append( primeMeridian ); if ( this.toWGS84 != null ) { sb.append( "\n - wgs84-conversion-info: " ).append( toWGS84 ); } return sb.toString(); }
@Override public double getScale() { return getReferencedObject().getScale(); }
/** * @return the units of all axis of the ICoordinateSystem. */ public IUnit[] getUnits() { IAxis[] allAxis = getAxis(); IUnit[] result = new Unit[allAxis.length]; for ( int i = 0; i < allAxis.length; ++i ) { result[i] = allAxis[i].getUnits(); } return result; }
/** * @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 ); }
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 boolean isSpherical( IGeographicCRS geographicCRS ) { return geographicCRS.getGeodeticDatum().getEllipsoid().getEccentricity() < 0.0000001; }