bdq
bdq copied to clipboard
TG2-VALIDATION_COORDINATESCOUNTRYCODE_CONSISTENT
| TestField | Value |
|---|---|
| GUID | adb27d29-9f0d-4d52-b760-a77ba57a69c9 |
| Label | VALIDATION_COORDINATESCOUNTRYCODE_CONSISTENT |
| Description | Do the geographic coordinates fall on or within the boundaries of the territory given in dwc:countryCode or its Exclusive Economic Zone? |
| TestType | Validation |
| Darwin Core Class | dcterms:Location |
| Information Elements ActedUpon | dwc:countryCode |
| dwc:decimalLatitude | |
| dwc:decimalLongitude | |
| Information Elements Consulted | |
| Expected Response | EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are bdq:Empty or invalid; COMPLIANT if the geographic coordinates fall on or within the boundary defined by the union of the boundary of the country from dwc:countryCode plus it's Exclusive Economic Zone as found in the bdq:sourceAuthority, if any, plus an exterior buffer given by bdq:spatialBufferInMeters; otherwise NOT_COMPLIANT |
| Data Quality Dimension | Consistency |
| Term-Actions | COORDINATESCOUNTRYCODE_CONSISTENT |
| Parameter(s) | bdq:sourceAuthority |
| bdq:spatialBufferInMeters | |
| Source Authority | bdq:sourceAuthority default = "10m-admin-1 boundaries UNION with Exclusive Economic Zones" {[https://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/] spatial UNION [https://www.marineregions.org/downloads.php#marbound]} |
| bdq:spatialBufferInMeters default = "3000" | |
| Specification Last Updated | 2024-08-30 |
| Examples | [dwc:countryCode="AR", dwc:decimalLatitude="-41.0525925872862", dwc:decimalLongitude="-71.5310546742521": Response.status=RUN_HAS_RESULT, Response.result=COMPLIANT, Response.comment="Coordinates match dwc:countryCode"] |
| [dwc:countryCode="CL", dwc:decimalLatitude="-41.0525925872862", dwc:decimalLongitude="-71.5310546742521": Response.status=RUN_HAS_RESULT, Response.result=NOT_COMPLIANT, Response.comment="Coordinates are in Argentina, not Chile"] | |
| [dwc:countryCode="ZX", dwc:decimalLatitude="-41.0525925872862", dwc:decimalLongitude="-71.5310546742521": Response.status=INTERNAL_PREREQUISTES_NOT_MET, Response.comment="Input field contains invalid values - ZX is not a valid ISO 3166-1-alpha-2 country code"] | |
| Source | ALA, GBIF, iDigBio |
| References |
|
| Example Implementations (Mechanisms) | Kurator:geo_ref_qc |
| Link to Specification Source Code | https://github.com/FilteredPush/geo_ref_qc/blob/master/src/main/java/org/filteredpush/qc/georeference/DwCGeoRefDQ.java#L80 |
| Notes | dwc:coordinatePrecicision and dwc:coordinateUncertaintyInMeters (if present) imply a potential displacement of the provided coordinates. These two terms can be considered spatial buffers. Likewise, country polygons cannot be 100% accurate at all scales (Dooley 2005), so a spatial buffer of the country boundaries is justified. When dwc:countryCode=XZ (for High Seas), the coordinate should fall into a marine region out side of the EEZ of any country. Taking the spatial buffers into account does however greatly complicate both the logic and the implementation of such tests. The same applies to potential conversion of the Spatial Reference System (SRS) of dwc:decimalLatitude and dwc:decimalLongitude to the SRS used in the bdq:sourceAuthority. |
Comment by Paula Zermoglio (@pzermoglio) migrated from spreadsheet: Given that the country was not inferred from the coordinates to begin with.
Comment by Paul Morris (@chicoreus) migrated from spreadsheet: @PZ: again think of a sequence of pre-amendment, amendment, and post-amendment. The expectation in the case you describe in the pre-amememennt phase is that this valiation would return a result status of INTERNAL_PREREQUISITES_NOT_MET (no value of country to compare with coordinates), and that in the post-amendment phase would return the result of COMPLIANT
Comment by Paula Zermoglio (@pzermoglio) migrated from spreadsheet: Get it. Will we then define different profiles for pre- and post-? and sth like a route-plan? I think that's what's maybe missing for me, a graphical schema relating the tests over time, with multiple arrows showing what's next if pass or fail.
@tucotuco Why aren't we citing (ISO 3166-1-alpha-2 country codes) in this test like we have #48 - rather than say a specified target source authority?
@ArthurChapman No good reason I can think of. ISO 3166-alpha-2 seems exactly right to me.
OK - I will fix to be consistent with #48
@Tasilee is correct - we probably need to add the 3km buffer here in this one and add a note similar to #73.
INTERNAL_PREREQUISITES_NOT_MET if dwc:decimalLatitude, dwc:decimalLongitude, and dwc:countryCode are EMPTY;
should be if any of are empty, e.g.
"INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY;"
"INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or contain values that cannot be interpreted;"
I suggest the Description:
'Do the geographic coordinates fall on or within the boundaries of the territory given in dwc:countryCode or its Exclusive Economic Zone?'
in place of:
'Do the geographic coordinates fall on or within the boundaries of the country (from dwc:countryCode ) plus its Exclusive Economic Zone?'
I am working through the test data and wondering if we need something more explicit (and consistent across tests) with the "interpreted" bit in the Expected Response:
INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or contain values that cannot be interpreted;
Should this be something more like
INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or contain values that cannot be interpreted as a valid numeric value;
?
@Tasilee To me that wording suggests that dwc:countryCode should be a numerical value. How about,
"INTERNAL_PREREQUISITES_NOT_MET if one or more of the values of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or invalid."
I like that wording. If we agree to this, it will propagate to many other Expected Responses 🙄
See my comment of 14 February 2023 under test #56
I like @tucotuco 's use of "invalid" and given related discussions (no anomalies) about redundancy of checks for invalidity or similar, I have edited the Expected Response. We will need to check all Expected Responses accordingly.
As in #56, I think this one where a third example would be valuable - i.e. where countryCode in invalid which creates a response of "Response.status=INTERNAL_PREREQUISTES_NOT_MET, Response.comment="Input field contain invalid values""
e.g.
[dwc:countryCode="ZX", dwc:decimalLatitude="-41.0525925872862", dwc:decimalLongitude="-71.5310546742521": Response.status=INTERNAL_PREREQUISTES_NOT_MET, Response.comment="Input field contain invalid values - ZX is not a valid country code"]
@ArthurChapman I agree, except I would be more explicit and say "- ZX is not a valid ISO 3166-1-alpha-2 country code".
Agree @Tasilee
Edited accordingly, with typo fix.
Restructured Parameter(s) and Source authority entries
@tasilee @chicoreus We don't mention bdq:sourceAuthority in the Expected Response although we do in the Description and Parameter(s) - do we need to fix Expected Response or delete reference to the bdq:sourceAuthority
Should Expected Response read
EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or invalid; COMPLIANT if the geographic coordinates fall on or within the boundary defined by the union of the boundary of the country from dwc:countryCode plus it's Exclusive Economic Zone as defined by the bdq:sourceAuthority, if any, plus an exterior buffer given by bdq:spatialBufferInMeters; otherwise NOT_COMPLIANT
@ArthurChapman That sounds almost right, but as marineregions.org doesn't actually define the EEZ regions, but provides a shapefile describing them, we should probably use slightly different language:
EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if one or more of dwc:decimalLatitude, dwc:decimalLongitude, or dwc:countryCode are EMPTY or invalid; COMPLIANT if the geographic coordinates fall on or within the boundary defined by the union of the boundary of the country from dwc:countryCode plus it's Exclusive Economic Zone as found in the bdq:sourceAuthority, if any, plus an exterior buffer given by bdq:spatialBufferInMeters; otherwise NOT_COMPLIANT
Updated Expected Response as per last comment and updated Specification Last Updated
Post Zoom 11/7/2023, I have aligned the Source Authority with the suggested syntax:
bdq:sourceAuthority default = "ADM1 boundaries" {[https://gadm.org] spatial UNION with "Exclusive Economic Zones" [https://marineregions.org]}
Since the sourceAuthority is a single parameter, not two, we need a single text string value as the default.
Something along the line of:
bdq:sourceAuthority default = "ADM1 boundaries UNION EEZ" {[https://gadm.org] spatial UNION [https://marineregions.org]}
Sounds logical to me @chicoreus. How would you render it @tucotuco ? I think there is another one like this somewhere...and I'll chase that down next.
No matter the rendering, it will have to be explained. The suggestion by @chicoreus seems complete and logically consistent to me.
The Source Authority issue seems to have been addressed.