Closed lgoltz closed 1 year 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.
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]]
It might be possible to use the WKT definition from the NSG spec using PropertyAuthorityFactory to compare it against.
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?
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
@melpham Thanks for your contribution! Can you create a pull request with the changes?
@lgoltz Pull requested made: https://github.com/opengeospatial/ets-gpkg12-nsg/pull/47
Improve test org.opengis.cite.gpkg12.nsg.core.NSG_SpatialReferenceSystemsTests#crsDefinitionsTest():