opengeospatial / ets-gpkg12-nsg

Other
2 stars 5 forks source link

Improve and fix CRSDefintion Tests #46

Closed lgoltz closed 1 year ago

lgoltz commented 6 years ago

Improve test org.opengis.cite.gpkg12.nsg.core.NSG_SpatialReferenceSystemsTests#crsDefinitionsTest():

lgoltz commented 6 years ago

Working branch: https://github.com/opengeospatial/ets-gpkg12-nsg/tree/improveCrsDefinitionsTest-46

lgoltz commented 6 years ago

Added new tests to assert that all CRS definitions from the specified listing (out of the specification) can be parsed: https://github.com/opengeospatial/ets-gpkg12-nsg/commit/96ac82325696bbe7e0d0365454c3fa6ccfe80a5c

Unfortunately only EPSG:4326 can be parsed without failure.

melpham commented 5 years ago

The spec says the WKT should be

    GEOGCS["WGS84",
    DATUM["WGS_1984",
    SPHEROID["WGS84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

but this test is testing against this generated WKT which is not the same as the spec:

    GEOGCS["WGS84", 
    DATUM["WGS84", 
        SPHEROID["WGS84", 6378137.0, 298.257223563]], 
    PRIMEM["Greenwich", 0.0], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH]]
melpham commented 5 years ago

It might be possible to use the WKT definition from the NSG spec using PropertyAuthorityFactory to compare it against.

http://www.geotoolkit.org/apidocs/org/geotoolkit/referencing/factory/wkt/PropertyAuthorityFactory.html

melpham commented 5 years ago

After looking at the NSG spec and the code, I think it's probably best to just do the straight string comparison. If in the future, the NSG spec allows more variations for the CRS definitions, then we can create a parser for it. In the meantime, I think the attached changes is sufficient. (this has been tested). Is this the best way for me to send the changes?

CRSTest.zip

melpham commented 5 years ago

Also, note that I made changes to NSG_CRS_WKT.xml because they weren't compliant to the spec's definitions. I submitted an issue for the NSG spec (there were extra comma added in some definitions that is not compliant to WKT standard). Ex: SPHEROID["WGS84",6378137,298.257223563,]]

Submitted by my teammate: https://github.com/ngageoint/geoint-standards/issues/22

lgoltz commented 5 years ago

@melpham Thanks for your contribution! Can you create a pull request with the changes?

melpham commented 5 years ago

@lgoltz Pull requested made: https://github.com/opengeospatial/ets-gpkg12-nsg/pull/47