org.geolatte.geom.crs.GeographicCoordinateReferenceSystem Maven / Gradle / Ivy
Show all versions of geolatte-geom Show documentation
package org.geolatte.geom.crs;
import org.geolatte.geom.G2D;
/**
* Created by Karel Maesen, Geovise BVBA on 30/11/14.
*/
abstract public class GeographicCoordinateReferenceSystem extends SingleCoordinateReferenceSystem
{
private Datum datum;
private PrimeMeridian primem;
/**
* Constructs a HorizontalCoordinateReferenceSystem
.
*
* @param crsId the {@link org.geolatte.geom.crs.CrsId} that identifies this
* CoordinateReferenceSystem
uniquely
* @param name the commonly used name for this CoordinateReferenceSystem
* @param coordinateSystem the coordinate system to use @throws java.lang.IllegalArgumentException if less than
* two {@link org.geolatte.geom.crs.CoordinateSystemAxis CoordinateSystemAxes} are passed.
*/
public GeographicCoordinateReferenceSystem(CrsId crsId, String name, CoordinateSystem
coordinateSystem) {
super(crsId, name, coordinateSystem);
}
/**
* Returns the Datum
for this CoordinateReferenceSystem
*
* @return
*/
public Datum getDatum() {
return datum;
}
/**
* Sets the Datum
for this CoordinateReferenceSystem
*
* @param datum the Datum
*/
public void setDatum(Datum datum) {
this.datum = datum;
}
/**
* Returns the PrimeMeridian
of this CoordinateReferenceSystem
.
*
* @return the PrimeMeridian
*/
public PrimeMeridian getPrimeMeridian() {
return primem;
}
/**
* Sets the PrimeMeridian
for this CoordinateReferenceSystem
.
*
* @param primeMeridian the PrimeMeridian
*/
public void setPrimeMeridian(PrimeMeridian primeMeridian) {
this.primem = primeMeridian;
}
/**
* Returns the Unit
for this CoordinateReferenceSystem
.
*
* @return the Unit
*/
public Unit getUnit() {
return getAxis(0).getUnit();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GeographicCoordinateReferenceSystem that = (GeographicCoordinateReferenceSystem) o;
if (datum != null ? !datum.equals(that.datum) : that.datum != null) return false;
if (primem != null ? !primem.equals(that.primem) : that.primem != null) return false;
return true;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (datum != null ? datum.hashCode() : 0);
result = 31 * result + (primem != null ? primem.hashCode() : 0);
return result;
}
}