opengeospatial / ets-gpkg12-nsg

Other
2 stars 5 forks source link

NSG GeoPackage - 2.1 ETS failures with "GDAL-valid" Geopackage #14

Closed gramnation closed 6 years ago

gramnation commented 6 years ago

I can create a .gpkg that almost passes NSG test (docker version). I would appreciate feedback on the failing tests. This includes the issue in https://github.com/opengeospatial/ets-gpkg12-nsg/issues/10

Download vector data: https://github.com/opengeospatial/geoedge-plugfest/wiki/Vector-Data

Download satellite images: https://github.com/opengeospatial/geoedge-plugfest/wiki/Raster-Data https://github.com/opengeospatial/geoedge-plugfest/issues/1

Import vector data: ogr2ogr -f GPKG PR.gpkg PR_GGDM_3_0_Profile_File_Geodatabase.gdb

Merge raster data: gdal_merge.py -o MergedOuputFile.tif T19QFA_20171209T150709_TCI.jp2 T19QFV_20161219T150712_TCI.jp2 T19QGA_20171209T150709_TCI.jp2 T19QGV_20171209T150709_TCI.jp2 T19QHA_20171209T150709_TCI.jp2 T19QHV_20171209T150709_TCI.jp2

Import merged data: gdal_translate -of GPKG MergedOuputFile.tif -co APPEND_SUBDATASET=YES -co RASTER_TABLE=PR_SATELLITE_IMAGERY -co TILING_SCHEME=InspireCRS84Quad PR.gpkg

Create zoom levels: gdaladdo -oo TABLE=PR_SATELLITE_IMAGERY PR.gpkg 2 4 8 16 32 64 128 256 512 1024 2048

Run Even Rouault's validate_gpkg.py https://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/validate_gpkg.py ./validate_gpkg.py PR.gpkg # no errors

Drag PR.gpkg into QGIS: Add all vector layers through Layer->Add Layer->Add Vector Layer Notice good pan and zoom behavior and no errors.

Launch NSG GeoPackage - 2.1 ETS, docker version. These tests fail:

extension Index Implementation: The update trigger 3 RTree index definition for table ADMINISTRATIVE_SUBDIVISION_S is invalid.
N S G_ Data Validity NSG Req 19-A: The gpkg_spatial_ref_sys table contains invalid desciptions for IDs: 4326
N S G_ Data Validity NSG Req 19-D: The gpkg_tile_matrix contains an invalid zoom_level: 0 for PR_SATELLITE_IMAGERY, should be between 2 and 13
N S G_ CRSdefinitions Test: java.lang.ClassCastException: org.geotoolkit.referencing.factory.ReferencingObjectFactory cannot be cast to org.opengis.referencing.Factory
N S G_ Data Validity: java.sql.SQLException:
[SQLITE_ERROR] SQL error or missing database (no such function: ST_MinX)

I was able to fix the 19-A error manually:

sqlite3 PR.gpkg sqlite> UPDATE gpkg_spatial_ref_sys SET srs_name='WGS 84 Geographic 2D' WHERE srs_id=4326; sqlite> UPDATE gpkg_spatial_ref_sys SET definition='GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS84",6378137,298.257223563,]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]' WHERE srs_id=4326; sqlite> UPDATE gpkg_spatial_ref_sys SET description='Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying.' WHERE srs_id=4326;

dstenger commented 6 years ago

Regarding the SQLITE_ERROR please take a look at #10.

dstenger commented 6 years ago

Can you please add the GeoPackage file you used for testing to this issue?

Then, we can take a look at the other failed tests.

gramnation commented 6 years ago

https://drive.google.com/file/d/1AlT1_1ohbrlH85j2rivMvracouZ4KfAD/view?usp=sharing

dstenger commented 6 years ago

I used Docker environment with TEAM Engine 5.3 and test suite version 0.3 for testing.

So far, three errors are still existing.

dstenger commented 6 years ago

@gramnation Does this answer all of your questions?

dstenger commented 6 years ago

Regarding N S G_ Data Validity: #12 is fixed in current master branch but the test is still failing. It seems that the CRS definition is invalid.

gramnation commented 6 years ago

Why does ETS require gpkg_tile_matrix zoom_level "between 2 and 13"?

Req 45 of GeoPackage standard: "The gpkg_tile_matrix table MAY contain row records for zoom levels in a tile pyramid user data table that do not contain tiles."

Req 19-12 of NGA standard puts constraints on gpkg_tile_matrix zoom_level "0 <= zoom_level <= max_level", not "min_level <= zoom_level <= max_level"

dstenger commented 6 years ago

The status is that gpkg_tile_matrix contains zoom level 0 - 13 and PR_SATELLITE_IMAGERY just contains zoom level 2 -13. Thus, zoom level 0 is missing in PR_SATELLITE_IMAGERY.

But, I agree that this is not a requirement in specification. Thus, I created a bug issue for that: #22