-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from planetlabs/no-geometry
Allow empty and null geometries in validation
- Loading branch information
Showing
9 changed files
with
404 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
internal/validator/testdata/with-empty-geometry/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"checks": [ | ||
{ | ||
"title": "file must include a \"geo\" metadata key", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "metadata must be a JSON object", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "metadata must include a \"version\" string", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "metadata must include a \"primary_column\" string", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "metadata must include a \"columns\" object", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "column metadata must include the \"primary_column\" name", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "column metadata must include a valid \"encoding\" string", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "column metadata must include a \"geometry_types\" list", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "optional \"crs\" must be null or a PROJJSON object", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "optional \"orientation\" must be a valid string", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "optional \"edges\" must be a valid string", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "optional \"bbox\" must be an array of 4 or 6 numbers", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "optional \"epoch\" must be a number", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "geometry columns must not be grouped", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "geometry columns must be stored using the BYTE_ARRAY parquet type", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "geometry columns must be required or optional, not repeated", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "all geometry values match the \"encoding\" metadata", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "all geometry types must be included in the \"geometry_types\" metadata (if not empty)", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "all polygon geometries must follow the \"orientation\" metadata (if present)", | ||
"run": true, | ||
"passed": true | ||
}, | ||
{ | ||
"title": "all geometries must fall within the \"bbox\" metadata (if present)", | ||
"run": true, | ||
"passed": true | ||
} | ||
], | ||
"metadataOnly": false | ||
} |
37 changes: 37 additions & 0 deletions
37
internal/validator/testdata/with-empty-geometry/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"metadata": { | ||
"version": "1.0.0", | ||
"primary_column": "geometry", | ||
"columns": { | ||
"geometry": { | ||
"encoding": "WKB", | ||
"geometry_types": ["Point"] | ||
} | ||
} | ||
}, | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"name": "with geometry" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [0, 0] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"name": "empty geometry" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [] | ||
} | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.