Skip to content

3. Create a new CoordinateReferenceSystem from its components

Bocher edited this page Sep 23, 2016 · 1 revision

To create a new CoordinateReferenceSystem you must manage a GeodeticCRS. As expressed below some objects are mandatory to create a CRS.

- GeodeticDatum (mandatory)
- Identifier (mandatory)
- PrimeMeridian (mandatory)
- Ellipsoid (mandatory)
    Definition of transformations towards other Datums (optional)
    (a standard burs-wolf transformation to wgs84 can be added)
- CoordinateSystem (mandatory)
    Ordered list of Axis
    Ordered list of Units
- Projection (optional)
    table of projection parameter

This pseudo-code explains how to create a new geographic CoordinateReferenceSystem.

// Use a pre-defined PrimeMeridian

PrimeMeridian pm = PrimeMeridian.GREENWICH

// Create your own ellipsoid from its semi-major axis and its flattening

Ellipsoid ell = Ellipsoid.createEllipsoidFromInverseFlattening(6138000.0, 278.0);

// Create your datum

GeodeticDatum gd = new GeodeticDatum(pm, ell);

// or gd = new GeodeticDatum(new identifier("MyNameSpace", "DatumId", "DatumName"),

//      pm, ell, GeographicExtent.WORLD, "Origin of the datum", "epoch 2008");


// Enter the bursa-wolf parameters defined to transform coordinates

// from this datum to WGS84

// units are meter,meter,meter,second,second,second,ppm

gd.setDefaultToWGS84Operation(SevenParameterTransformation

    .createBursaWolfTransformation(dx, dy, dz, rx, ry, rz, ds));


// Create your Geographic Coordinate Reference System based on this datum

CoordinateReferenceSystem crs1 = new Geographic3DCRS("MyCRSname", gd, Geographic3DCRS.LATLONH_DDM_CS);