Class CRSParserTest

    • Field Detail

      • isValidationEnabled

        protected boolean isValidationEnabled
        true if the test methods can invoke a validators.validate(…)} method after parsing. Implementors can set this flag to false if their WKT parser is known to create CRS objects that differ from the ISO 19111 model. One of the main reasons for disabling validation is because the axis names specified by ISO 19162 differ from the axis names specified by ISO 19111.
    • Method Detail

      • factories

        public static List<Factory[]> factories()
        Returns a default set of factories to use for running the tests. Those factories are given in arguments to the constructor when this test class is instantiated directly by JUnit (for example as a suite element), instead than sub-classed by the implementor. The factories are fetched as documented in the TestCase.factories(Class[]) javadoc.
        Returns:
        the default set of arguments to be given to the ObjectFactoryTest constructor.
      • preprocessWKT

        protected String preprocessWKT​(String wkt)
        Pre-process the WKT string before parsing. The default implementation performs the following changes for strict ISO 19162 compliance:
        • Double the straight quotation marks " (U+0022).
        • Replace the left quotation marks (U+201C) and right quotation marks (U+201D) by straight quotation marks " (U+0022).
        Subclasses can override this method if they wish to perform additional pre-processing. The use of left and right quotation marks is intended to make easier for subclasses to identify the beginning and end of quoted texts.
        Parameters:
        wkt - the Well-Known Text to pre-process.
        Returns:
        the Well-Known Text to parse.
      • testGeographic3D

        public void testGeographic3D()
                              throws FactoryException
        Parses a three-dimensional geodetic CRS. The WKT parsed by this test is (except for quote characters):
        GEODCRS[“WGS 84”,
          DATUM[“World Geodetic System 1984”,
            ELLIPSOID[“WGS 84”, 6378137, 298.257223563,
              LENGTHUNIT[“metre”,1.0]]],
          CS[ellipsoidal,3],
            AXIS[“(lat)”,north,ANGLEUNIT[“degree”,0.0174532925199433]],
            AXIS[“(lon)”,east,ANGLEUNIT[“degree”,0.0174532925199433]],
            AXIS[“ellipsoidal height (h)”,up,LENGTHUNIT[“metre”,1.0]]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §8.4 example 2
      • testGeographicWithUnicode

        public void testGeographicWithUnicode()
                                       throws FactoryException
        Parses a geodetic CRS which contain a remark written using non-ASCII characters. The WKT parsed by this test is (except for quote characters):
        GEODCRS[“S-95”,
          DATUM[“Pulkovo 1995”,
            ELLIPSOID[“Krassowsky 1940”, 6378245, 298.3,
              LENGTHUNIT[“metre”,1.0]]],
          CS[ellipsoidal,2],
            AXIS[“latitude”,north,ORDER[1]],
            AXIS[“longitude”,east,ORDER[2]],
            ANGLEUNIT[“degree”,0.0174532925199433],
          REMARK[“Система Геодеэических Координвт года 1995(СК-95)”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §7.3.5 example 3
      • testGeographicWithIdentifier

        public void testGeographicWithIdentifier()
                                          throws FactoryException
        Parses a geodetic CRS which contains a remark and an identifier. The WKT parsed by this test is (except for quote characters):
        GEODCRS[“NAD83”,
          DATUM[“North American Datum 1983”,
            ELLIPSOID[“GRS 1980”, 6378137, 298.257222101, LENGTHUNIT[“metre”,1.0]]],
          CS[ellipsoidal,2],
            AXIS[“latitude”,north],
            AXIS[“longitude”,east],
            ANGLEUNIT[“degree”,0.0174532925199433],
          ID[“EPSG”,4269],
          REMARK[“1986 realisation”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §8.4 example 3
      • testGeographicWithGradUnits

        public void testGeographicWithGradUnits()
                                         throws FactoryException
        Parses a geodetic CRS with a prime meridian other than Greenwich and all angular units in grads. The WKT parsed by this test is (except for quote characters):
        GEODCRS[“NTF (Paris)”,
          DATUM[“Nouvelle Triangulation Francaise”,
            ELLIPSOID[“Clarke 1880 (IGN)”, 6378249.2, 293.4660213]],
          PRIMEM[“Paris”,2.5969213],
          CS[ellipsoidal,2],
            AXIS[“latitude”,north,ORDER[1]],
            AXIS[“longitude”,east,ORDER[2]],
            ANGLEUNIT[“grad”,0.015707963267949],
          REMARK[“Nouvelle Triangulation Française”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §8.4 example 4
      • testGeocentric

        public void testGeocentric()
                            throws FactoryException
        Parses a geodetic CRS with Cartesian coordinate system. The WKT parsed by this test is (except for quote characters):
        GEODETICCRS[“JGD2000”,
          DATUM[“Japanese Geodetic Datum 2000”,
            ELLIPSOID[“GRS 1980”, 6378137, 298.257222101]],
          CS[Cartesian,3],
            AXIS[“(X)”,geocentricX],
            AXIS[“(Y)”,geocentricY],
            AXIS[“(Z)”,geocentricZ],
            LENGTHUNIT[“metre”,1.0],
          SCOPE[“Geodesy, topographic mapping and cadastre”],
          AREA[“Japan”],
          BBOX[17.09,122.38,46.05,157.64],
          TIMEEXTENT[2002-04-01,2011-10-21],
          ID[“EPSG”,4946,URI[“urn:ogc:def:crs:EPSG::4946”]],
          REMARK[“注:JGD2000ジオセントリックは現在JGD2011に代わりました。”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §8.4 example 1
      • testProjectedYX

        public void testProjectedYX()
                             throws FactoryException
        Parses a projected CRS with linear units in metres and axes in (Y,X) order. The WKT parsed by this test is (except for quote characters):
        PROJCRS[“ETRS89 Lambert Azimuthal Equal Area CRS”,
          BASEGEODCRS[“ETRS89”,
            DATUM[“ETRS89”,
              ELLIPSOID[“GRS 80”, 6378137, 298.257222101, LENGTHUNIT[“metre”,1.0]]]],
          CONVERSION[“LAEA”,
            METHOD[“Lambert Azimuthal Equal Area”,ID[“EPSG”,9820]],
            PARAMETER[“Latitude of natural origin”,  52.0, ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“Longitude of natural origin”, 10.0, ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“False easting”,  4321000.0, LENGTHUNIT[“metre”,1.0]],
            PARAMETER[“False northing”, 3210000.0, LENGTHUNIT[“metre”,1.0]]],
          CS[Cartesian,2],
            AXIS[“(Y)”,north,ORDER[1]],
            AXIS[“(X)”,east,ORDER[2]],
            LENGTHUNIT[“metre”,1.0],
          SCOPE[“Description of a purpose”],
          AREA[“An area description”],
          ID[“EuroGeographics”,“ETRS-LAEA”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §9.5 example 1
      • testProjectedWithFootUnits

        public void testProjectedWithFootUnits()
                                        throws FactoryException
        Parses a projected CRS with linear units in feet. The WKT parsed by this test is (except for quote characters):
        PROJCRS[“NAD27 / Texas South Central”,
          BASEGEODCRS[“NAD27”,
            DATUM[“North American Datum 1927”,
              ELLIPSOID[“Clarke 1866”, 20925832.164, 294.97869821,
                LENGTHUNIT[“US survey foot”,0.304800609601219]]]],
          CONVERSION[“Texas South Central SPCS27”,
            METHOD[“Lambert Conic Conformal (2SP)”,ID[“EPSG”,9802]],
            PARAMETER[“Latitude of false origin”,27.83333333333333,
              ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8821]],
            PARAMETER[“Longitude of false origin”,-99.0,
              ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8822]],
            PARAMETER[“Latitude of 1st standard parallel”,28.383333333333,
              ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8823]],
            PARAMETER[“Latitude of 2nd standard parallel”,30.283333333333,
              ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8824]],
            PARAMETER[“Easting at false origin”,2000000.0,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8826]],
            PARAMETER[“Northing at false origin”,0.0,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8827]]],
          CS[Cartesian,2],
            AXIS[“(x)”,east],
            AXIS[“(y)”,north],
            LENGTHUNIT[“US survey foot”,0.304800609601219],
          REMARK[“Fundamental point: Meade’s Ranch KS, latitude 39°13'26.686"N, longitude 98°32'30.506"W.”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §9.5 example 2
      • testProjectedWithImplicitParameterUnits

        public void testProjectedWithImplicitParameterUnits()
                                                     throws FactoryException
        Parses a projected CRS with implicit parameter units. The WKT parsed by this test is (except for quote characters and the line feed in REMARK):
        PROJCRS[“NAD83 UTM 10”,
          BASEGEODCRS[“NAD83(86)”,
            DATUM[“North American Datum 1983”,
              ELLIPSOID[“GRS 1980”,6378137,298.257222101]],
            ANGLEUNIT[“degree”,0.0174532925199433],
            PRIMEM[“Greenwich”,0]],
          CONVERSION[“UTM zone 10N”,ID[“EPSG”,16010],
            METHOD[“Transverse Mercator”],
            PARAMETER[“Latitude of natural origin”,0.0],
            PARAMETER[“Longitude of natural origin”,-123.0],
            PARAMETER[“Scale factor”,0.9996],
            PARAMETER[“False easting”,500000.0],
            PARAMETER[“False northing”,0.0]],
          CS[Cartesian,2],
            AXIS[“(E)”,east,ORDER[1]],
            AXIS[“(N)”,north,ORDER[2]],
            LENGTHUNIT[“metre”,1.0],
          REMARK[“In this example units are implied. This is allowed for backward compatibility.
                  It is recommended that units are explicitly given in the string,
                  as in the previous two examples.”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §9.5 example 3
      • testVertical

        public void testVertical()
                          throws FactoryException
        Parses a vertical CRS. The WKT parsed by this test is (except for quote characters):
        VERTCRS[“NAVD88”,
          VDATUM[“North American Vertical Datum 1988”],
          CS[vertical,1],
            AXIS[“gravity-related height (H)”,up],LENGTHUNIT[“metre”,1.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §10.4
      • testTemporal

        public void testTemporal()
                          throws FactoryException
        Parses a temporal CRS. The WKT parsed by this test is (except for quote characters):
        TIMECRS[“GPS Time”,
           TDATUM[“Time origin”,TIMEORIGIN[1980-01-01T00:00:00.0Z]],
           CS[temporal,1],AXIS[“time”,future],TIMEUNIT[“day”,86400.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §14.4
      • testParametric

        public void testParametric()
                            throws FactoryException
        Parses a parametric CRS. The WKT parsed by this test is (except for quote characters):
        PARAMETRICCRS[“WMO standard atmosphere layer 0”,
           PDATUM[“Mean Sea Level”,ANCHOR[“1013.25 hPa at 15°C”]],
           CS[parametric,1],
           AXIS[“pressure (hPa)”,up],
           PARAMETRICUNIT[“hPa”,100.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §13.4 example 1
      • testEngineering

        public void testEngineering()
                             throws FactoryException
        Parses an engineering CRS with North and West axis directions. The WKT parsed by this test is (except for quote characters):
        ENGINEERINGCRS[“Astra Minas Grid”,
          ENGINEERINGDATUM[“Astra Minas”],
          CS[Cartesian,2],
            AXIS[“northing (X)”,north,ORDER[1]],
            AXIS[“westing (Y)”,west,ORDER[2]],
            LENGTHUNIT[“metre”,1.0],
          ID[“EPSG”,5800]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §11.4 example 2
      • testEngineeringRotated

        public void testEngineeringRotated()
                                    throws FactoryException
        Parses an engineering CRS with South-West and South-East axis directions. The WKT parsed by this test is (except for quote characters):
        ENGCRS[“A construction site CRS”,
          EDATUM[“P1”,ANCHOR[“Peg in south corner”]],
          CS[Cartesian,2],
            AXIS[“site east”,southWest,ORDER[1]],
            AXIS[“site north”,southEast,ORDER[2]],
            LENGTHUNIT[“metre”,1.0],
          TIMEEXTENT[“date/time t1”,“date/time t2”]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §11.4 example 1
      • testEngineeringForShip

        public void testEngineeringForShip()
                                    throws FactoryException
        Parses an engineering CRS anchored to a ship. The WKT parsed by this test is (except for quote characters):
        ENGCRS[“A ship-centred CRS”,
          EDATUM[“Ship reference point”,ANCHOR[“Centre of buoyancy”]],
          CS[Cartesian,3],
            AXIS[“(x)”,forward],
            AXIS[“(y)”,starboard],
            AXIS[“(z)”,down],
            LENGTHUNIT[“metre”,1.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §11.4 example 2
      • testDerivedGeodetic

        public void testDerivedGeodetic()
                                 throws FactoryException
        Parses a derived geodetic CRS. The WKT parsed by this test is (except for quote characters):
        GEODCRS[“ETRS89 Lambert Azimuthal Equal Area CRS”,
          BASEGEODCRS[“WGS 84”,
            DATUM[“WGS 84”,
              ELLIPSOID[“WGS 84”,6378137,298.2572236,LENGTHUNIT[“metre”,1.0]]]],
          DERIVINGCONVERSION[“Atlantic pole”,
            METHOD[“Pole rotation”,ID[“Authority”,1234]],
            PARAMETER[“Latitude of rotated pole”,52.0,
              ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“Longitude of rotated pole”,-30.0,
              ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“Axis rotation”,-25.0,
              ANGLEUNIT[“degree”,0.0174532925199433]]],
          CS[ellipsoidal,2],
            AXIS[“latitude”,north,ORDER[1]],
            AXIS[“longitude”,east,ORDER[2]],
            ANGLEUNIT[“degree”,0.0174532925199433]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §15.3.5 example 3
      • testDerivedEngineeringFromGeodetic

        public void testDerivedEngineeringFromGeodetic()
                                                throws FactoryException
        Parses a derived engineering CRS having a base geodetic CRS. The WKT parsed by this test is (except for quote characters):
        ENGCRS[“Topocentric example A”,
          BASEGEODCRS[“WGS 84”,
            DATUM[“WGS 84”,
              ELLIPSOID[“WGS 84”, 6378137, 298.2572236, LENGTHUNIT[“metre”,1.0]]]],
          DERIVINGCONVERSION[“Topocentric example A”,
            METHOD[“Geographic/topocentric conversions”,ID[“EPSG”,9837]],
            PARAMETER[“Latitude of topocentric origin”,55.0,
              ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“Longitude of topocentric origin”,5.0,
              ANGLEUNIT[“degree”,0.0174532925199433]],
            PARAMETER[“Ellipsoidal height of topocentric origin”,0.0,
              LENGTHUNIT[“metre”,1.0]]],
          CS[Cartesian,3],
            AXIS[“Topocentric East (U)”,east,ORDER[1]],
            AXIS[“Topocentric North (V)”,north,ORDER[2]],
            AXIS[“Topocentric height (W)”,up,ORDER[3]],
            LENGTHUNIT[“metre”,1.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §15.5.2 example 2
      • testDerivedEngineeringFromProjected

        public void testDerivedEngineeringFromProjected()
                                                 throws FactoryException
        Parses a derived engineering CRS having a base projected CRS. The WKT parsed by this test is (except for quote characters):
        ENGCRS[“Gulf of Mexico speculative seismic survey bin grid”,
          BASEPROJCRS[“NAD27 / Texas South Central”,
            BASEGEODCRS[“NAD27”,
              DATUM[“North American Datum 1927”,
                ELLIPSOID[“Clarke 1866”,20925832.164,294.97869821,
                  LENGTHUNIT[“US survey foot”,0.304800609601219]]]],
            CONVERSION[“Texas South CentralSPCS27”,
              METHOD[“Lambert Conic Conformal (2SP)”,ID[“EPSG”,9802]],
              PARAMETER[“Latitude of false origin”,27.83333333333333,
                ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8821]],
              PARAMETER[“Longitude of false origin”,-99.0,
                ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8822]],
              PARAMETER[“Latitude of 1st standard parallel”,28.383333333333,
                ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8823]],
              PARAMETER[“Latitude of 2nd standard parallel”,30.283333333333,
                ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8824]],
              PARAMETER[“Easting at false origin”,2000000.0,
                LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8826]],
              PARAMETER[“Northing at false origin”,0.0,
                LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8827]]]],
          DERIVINGCONVERSION[“Gulf of Mexico speculative survey bin grid”,
            METHOD[“P6 (I = J-90°) seismic bin grid transformation”,ID[“EPSG”,1049]],
            PARAMETER[“Bin grid origin I”,5000,SCALEUNIT[“Bin”,1.0],ID[“EPSG”,8733]],
            PARAMETER[“Bin grid origin J”,0,SCALEUNIT[“Bin”,1.0],ID[“EPSG”,8734]],
            PARAMETER[“Bin grid origin Easting”,871200,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8735]],
            PARAMETER[“Bin grid origin Northing”, 10280160,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8736]],
            PARAMETER[“Scale factor of bin grid”,1.0,
              SCALEUNIT[“Unity”,1.0],ID[“EPSG”,8737]],
            PARAMETER[“Bin width on I-axis”,82.5,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8738]],
            PARAMETER[“Bin width on J-axis”,41.25,
              LENGTHUNIT[“US survey foot”,0.304800609601219],ID[“EPSG”,8739]],
            PARAMETER[“Map grid bearing of bin grid J-axis”,340,
              ANGLEUNIT[“degree”,0.0174532925199433],ID[“EPSG”,8740]],
            PARAMETER[“Bin node increment on I-axis”,1.0,
              SCALEUNIT[“Bin”,1.0],ID[“EPSG”,8741]],
            PARAMETER[“Bin node increment on J-axis”,1.0,
              SCALEUNIT[“Bin”,1.0],ID[“EPSG”,8742]]],
          CS[Cartesian,2],
            AXIS[“(I)”,northNorthWest],
            AXIS[“(J)”,westSouthWest],
            SCALEUNIT[“Bin”,1.0]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §15.5.2 example 1
      • testCompoundWithVertical

        public void testCompoundWithVertical()
                                      throws FactoryException
        Parses a compound CRS with a vertical component. The WKT parsed by this test is (except for quote characters):
        COMPOUNDCRS[“NAD83 + NAVD88”,
          GEODCRS[“NAD83”,
            DATUM[“North American Datum 1983”,
              ELLIPSOID[“GRS 1980”,6378137,298.257222101,
                LENGTHUNIT[“metre”,1.0]]],
              PRIMEMERIDIAN[“Greenwich”,0],
            CS[ellipsoidal,2],
              AXIS[“latitude”,north,ORDER[1]],
              AXIS[“longitude”,east,ORDER[2]],
              ANGLEUNIT[“degree”,0.0174532925199433]],
            VERTCRS[“NAVD88”,
              VDATUM[“North American Vertical Datum 1988”],
              CS[vertical,1],
                AXIS[“gravity-related height (H)”,up],
                LENGTHUNIT[“metre”,1]]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §16.2 example 1
      • testCompoundWithTime

        public void testCompoundWithTime()
                                  throws FactoryException
        Parses a compound CRS with a temporal component. The WKT parsed by this test is (except for quote characters):
        COMPOUNDCRS[“GPS position and time”,
           GEODCRS[“WGS 84”,
             DATUM[“World Geodetic System 1984”,
               ELLIPSOID[“WGS 84”,6378137,298.257223563]],
             CS[ellipsoidal,2],
               AXIS[“(lat)”,north,ORDER[1]],
               AXIS[“(lon)”,east,ORDER[2]],
               ANGLEUNIT[“degree”,0.0174532925199433]],
           TIMECRS[“GPS Time”,
             TIMEDATUM[“Time origin”,TIMEORIGIN[1980-01-01]],
             CS[temporal,1],
               AXIS[“time (T)”,future],
               TIMEUNIT[“day”,86400]]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §16.2 example 3
      • testCompoundWithParametric

        public void testCompoundWithParametric()
                                        throws FactoryException
        Parses a compound CRS with a parametric component. The WKT parsed by this test is (except for quote characters):
        COMPOUNDCRS[“ICAO layer 0”,
           GEODETICCRS[“WGS 84”,
             DATUM[“World Geodetic System 1984”,
               ELLIPSOID[“WGS 84”,6378137,298.257223563,
                 LENGTHUNIT[“metre”,1.0]]],
             CS[ellipsoidal,2],
               AXIS[“latitude”,north,ORDER[1]],
               AXIS[“longitude”,east,ORDER[2]],
               ANGLEUNIT[“degree”,0.0174532925199433]],
           PARAMETRICCRS[“WMO standard atmosphere”,
             PARAMETRICDATUM[“Mean Sea Level”,
               ANCHOR[“Mean Sea Level = 1013.25 hPa”]],
                 CS[parametric,1],
                   AXIS[“pressure (P)”,unspecified],
                   PARAMETRICUNIT[“hPa”,100]]]
        Throws:
        FactoryException - if an error occurred during the WKT parsing.
        See Also:
        OGC 12-063r5 §16.2 example 2