Package org.geotools.referencing.datum

Examples of org.geotools.referencing.datum.DefaultGeodeticDatum


        assertEquals(unit, SI.CELSIUS);

        // Testinc Datum and Ellipsoid related parsing
        final double inverseFlattening = 298.257223563;
        final double equatorialRadius = 6378137;
        final DefaultGeodeticDatum datum = Utilities.getDefaultGeodeticDatum("WGS84",
                equatorialRadius, inverseFlattening, SI.METER);
        final PrimeMeridian primeMeridian = datum.getPrimeMeridian();
        assertEquals(0, primeMeridian.getGreenwichLongitude(), DELTA);
        final Ellipsoid ellipsoid = datum.getEllipsoid();
        assertEquals(equatorialRadius, ellipsoid.getSemiMajorAxis(), DELTA);
        assertEquals(inverseFlattening, ellipsoid.getInverseFlattening(), DELTA);

        // Testing coordinateReferenceSystem setup
        final GeographicCRS geoCrs = Utilities.getBaseCRS(equatorialRadius, inverseFlattening);
View Full Code Here


     * GEOT-3497 (given the same accuracy use the transformation method with the largest valid area)
     */
    @Test
    public void testNad83() throws Exception {
        GeographicCRS crs = (GeographicCRS) CRS.decode("EPSG:4269");
        DefaultGeodeticDatum datum = (DefaultGeodeticDatum) crs.getDatum();
        BursaWolfParameters[] params = datum.getBursaWolfParameters();
        boolean wgs84Found = false;
        for(int i = 0; i < params.length; i++) {
            if(DefaultGeodeticDatum.isWGS84(params[i].targetDatum)) {
                wgs84Found = true;
                assertEquals(0.0, params[i].dx, EPS);
View Full Code Here

        // Create WGS 72 CRS where we know that the EPSG defines a unique
        // Position Vector Transformation to WGS 84 with ppm = 0.219
        GeographicCRS wgs72 = (GeographicCRS) CRS.decode("EPSG:4322");
       
        // Get datum
        DefaultGeodeticDatum datum = (DefaultGeodeticDatum)wgs72.getDatum();
       
        // Get BursaWolf parameters
        BursaWolfParameters[] params = datum.getBursaWolfParameters();
       
        // Check for coherence with the value contained in the EPSG data base
        assertEquals(0.219, params[0].ppm, EPS);
    }
View Full Code Here

    // define crs
    metadata.addGeoAscii(GeoTiffGCSCodes.GeogCitationGeoKey, geographicCRS
        .getName().getCode());

    // geodetic datum
    final DefaultGeodeticDatum datum = (DefaultGeodeticDatum) geographicCRS
        .getDatum();
    parseDatum(datum, metadata);

    // angular unit
    final Unit angularUnit = ((EllipsoidalCS) geographicCRS
        .getCoordinateSystem()).getAxis(0).getUnit();
    parseUnit(angularUnit, 0, metadata);

    // prime meridian
    parsePrimem((DefaultPrimeMeridian) datum.getPrimeMeridian(), metadata);

    // linear unit
//    final Unit linearUnit = datum.getEllipsoid().getAxisUnit();
//    parseUnit(linearUnit, 1, metadata);
View Full Code Here

      // PRIME MERIDIAN
      // lookup the Prime Meridian.
      final PrimeMeridian primeMeridian = createPrimeMeridian(metadata,unit);

      // DATUM
      datum = new DefaultGeodeticDatum(cleanName(name), ellipsoid,primeMeridian);
    } else {
      /**
       * NOT USER DEFINED DATUM
       */

 
View Full Code Here

    // get the name of the gcs which will become a citation for the user
    // define crs
    metadata.addGeoAscii(GeoTiffGCSCodes.GeogCitationGeoKey,geographicCRS.getName().getCode());

    // geodetic datum
    final DefaultGeodeticDatum datum = (DefaultGeodeticDatum) geographicCRS.getDatum();
    parseDatum(datum, metadata);

    // angular unit
    final Unit<?> angularUnit = ((EllipsoidalCS) geographicCRS.getCoordinateSystem()).getAxis(0).getUnit();
    parseUnit(angularUnit, 0, metadata);

    // prime meridian
    parsePrimem((DefaultPrimeMeridian) datum.getPrimeMeridian(), metadata);

    // linear unit
    final Unit<?> linearUnit = datum.getEllipsoid().getAxisUnit();
    parseUnit(linearUnit, 2, metadata);

  }
View Full Code Here

        if (identifiers == null)
            throw new IllegalArgumentException( "Reference Identifier not available");
        final Map<String, Object> properties = new HashMap<String, Object>(4);
        properties.put(DefaultGeodeticDatum.NAME_KEY, identifiers[0]);
        properties.put(DefaultGeodeticDatum.ALIAS_KEY, identifiers);
        DefaultGeodeticDatum datum = new DefaultGeodeticDatum(properties,ellipsoid, DefaultPrimeMeridian.GREENWICH);
        return datum;
    }
View Full Code Here

    }
   
   
    public static GeographicCRS getBaseCRS(final double firstParameter,
            final double secondParameter, final boolean isSecondParameterInverseFlattening){
        final DefaultGeodeticDatum datum;
        datum = CRSUtilities.getDefaultGeodeticDatum("WGS84", firstParameter, secondParameter, SI.METER, isSecondParameterInverseFlattening);
        final GeographicCRS sourceCRS = new DefaultGeographicCRS("WGS-84", datum, DefaultGeographicCRS.WGS84.getCoordinateSystem());
        return sourceCRS;
    }
View Full Code Here

        if (identifiers == null)
            throw new IllegalArgumentException("Reference Identifier not available");
        final Map<String, Object> properties = new HashMap<String, Object>(4);
        properties.put(DefaultGeodeticDatum.NAME_KEY, identifiers[0]);
        properties.put(DefaultGeodeticDatum.ALIAS_KEY, identifiers);
        DefaultGeodeticDatum datum = new DefaultGeodeticDatum(properties, ellipsoid, DefaultPrimeMeridian.GREENWICH);
        return datum;
    }
View Full Code Here

        if (!(datum instanceof GeodeticDatum)) {
            return DefaultGeographicCRS.WGS84;
        }
        GeodeticDatum geoDatum = (GeodeticDatum) datum;
        if (geoDatum.getPrimeMeridian().getGreenwichLongitude() != 0) {
            geoDatum = new DefaultGeodeticDatum(geoDatum.getName().getCode(),
                    geoDatum.getEllipsoid(), DefaultPrimeMeridian.GREENWICH);
        } else if (crs instanceof GeographicCRS) {
            if (CRS.equalsIgnoreMetadata(DefaultEllipsoidalCS.GEODETIC_2D, crs.getCoordinateSystem())) {
                return (GeographicCRS) crs;
            }
View Full Code Here

TOP

Related Classes of org.geotools.referencing.datum.DefaultGeodeticDatum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.