opengeospatial / ets-gpkg12-nsg

Other
2 stars 5 forks source link

Lack of metadata results in SQLITE ERROR hard failure #36

Closed ajanett closed 6 years ago

ajanett commented 6 years ago

MetadataTest.java, line 41, 42 try (final Statement statement = this.databaseConnection.createStatement(); final ResultSet resultSet = statement.executeQuery( "SELECT metadata FROM gpkg_metadata;" ))

The code is currently not allowing geopackages that do not have metadata and throws a SQLITE_ERROR stating that gpkg_metadata is not present, and in fact it is not present in the test case that was used.

However, a) shouldn't this code base allow for geopackages having no metadata, and skip those tests? b) if, indeed the non-presence of gpkg_metadata is considered to be a 'failure', it should be reported as an actual failure and not a SQLITE_ERROR.

dstenger commented 6 years ago

Thank you for reporting. We will do further investigation.

ajanett commented 6 years ago

I can correct this such that the tests will be skipped if the gpkg_metadata table is not present.

lgoltz commented 6 years ago

@ajanett Can you provide a GeoPackage for testing the fix?

ajanett commented 6 years ago

See test geoPackages in ets-gpkg12, several of them are vector-only geopackages and had no metadata table and would trigger this error.

lgoltz commented 6 years ago

Requirement 93 in GeoPackage 1.2 says that "A GeoPackage A GeoPackage MAY contain a table named gpkg_metadata. " and I don't see that the table becomes mandatory in NSG.

So. I think the test should be skipped if the table is not available. In PR https://github.com/opengeospatial/ets-gpkg12-nsg/pull/40 the test is successful if the table is missing. I think a SkipException should be in thrown in case the table is not available.

jyutzler commented 6 years ago

FWIW Is the NSG Profile based on GPKG 1.1 or 1.2? In this case the requirements are identical, just checking.

ajanett commented 6 years ago

The NSG profile references: "OpenGIS® GeoPackage Encoding Standard, Version: 1.1, Reference number of this document: OGC 12-128r12, Date: 2015-08-04". However, the actual ETS code implementation is dependent on GPKG 1.2. So there is a bit of a disconnect there. It is important to note that the GPGK 1.2 has corrected errors in 1.1 and these are also important corrections for NSG. If the NSG GPKG tests were changed to depend on GPKG 1.1, it would be missing so many tests that it would not be worth much. Ultimately, the NSG standard does need to be updated for this.

jyutzler commented 6 years ago

There is code in the 1.2 ETS to check for GeoPackage version and adjust the tests accordingly. There aren't that many changes between 1.1 and 1.2. (There are some.) Still, let's be accurate on how we word this stuff.