Search in sources :

Example 6 with GeodeticDatum

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);
}
Also used : Angle(javax.measure.quantity.Angle) Length(javax.measure.quantity.Length) GeodeticDatum(org.opengis.referencing.datum.GeodeticDatum)

Example 7 with GeodeticDatum

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);
}
Also used : Length(javax.measure.quantity.Length) GeodeticDatum(org.opengis.referencing.datum.GeodeticDatum)

Aggregations

GeodeticDatum (org.opengis.referencing.datum.GeodeticDatum)7 EllipsoidalCS (org.opengis.referencing.cs.EllipsoidalCS)4 Angle (javax.measure.quantity.Angle)3 CartesianCS (org.opengis.referencing.cs.CartesianCS)3 CoordinateSystem (org.opengis.referencing.cs.CoordinateSystem)3 PrimeMeridian (org.opengis.referencing.datum.PrimeMeridian)3 Length (javax.measure.quantity.Length)2 GeodeticCRS (org.opengis.referencing.crs.GeodeticCRS)2 GeographicCRS (org.opengis.referencing.crs.GeographicCRS)2 ProjectedCRS (org.opengis.referencing.crs.ProjectedCRS)2 SingleCRS (org.opengis.referencing.crs.SingleCRS)2 Ellipsoid (org.opengis.referencing.datum.Ellipsoid)2 Unit (javax.measure.Unit)1 Convention (org.apache.sis.io.wkt.Convention)1 BursaWolfParameters (org.apache.sis.referencing.datum.BursaWolfParameters)1 DefaultGeodeticDatum (org.apache.sis.referencing.datum.DefaultGeodeticDatum)1 UnavailableFactoryException (org.apache.sis.referencing.factory.UnavailableFactoryException)1 DependsOnMethod (org.apache.sis.test.DependsOnMethod)1 Test (org.junit.Test)1 Identifier (org.opengis.metadata.Identifier)1