Search in sources :

Example 6 with WKTFormat

use of org.apache.sis.io.wkt.WKTFormat in project sis by apache.

the class DefaultCoordinateOperationFactoryTest method createFactory.

/**
 * Creates a new {@link DefaultCoordinateOperationFactory} to use for testing purpose.
 * The same factory will be used for all tests in this class.
 *
 * @throws ParseException if an error occurred while preparing the WKT parser.
 */
@BeforeClass
public static void createFactory() throws ParseException {
    factory = new DefaultCoordinateOperationFactory();
    parser = new WKTFormat(null, null);
    parser.addFragment("NTF", "ProjectedCRS[“NTF (Paris) / Lambert zone II”,\n" + "  BaseGeodCRS[“NTF (Paris)”,\n" + "    Datum[“Nouvelle Triangulation Française (Paris)”,\n" + "      Ellipsoid[“Clarke 1880 (IGN)”, 6378249.2, 293.4660212936269]],\n" + "      PrimeMeridian[“Paris”, 2.5969213],\n" + "    Unit[“grad”, 0.015707963267948967]]\n," + "  Conversion[“Lambert zone II”,\n" + "    Method[“Lambert Conic Conformal (1SP)”],\n" + "    Parameter[“Latitude of natural origin”, 52.0],\n" + "    Parameter[“Scale factor at natural origin”, 0.99987742],\n" + "    Parameter[“False easting”, 600000.0],\n" + "    Parameter[“False northing”, 2200000.0]],\n" + "  CS[Cartesian, 2]\n," + "    Axis[“Easting (X)”, east],\n" + "    Axis[“Northing (Y)”, north],\n" + "    Unit[“metre”, 1],\n" + "  Id[“EPSG”, 27572]]");
    parser.addFragment("Mercator", "ProjectedCRS[“WGS 84 / World Mercator”,\n" + "  BaseGeodCRS[“WGS 84”,\n" + "    Datum[“World Geodetic System 1984”,\n" + "      Ellipsoid[“WGS 84”, 6378137.0, 298.257223563]],\n" + "    Unit[“degree”, 0.017453292519943295]],\n" + "  Conversion[“World Mercator”,\n" + "    Method[“Mercator (variant A)”]],\n" + "  CS[Cartesian, 2]\n," + "    Axis[“Easting (X)”, east],\n" + "    Axis[“Northing (Y)”, north],\n" + "    Unit[“metre”, 1],\n" + "  Id[“EPSG”, 3395]]");
}
Also used : WKTFormat(org.apache.sis.io.wkt.WKTFormat) BeforeClass(org.junit.BeforeClass)

Aggregations

WKTFormat (org.apache.sis.io.wkt.WKTFormat)6 BeforeClass (org.junit.BeforeClass)3 ParseException (java.text.ParseException)1 UnformattableObjectException (org.apache.sis.io.wkt.UnformattableObjectException)1 Warnings (org.apache.sis.io.wkt.Warnings)1 FactoryDataException (org.apache.sis.referencing.factory.FactoryDataException)1 UnavailableFactoryException (org.apache.sis.referencing.factory.UnavailableFactoryException)1 Test (org.junit.Test)1 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)1 MathTransform (org.opengis.referencing.operation.MathTransform)1 FactoryException (org.opengis.util.FactoryException)1 NoSuchIdentifierException (org.opengis.util.NoSuchIdentifierException)1