Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature tests handling almost all of the geometry blob information #62

Merged
merged 1 commit into from Jun 22, 2018

Conversation

ajanett
Copy link
Contributor

@ajanett ajanett commented May 31, 2018

featureSRSconsistency - Test extending 13 which is currently only looking at table definitions, but if one inspects the standard, there are additional tests such as inconsistencies between srs_id that need to be examined. The feature portion of this test has been added to check for inconsistencies between the geopackage contents, the geopackage geometry columns, and the set of srs_id and feature tables.

getFeaturesWithGeometryInfo - Iterator for processing feature geometry tests. This iterator performs the baseline query needed for all feature geometry tests, gathering the gpkg_geometry_columns values that will be checked for consistency against the geometry blob content in each feature. By processing these tests with the iterator, we can check for errors in each feature table and not just quit at the very first error found.

featureGeometryEncodingTesting – Called by the iterator for each feature table, this test function performs all testing against the geometry blob for each row of the feature table. In order to maintain some processing performance, all of these tests have to be done here rather than re-process the blob for each test separately. The tests do attempt to re-use previously identified data. Each test performed within this group provides a detailed response if an issue is found. Reviewing the tests in here:
19 i Looks for the correct magic number
19 ii Looks for the correct version number
19 iii Verifies the binary type
19 iv Verifies the correct envelope flag values
33 Verifies the srs_id. This test also will check for byte swap errors within the srs_id, hence by putting the test before 19 v, it will catch potential byte swap errors that may affect retrieval of the envelope.
19 v If the geometry is empty but the envelope is not empty, triggers an error
20 Verifies the geometry type from within the WKB. This test also will check for possible byte swap errors within the WKB.
32 Checks if the WKB geometry type (subtype) is allowed based on the geometry type provided by gpkg_geometry_columns.
66 Partial – included only a check on the WKB item count value (when applicable) at this time. WKB processing is going to suck down a huge amount of processing time!
67 Check for gpkg_extensions for gpkg_geom_ for the feature (when there are extensions).
NSG 19B Ensure the geopackage extents from gpkg_geometry_columns contains the feature envelope.
78 Verify that the rtree trigger accurately contains the feature envelope when there are rtree extensions

featureGeometryColumnsDataValuesTableNameNEW – Added because it does not appear that the existing tests for 23 and 26 are compliant with OGC 12-128r14.

Also:
Clean up of escaped single quotes in SQL statements.

featureSRSconsistency - Test extending 13 which is currently only looking at table definitions, but if one inspects the standard, there are additional tests such as inconsistencies between srs_id that need to be examined.  The feature portion of this test has been added to check for inconsistencies between the geopackage contents, the geopackage geometry columns, and the set of srs_id and feature tables.

getFeaturesWithGeometryInfo - Iterator for processing feature geometry tests. This iterator performs the baseline query needed for all feature geometry tests, gathering the gpkg_geometry_columns values that will be checked for consistency against the geometry blob content in each feature.  By processing these tests with the iterator, we can check for errors in each feature table and not just quit at the very first error found.

featureGeometryEncodingTesting – Called by the iterator for each feature table, this test function performs all testing against the geometry blob for each row of the feature table. In order to maintain some processing performance, all of these tests have to be done here rather than re-process the blob for each test separately. The tests do attempt to re-use previously identified data. Each test performed within this group provides a detailed response if an issue is found. Reviewing the tests in here:
19 i   Looks for the correct magic number
19 ii  Looks for the correct version number
19 iii Verifies the binary type
19 iv  Verifies the correct envelope flag values
33     Verifies the srs_id. This test also will check for byte swap errors within the srs_id, hence by putting the test before 19 v, it will catch potential byte swap errors that may affect retrieval of the envelope.
19 v   If the geometry is empty but the envelope is not empty, triggers an error
20     Verifies the geometry type from within the WKB. This test also will check for possible byte swap errors within the WKB.
32	Checks if the WKB geometry type (subtype) is allowed based on the geometry type provided by gpkg_geometry_columns.
66	Partial – included only a check on the WKB item count value (when applicable) at this time. WKB processing is going to suck down a huge amount of processing time!
67	Check for gpkg_extensions for gpkg_geom_<feature> for the feature (when there are extensions).
NSG 19B Ensure the geopackage extents from gpkg_geometry_columns contains the feature envelope.
78	Verify that the rtree trigger accurately contains the feature envelope when there are rtree extensions

featureGeometryColumnsDataValuesTableNameNEW – Added because it does not appear that the existing tests for 23 and 26 are compliant with OGC 12-128r14.


Also:
Clean up of escaped single quotes in SQL statements.
@ajanett
Copy link
Contributor Author

ajanett commented May 31, 2018

These code changes may fail to pass the current tests as the current test geopackage(s) may have some issues that these new tests are detecting. For instance, feature-0.gpkg extents does not contain the envelope of the geometry specified by feature 0. The attached feature-0_FIXED.gpkg has updated extents and does not exhibit the issue.
features-0_FIXED.zip

@ajanett
Copy link
Contributor Author

ajanett commented May 31, 2018

Test GeoPackages with failure and pass conditions for these code updates are provided here.
testCases.zip

@bermud
Copy link
Contributor

bermud commented May 31, 2018

@ajanett, thank you for this pull request! Can you please cross reference (mentioned) any issues that are currently opened?
@jyutzler , @dstenger, I suggest to include the test cases and test files as part of the code structure. Any change that we do in the future can be verified against these test cases.

@ajanett
Copy link
Contributor Author

ajanett commented May 31, 2018

This pull request addresses issue #60

It also addressed the geopackage ETS code for: geopackage/issues/443, 442, and the feature portion of 444
opengeospatial/geopackage#443
opengeospatial/geopackage#442
opengeospatial/geopackage#444

@ajanett
Copy link
Contributor Author

ajanett commented May 31, 2018

This pull request also addresses opengeospatial/ets-gpkg12-nsg#10
in part as the nsg geopackage functionality is to be removed and it is instead handled here.

@dstenger
Copy link
Contributor

@jyutzler Can you confirm that failure documented in #62 (comment) is correct?

@ajanett Test files provided in #62 (comment) are not integrated in tests, right? Can we integrate those test files to tests of test suite?

@ajanett
Copy link
Contributor Author

ajanett commented Jun 18, 2018

@jyutzler Yes, The OGC team may use any of the test files provided in this thread. You are correct in that I have not integrated the tests and you may certainly do that. I've been seeing many GeoPackages that have extents of insufficient size to cover the GeoPackage content, and this failure is one of them. For this correction, I simply adjusted the SQL extents sufficiently to represent the feature content.

@dstenger
Copy link
Contributor

@jyutzler
This pull request modifies several existing tests.
Can you please review those changes and confirm if they are OK from your side of view?

@jyutzler
Copy link
Contributor

This is bubbling up to the top of my priorities list.

@jyutzler jyutzler mentioned this pull request Jun 22, 2018
@jyutzler jyutzler merged commit acbf3c5 into opengeospatial:master Jun 22, 2018
@ajanett ajanett deleted the Feature_Geometry_Tests branch June 22, 2018 16:22
@ajanett
Copy link
Contributor Author

ajanett commented Jun 22, 2018

@jyutzler Thanks, I'll go pull from the mainline.

@lgoltz lgoltz added this to the 0.7 milestone Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants