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

sql downloads - some mgrs codes appear to not be returned #348

Open
jhnwllr opened this issue May 7, 2024 · 2 comments
Open

sql downloads - some mgrs codes appear to not be returned #348

jhnwllr opened this issue May 7, 2024 · 2 comments

Comments

@jhnwllr
Copy link

jhnwllr commented May 7, 2024

@MattBlissett
It seems like certain bands of MGRS ids are not returned.

https://www.gbif.org/occurrence/download/0017153-240425142415019

plot

Here is a sample of ids that were not found in the download but should seemingly be present unless I have misinterpreted something...

01CCA
01CDA
01CEA
01CFA
01CCV
01CDV
01CEV
01CFV
01CDU
01CEU
01CDT
01CET
01CDS
01CES
01CDR
01CER
01CDQ
01CEQ
01CDP
01CEP
01CDN
01CEN
01CDM
01CEM
01DCK
01DDK
01DEK
01DFK
01DCJ
01DDJ
01DEJ
01DFJ
01DCH
01DDH
01DEH
01DFH
01DCG
01DDG
01DEG
01DFG
01DCF
01DDF
01DEF
01DFF
01DCE
01DDE
SELECT 
  GBIF_MGRSCode(
    100000,  
    decimalLatitude,
    decimalLongitude,
    COALESCE(coordinateUncertaintyInMeters, 0) 
  ) AS mgrs,
  COUNT(DISTINCT speciesKey) AS unique_species_count
FROM
  occurrence
GROUP BY
  mgrs
@MattBlissett
Copy link
Member

I think some of the smallest values like 01CCA are invalid, see image where the grid starts at D for -180°.

Zones 1-9 are currently formatted without a leading zero. I can't see an official specification, but if it's this then I should add that zero.

I haven't looked at what's happening in Australia.

Note you should filter for coordinateUncertaintyInMeters being reasonable, there are some extremely large values. (We should probably add a geospatial issue for very large values in this field.)

@MattBlissett
Copy link
Member

Zones under 10 are now output with a leading 0.

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

No branches or pull requests

2 participants