Package org.opengis.referencing.datum

Examples of org.opengis.referencing.datum.GeodeticDatum


                case WGS72:  compare(GeodeticDatumMock.WGS72 .getEllipsoid(), ellipsoid); break;
                case NAD83:  compare(GeodeticDatumMock.NAD83 .getEllipsoid(), ellipsoid); break;
                case NAD27:  compare(GeodeticDatumMock.NAD27 .getEllipsoid(), ellipsoid); break;
                case SPHERE: compare(GeodeticDatumMock.SPHERE.getEllipsoid(), ellipsoid); break;
            }
            final GeodeticDatum datum = StandardDefinitions.createGeodeticDatum(e.datum, ellipsoid, pm);
            switch (e) {
                case WGS84:  compare(HardCodedDatum.WGS84,  datum); break;
                case WGS72:  compare(HardCodedDatum.WGS72,  datum); break;
                case SPHERE: compare(HardCodedDatum.SPHERE, datum); break;
            }
View Full Code Here


             * ISO uses a single type, GeodeticCRS, for both of them and infer the
             * geographic or geocentric type from the coordinate system. We do this
             * check here for instantiating the most appropriate SIS type.
             */
            final Map<String,?> properties = IdentifiedObjects.getProperties(object);
            final GeodeticDatum datum = ((GeodeticCRS) object).getDatum();
            final CoordinateSystem cs = object.getCoordinateSystem();
            if (cs instanceof EllipsoidalCS) {
                return new DefaultGeographicCRS(properties, datum, (EllipsoidalCS) cs);
            }
            if (cs instanceof SphericalCS) {
View Full Code Here

                return Objects.equals(this.ellipsoid,     that.ellipsoid)     &&
                       Objects.equals(this.primeMeridian, that.primeMeridian) &&
                        Arrays.equals(this.bursaWolf,     that.bursaWolf);
            }
            default: {
                final GeodeticDatum that = (GeodeticDatum) object;
                return deepEquals(getEllipsoid(),     that.getEllipsoid(),     mode) &&
                       deepEquals(getPrimeMeridian(), that.getPrimeMeridian(), mode);
                /*
                 * HACK: We do not consider Bursa-Wolf parameters as a non-metadata field.
                 *       This is needed in order to get equalsIgnoreMetadata(...) to returns
                 *       'true' when comparing the WGS84 constant in this class with a WKT
                 *       DATUM element with a TOWGS84[0,0,0,0,0,0,0] element. Furthermore,
View Full Code Here

        try{
            Hints hints = new Hints(Hints.EPSG_DATA_SOURCE, "jdbc/EPSG");
       
            OracleDialectEpsgFactory oracle = new OracleDialectEpsgFactory(hints, connection);
   
            GeodeticDatum datum = oracle.createGeodeticDatum("6326");
            assertNotNull(datum);
        }
        finally {
            connection.close();
        }
View Full Code Here

    }
   
    public void testDatumCreation() throws Exception {
        ThreadedOracleEpsgFactory oracle = new ThreadedOracleEpsgFactory();
               
        GeodeticDatum datum = oracle.createGeodeticDatum("6326");
        assertNotNull( datum );
    }
View Full Code Here

     * @throws ParameterNotFoundException
     */
    private void refineParameters(final GeographicCRS baseCRS, final ParameterValueGroup parameters)
            throws InvalidParameterValueException, ParameterNotFoundException {
            // set the remaining parameters.
            final GeodeticDatum tempDatum = ((GeodeticDatum) baseCRS.getDatum());
            final DefaultEllipsoid tempEll = (DefaultEllipsoid) tempDatum.getEllipsoid();
            double inverseFlattening = tempEll.getInverseFlattening();
            double semiMajorAxis = tempEll.getSemiMajorAxis();
            // setting missing parameters
            parameters.parameter("semi_minor").setValue(semiMajorAxis * (1 - (1 / inverseFlattening)));
            parameters.parameter("semi_major").setValue(semiMajorAxis);
View Full Code Here

   *
   */
  private GeodeticDatum createGeodeticDatum(final Unit<?> unit,
      final GeoTiffIIOMetadataDecoder metadata) throws IOException {
    // lookup the datum (w/o PrimeMeridian), error if "user defined"
    GeodeticDatum datum = null;
    final String datumCode = metadata.getGeoKey(GeoTiffGCSCodes.GeogGeodeticDatumGeoKey);

    if (datumCode == null) {
      throw new GeoTiffException(
          metadata,
View Full Code Here

            name=values[0];
        }
    }

    // lookup the Geodetic datum
    final GeodeticDatum datum = createGeodeticDatum(linearUnit, metadata);

    // coordinate reference system
                // property map is reused
                final Map<String, String> props = new HashMap<String, String>();
                // make the user defined GCS from all the components...
View Full Code Here

        out.println("create Coodinate Reference System....3: ");
        out.println(greenwich.toWKT());

        // NOTE: we could use the following pre-defined constant instead:
        //       DefaultPrimeMeridian.GREENWICH;
        final GeodeticDatum datum;
        datum = datumFactory.createGeodeticDatum(name("Airy1830"), airy1830, greenwich);
        out.println();
        out.println("create Coodinate Reference System....4: ");
        out.println(datum.toWKT());

        // NOTE: we could use the following pre-defined constant instead:
        //       DefaultEllipsoidalCS.GEODETIC_2D;
        final EllipsoidalCS ellCS;
        ellCS = csFactory.createEllipsoidalCS(name("Ellipsoidal"),
View Full Code Here

        final String           name3 = "NTF (Paris meridian)";
        final Ellipsoid    ellipsoid = DefaultEllipsoid.WGS84;
        final PrimeMeridian meridian = DefaultPrimeMeridian.GREENWICH;
        DatumFactory         factory = new ReferencingObjectFactory();
        final Map<String,?> properties = Collections.singletonMap("name", name1);
        GeodeticDatum datum = factory.createGeodeticDatum(properties, ellipsoid, meridian);
        assertTrue(datum.getAlias().isEmpty());

        for (int i=0; i<3; i++) {
            switch (i) {
                case  0: factory = new DatumAliases(factory);                      break;
                case  1: factory = ReferencingFactoryFinder.getDatumFactory(null); break;
                case  2: ((DatumAliases) factory).freeUnused();                    break;
                default: throw new AssertionError(); // Should not occurs.
            }
            final String pass = "Pass #"+i;
            datum = factory.createGeodeticDatum(properties, ellipsoid, meridian);
            final GenericName[] aliases = datum.getAlias().toArray(new GenericName[0]);
            assertEquals(pass, 4, aliases.length);
            assertEquals(pass, name0, aliases[0].tip().toString());
            assertEquals(pass, name1, aliases[1].tip().toString());
            assertEquals(pass, name2, aliases[2].tip().toString());
            assertEquals(pass, name3, aliases[3].tip().toString());
            assertTrue  (pass, aliases[0] instanceof ScopedName);
            assertTrue  (pass, aliases[1] instanceof ScopedName);
            assertTrue  (pass, aliases[2] instanceof ScopedName);
            assertTrue  (pass, aliases[3] instanceof ScopedName);
        }

        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "Tokyo"), ellipsoid, meridian);
        Collection<GenericName> aliases = datum.getAlias();
        assertEquals(4, aliases.size());

        ((DatumAliases) factory).freeUnused();
        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "_toKyo  _"), ellipsoid, meridian);
        assertEquals(4, datum.getAlias().size());
        assertTrue(aliases.equals(datum.getAlias()));

        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "D_Tokyo"), ellipsoid, meridian);
        assertEquals(4, datum.getAlias().size());

        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "Luxembourg 1930"), ellipsoid, meridian);
        assertEquals(3, datum.getAlias().size());

        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "Dummy"), ellipsoid, meridian);
        assertTrue("Non existing datum should have no alias.", datum.getAlias().isEmpty());

        datum = factory.createGeodeticDatum(Collections.singletonMap("name", "WGS 84"), ellipsoid, meridian);
        assertTrue (AbstractIdentifiedObject.nameMatches(datum, "WGS 84"));
        assertTrue (AbstractIdentifiedObject.nameMatches(datum, "WGS_1984"));
        assertTrue (AbstractIdentifiedObject.nameMatches(datum, "World Geodetic System 1984"));
View Full Code Here

TOP

Related Classes of org.opengis.referencing.datum.GeodeticDatum

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.