use of org.opengis.referencing.datum.GeodeticDatum in project sis by apache.
the class CRSBuilder method verify.
/**
* Verifies if the user-defined CRS created from GeoTIFF values
* matches the given CRS created from the EPSG geodetic dataset.
* This method does not verify the EPSG code of the given CRS.
*
* @param crs the CRS created from the EPSG geodetic dataset.
*/
private void verify(final GeocentricCRS crs) throws FactoryException {
/*
* Note: current createUnit(…) implementation does not allow us to distinguish whether METRE ou DEGREE units
* were specified in the GeoTIFF file or if we got the default values. We do not compare units of that reason.
*/
final Unit<Length> linearUnit = createUnit(GeoKeys.GeogLinearUnits, GeoKeys.GeogLinearUnitSize, Length.class, Units.METRE);
final Unit<Angle> angularUnit = createUnit(GeoKeys.AngularUnits, GeoKeys.AngularUnitSize, Angle.class, Units.DEGREE);
final GeodeticDatum datum = crs.getDatum();
verifyIdentifier(crs, datum, GeoKeys.GeodeticDatum);
verify(datum, angularUnit, linearUnit);
}
use of org.opengis.referencing.datum.GeodeticDatum in project sis by apache.
the class CRSBuilder method verify.
/**
* Verifies if the user-defined CRS created from GeoTIFF values
* matches the given CRS created from the EPSG geodetic dataset.
* This method does not verify the EPSG code of the given CRS.
*
* @param crs the CRS created from the EPSG geodetic dataset.
* @param angularUnit the angular unit of the latitude and longitude values.
*/
private void verify(final GeographicCRS crs, final Unit<Angle> angularUnit) throws FactoryException {
/*
* Note: current createUnit(…) implementation does not allow us to distinguish whether METRE ou DEGREE units
* were specified in the GeoTIFF file or if we got the default values. We do not compare units of that reason.
*/
final Unit<Length> linearUnit = createUnit(GeoKeys.GeogLinearUnits, GeoKeys.GeogLinearUnitSize, Length.class, Units.METRE);
final GeodeticDatum datum = crs.getDatum();
verifyIdentifier(crs, datum, GeoKeys.GeodeticDatum);
verify(datum, angularUnit, linearUnit);
}
Aggregations