/** * A datum with given ellipsoid and a GreenWich prime-meridian, with no helmert. * * @param ellipsoid * of this datum * @param code * @param name */ public GeodeticDatum( IEllipsoid ellipsoid, CRSCodeType code, String name ) { this( ellipsoid, PrimeMeridian.GREENWICH, null, new CRSIdentifiable( new CRSCodeType[] { code }, new String[] { name }, null, null, null ) ); }
@Override public boolean equals( Object other ) { if ( other != null && other instanceof Projection ) { final Projection that = (Projection) other; return super.equals( that ) && this.units.equals( that.units ) && Math.abs( ( this.projectionLatitude - that.projectionLatitude ) ) < EPS11 && Math.abs( ( this.projectionLongitude - that.projectionLongitude ) ) < EPS11 && Math.abs( ( this.falseNorthing - that.falseNorthing ) ) < EPS11 && Math.abs( ( this.falseEasting - that.falseEasting ) ) < EPS11 && Math.abs( ( this.scale - that.scale ) ) < EPS11 && ( this.conformal == that.conformal ) && ( this.equalArea == that.equalArea ); } return false; }
/** * Iterates over all Ids (code type originals) and Names and tests if either one matches the given string. * * @param idOrName * a String which might be an id or a name. * @param caseSensitive * should the match me case sensitive * @param exact * should the names and ids contain the given string or match exact. * @return true if any of the names or codes match without case the given string. */ public boolean hasIdOrName( String idOrName, boolean caseSensitive, boolean exact ) { return ArrayUtils.contains( getOrignalCodeStrings(), idOrName, caseSensitive, exact ) || ArrayUtils.contains( getNames(), idOrName, caseSensitive, exact ); }
if ( getName() != null ) { sb.append( "], name: [" ); for ( int i = 0; i < names.length; ++i ) { if ( getVersion() != null ) { sb.append( "], version: [" ); for ( int i = 0; i < versions.length; ++i ) { if ( getDescription() != null ) { sb.append( "], description: [" ); for ( int i = 0; i < descriptions.length; ++i ) { if ( getAreaOfUse() != null ) { sb.append( "], areasOfUse: [" ); for ( int i = 0; i < areasOfUse.length; ++i ) {
@Override public boolean equals( Object other ) { if ( other != null && other instanceof CRSIdentifiable ) { CRSResource that = ( (CRSResource) other ); CRSCodeType[] mId = getCodes(); CRSCodeType[] yId = that.getCodes(); CRSCodeType[] small = mId.length >= yId.length ? yId : mId; CRSCodeType[] large = mId.length < yId.length ? yId : mId; List<CRSCodeType> list = Arrays.asList( large ); boolean result = true; for ( int i = 0; result && ( i < small.length ); ++i ) { CRSCodeType id = small[i]; if ( id != null ) { result = list.contains( id ); } } return result; } return false; }
/** * * @param id * @param caseSensitive * @param exact * @return true if the given id is present in this objects id's. */ public boolean hasId( String id, boolean caseSensitive, boolean exact ) { return contains( getOrignalCodeStrings(), id, caseSensitive, exact ); }
for ( CRSCodeType id : getCodes() ) { if ( id != null ) { code = code * 37 + id.hashCode();
/** * @param codes * @param names * @param versions * @param descriptions * @param areasOfUse */ public Datum( CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse ) { this( new CRSIdentifiable( codes, names, versions, descriptions, areasOfUse ) ); } }
@Override public boolean equals( Object other ) { if ( other instanceof PrimeMeridianRef ) { other = ( (PrimeMeridianRef) other ).getReferencedObject(); } if ( other != null && other instanceof PrimeMeridian ) { PrimeMeridian that = (PrimeMeridian) other; return ( Math.abs( this.longitude - that.longitude ) < EPS11 ) && ( ( this.units != null ) ? this.units.equals( that.units ) : ( that.units == null ) ) && super.equals( that ); } return false; }
/** * @param codes * @param names * @param versions * @param descriptions * @param areasOfUse */ public VerticalDatum( CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse ) { this( new CRSIdentifiable( codes, names, versions, descriptions, areasOfUse ) ); }
/** * @param other * another ellipsoid * @return true if the other ellipsoid != null and its units, semi-major-axis and eccentricity are the same. */ @Override public boolean equals( Object other ) { if ( other instanceof EllipsoidRef ) { other = ( (EllipsoidRef) other ).getReferencedObject(); } if ( other != null && other instanceof Ellipsoid ) { final Ellipsoid that = (Ellipsoid) other; return this.units.equals( that.units ) && ( Math.abs( this.semiMajorAxis - that.semiMajorAxis ) < EPS11 ) && ( Math.abs( this.eccentricity - that.eccentricity ) < EPS11 ) && super.equals( that ); } return false; }
/** * A datum with given ellipsoid and a GreenWich prime-meridian. * * @param ellipsoid * of this datum * @param toWGS84 * bursa-wolf parameters describing the transform from this datum into the wgs84 datum. * @param codes */ public GeodeticDatum( IEllipsoid ellipsoid, Helmert toWGS84, CRSCodeType[] codes ) { this( ellipsoid, PrimeMeridian.GREENWICH, toWGS84, new CRSIdentifiable( codes, null, null, null, null ) ); }
@Override public boolean equals( Object other ) { if ( other != null && other instanceof Transformation ) { final Transformation that = (Transformation) other; return this.getImplementationName().equals( that.getImplementationName() ) && super.equals( that ) && isIdentity() == that.isIdentity() && isInverseTransform() == that.isInverseTransform(); } return false; }
/** * A datum with given ellipsoid and a prime-meridian. * * @param ellipsoid * of this datum * @param primeMeridian * to which this datum is defined. * @param toWGS84 * bursa-wolf parameters describing the transform from this datum into the wgs84 datum. * @param codes */ public GeodeticDatum( IEllipsoid ellipsoid, IPrimeMeridian primeMeridian, Helmert toWGS84, CRSCodeType[] codes ) { this( ellipsoid, primeMeridian, toWGS84, new CRSIdentifiable( codes, null, null, null, null ) ); }
@Override public boolean equals( Object other ) { if ( other instanceof CRSRef ) { other = ( (CRSRef) other ).getReferencedObject(); } if ( other != null && other instanceof ICRS ) { final ICRS that = (CRS) other; return that.getType() == this.getType() && that.getDimension() == this.getDimension() && matchAxis( that.getAxis() ) && super.equals( that ) && that.getDatum().equals( this.getDatum() ); } return false; }
/** * A datum with given ellipsoid and a GreenWich prime-meridian. * * @param ellipsoid * of this datum * @param toWGS84 * bursa-wolf parameters describing the transform from this datum into the wgs84 datum. * @param code * @param name */ public GeodeticDatum( IEllipsoid ellipsoid, Helmert toWGS84, CRSCodeType code, String name ) { this( ellipsoid, PrimeMeridian.GREENWICH, toWGS84, new CRSIdentifiable( new CRSCodeType[] { code }, new String[] { name }, null, null, null ) ); }
/** * Unit constructor. * * @param symbol * @param name * of the unit, e.g. metre * @param code * of the unit */ public Unit( final String symbol, final String name, final CRSCodeType code ) { super( new CRSIdentifiable( new CRSCodeType[] { code }, new String[] { name }, null, null, null ) ); this.symbol = symbol; this.scale = 1; this.baseType = this; }
/** * @param semiMajorAxis * @param eccentricity * @param units * @param codes * @param names * @param versions * @param descriptions * @param areasOfUse */ public Ellipsoid( double semiMajorAxis, double eccentricity, IUnit units, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse ) { this( semiMajorAxis, eccentricity, units, new CRSIdentifiable( codes, names, versions, descriptions, areasOfUse ) ); }
/** * @param units * @param semiMajorAxis * @param semiMinorAxis * @param codes * @param names * @param versions * @param descriptions * @param areasOfUse */ public Ellipsoid( IUnit units, double semiMajorAxis, double semiMinorAxis, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse ) { this( units, semiMajorAxis, semiMinorAxis, new CRSIdentifiable( codes, names, versions, descriptions, areasOfUse ) ); }