Examples of GeodeticDatum


Examples of org.opengis.referencing.datum.GeodeticDatum

* A method with some examples of premade static objects.
*/
void premadeObjects() {
    // premadeObjects start
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    GeodeticDatum wgs84Datum = org.geotools.referencing.datum.DefaultGeodeticDatum.WGS84;
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    // premadeObjects end
}
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

   
    map.clear();
    map.put("name", "North American Datum 1927");
    map.put(DefaultGeodeticDatum.BURSA_WOLF_KEY, toWGS84);
   
    GeodeticDatum clark1866datum = datumFactory.createGeodeticDatum(map, clark1866ellipse,
            greenwichMeridian);
    System.out.println(clark1866datum.toWKT());
    // notice all of the lovely datum aliases (used to determine if two
    // datums are the same)
    System.out.println("Identified Datum object:");
    printIdentifierStuff(clark1866datum);
   
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

    Ellipsoid wgs84Ellipsoid = datumFactory.createFlattenedSphere(map, 6378137, 298.257223563,
            SI.METER);
   
    map.clear();
    map.put("name", "WGS84 Height Datum");
    GeodeticDatum wgs84Datum = datumFactory.createGeodeticDatum(map, wgs84Ellipsoid,
            greenwichMeridian);
   
    //
    // Create a geocentric CRS
    //
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

                            default: break search;
                        }
                    }
                }
                if (count == 2) {
                    final GeodeticDatum datum = ((GeographicCRS) crs).getDatum();
                    Map<String,?> properties = CRSUtilities.changeDimensionInName(cs, "3D", "2D");
                    EllipsoidalCS horizontalCS;
                    try {
                        horizontalCS = ReferencingFactoryFinder.getCSFactory(null).
                                createEllipsoidalCS(properties, axis0, axis1);
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

         */
        if (source instanceof DefaultGeodeticDatum && target instanceof DefaultGeodeticDatum) {
            final BursaWolfParameters[] sourceParam = ((DefaultGeodeticDatum) source).bursaWolf;
            final BursaWolfParameters[] targetParam = ((DefaultGeodeticDatum) target).bursaWolf;
            if (sourceParam!=null && targetParam!=null) {
                GeodeticDatum sourceStep;
                GeodeticDatum targetStep;
                for (int i=0; i<sourceParam.length; i++) {
                    sourceStep = sourceParam[i].targetDatum;
                    for (int j=0; j<targetParam.length; j++) {
                        targetStep = targetParam[j].targetDatum;
                        if (equals(sourceStep, targetStep, false)) {
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

  }

  public GeodeticDatum createGeodeticDatum(String code)
      throws FactoryException {
    final String key = toKey(code);
    GeodeticDatum datum = (GeodeticDatum) cache.get(key);
    if (datum == null) {
      try {
        cache.writeLock(key);
        datum = (GeodeticDatum) cache.peek(key);
        if (datum == null) {
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

                                                     + " FROM [Coordinate_Operation Parameter Value]"
                                                     + " WHERE COORD_OP_CODE = ?"
                                                     +   " AND COORD_OP_METHOD_CODE = ?");
        for (int i=0; i<size; i++) {
            final BursaWolfInfo info = (BursaWolfInfo) bwInfos.get(i);
            final GeodeticDatum datum;
            try {
                safetyGuard.add(code);
                datum = createGeodeticDatum(info.target);
            } finally {
                safetyGuard.remove(code);
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

                    type.equalsIgnoreCase("geographic 3D"))
                {
                    final String csCode    = getString(result, 7, code);
                    final String dmCode    = result.getString( 8);
                    final EllipsoidalCS cs = createEllipsoidalCS(csCode);
                    final GeodeticDatum datum;
                    if (dmCode != null) {
                        datum = createGeodeticDatum(dmCode);
                    } else {
                        final String geoCode = getString(result, 9, code, 8);
                        result.close(); // Must be close before createGeographicCRS
                        result = null;
                        final GeographicCRS baseCRS = createGeographicCRS(geoCode);
                        datum = baseCRS.getDatum();
                    }
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    crs = factory.createGeographicCRS(properties, datum, cs);
                }
                /* ----------------------------------------------------------------------
                 *   PROJECTED CRS
                 *
                 *   NOTE: This method invokes itself indirectly, through createGeographicCRS.
                 *         Consequently, we can't use 'result' anymore. We must close it here.
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("projected")) {
                    final String csCode  = getString(result,  7, code);
                    final String geoCode = getString(result,  9, code);
                    final String opCode  = getString(result, 10, code);
                    result.close(); // Must be close before createGeographicCRS
                    result = null;
                    final CartesianCS         cs = createCartesianCS(csCode);
                    final GeographicCRS  baseCRS = createGeographicCRS(geoCode);
                    final CoordinateOperation op = createCoordinateOperation(opCode);
                    if (op instanceof Conversion) {
                        final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                        crs = factory.createProjectedCRS(properties, baseCRS, (Conversion)op, cs);
                    } else {
                         throw noSuchAuthorityCode(Projection.class, opCode);
                    }
                }
                /* ----------------------------------------------------------------------
                 *   VERTICAL CRS
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("vertical")) {
                    final String        csCode = getString(result, 7, code);
                    final String        dmCode = getString(result, 8, code);
                    final VerticalCS    cs     = createVerticalCS   (csCode);
                    final VerticalDatum datum  = createVerticalDatum(dmCode);
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    crs = factory.createVerticalCRS(properties, datum, cs);
                }
                /* ----------------------------------------------------------------------
                 *   COMPOUND CRS
                 *
                 *   NOTE: This method invokes itself recursively.
                 *         Consequently, we can't use 'result' anymore.
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("compound")) {
                    final String code1 = getString(result, 11, code);
                    final String code2 = getString(result, 12, code);
                    result.close();
                    result = null;
                    final CoordinateReferenceSystem crs1, crs2;
                    if (!safetyGuard.add(epsg)) {
                        throw recursiveCall(CompoundCRS.class, epsg);
                    } try {
                        crs1 = createCoordinateReferenceSystem(code1);
                        crs2 = createCoordinateReferenceSystem(code2);
                    } finally {
                        safetyGuard.remove(epsg);
                    }
                    // Note: Don't invoke 'generateProperties' sooner.
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    crs  = factory.createCompoundCRS(properties,
                           new CoordinateReferenceSystem[] {crs1, crs2});
                }
                /* ----------------------------------------------------------------------
                 *   GEOCENTRIC CRS
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("geocentric")) {
                    final String           csCode = getString(result, 7, code);
                    final String           dmCode = getString(result, 8, code);
                    final CoordinateSystem cs     = createCoordinateSystem(csCode);
                    final GeodeticDatum    datum  = createGeodeticDatum   (dmCode);
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    if (cs instanceof CartesianCS) {
                        crs = factory.createGeocentricCRS(properties, datum, (CartesianCS) cs);
                    } else if (cs instanceof SphericalCS) {
                        crs = factory.createGeocentricCRS(properties, datum, (SphericalCS) cs);
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

        final Map      properties = new HashMap();
        final Citation authority  = getAuthority();
        final String   text       = String.valueOf(code);
        properties.put(IdentifiedObject.NAME_KEY, name);
        properties.put(Identifier.AUTHORITY_KEY, authority);
        final GeodeticDatum datum = factories.getDatumFactory().createGeodeticDatum(
                                    properties, ellipsoid, DefaultPrimeMeridian.GREENWICH);

        properties.put(IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier[] {
                new NamedIdentifier(authority, text),
                new NamedIdentifier(authority, PREFIX + text)
View Full Code Here

Examples of org.opengis.referencing.datum.GeodeticDatum

        }
        final Datum datum = ((SingleCRS) crs).getDatum();
        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
Copyright © 2018 www.massapi.com. 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.