gbif / portal16

GBIF.org website
https://www.gbif.org
Apache License 2.0
24 stars 15 forks source link

Occurrence cube downloads #1978

Open MortenHofft opened 3 weeks ago

MortenHofft commented 3 weeks ago

ping @peterdesmet and @MattBlissett

I've started the work of adding a new download option

And an SQL ui%20OVER%20(PARTITION%20BY%20kingdomKey))%20AS%20kingdomCount,%0A%20%20COUNT(*)%20AS%20occurrences,%20MIN(GBIF_TemporalUncertainty(eventDate))%20AS%20minTemporalUncertainty,%20MIN(COALESCE(coordinateUncertaintyInMeters,%201000))%20AS%20minCoordinateUncertaintyInMeters%0AFROM%0A%20%20occurrence%0AWHERE%20%0A%20%20%22year%22%20%3E%202000%0AGROUP%20BY%0A%20%20taxonRank,%20taxonomicStatus,%20kingdom,%20kingdomKey,%20phylum,%20phylumKey,%20%22year%22) for downloads

Could you please help evaluate if this is functionally what you had in mind? Functionally there are 2 things that aren't working

If the functions are as you expected, then we could think about usability (bearing in mind that we will have to reimplement this in the recent future)

peterdesmet commented 2 weeks ago

Nice!! Here's some feedback on the download page (did not test the SQL editor yet):

Global
- Military grid reference systems (MGRS)
- Extended quarter degree grid (QDGC)
- ISEA3H grid
Europe
- EEA reference grid

The easiest way to download and explore data is via the occurrence search user interface. But for complex queries and aggregations, then the SQL editor provides more freedom.

MortenHofft commented 2 weeks ago

Thanks @peterdesmet

On the SQL editor, I would include the link to the occurrence search in the text, rather than a button:

I agree it is nicer, it is only because it is makes life easier for translators. Having them write markdown with variables have caused issues in the past.

MortenHofft commented 2 weeks ago

The values for Spatial resolution should probably be updated slightly. For one, I think that the spatial resolution for MGRS is in meters.

Yeah I know those are wrong. I'm waiting for you or Matt to tell me what they should be please. I've changed the MGRS as you specified above

EXTENDED_QUARTER_DEGREE_GRID should be? ISEA3H_GRID should be?

MortenHofft commented 2 weeks ago

I've added mock help texts to all fields and added 2 mock articles (one for sql download and one for cubes).

Help texts If someone with better english skills and understanding can correct the help texts that would be great. Alternatively I can also try my best, it is just a type of thing that takes me forever. If you believe some fields are self explanatory, then let me know and I can remove the help text.

Articles For the articles: then someone needs to write them if we still want them. https://www.gbif-uat.org/occurrence-cubes https://www.gbif-uat.org/occurrence/download/sql#about

Known API bugs

Download pages Arriving at a download page is confusing if you come from a cube download format. You configured a cube via a UI, and then arrive at an SQL string. It is a requirement to display this better. One way about it could be to add a new feature to downloads generally.

That is just one idea. Other ideas for how to make the transition easier for users are welcome

Other

timrobertson100 commented 2 weeks ago

Thanks. I think the text helps in guiding the user.

I think adding the ability to give it a human readable type / description would be good. Alternatively, we could introduce a cube download format in the API itself, which takes the form parameters but does the SQL conversion behind the backend API. The reason to do that, would be to display to the parameters used on the download page which is shown from the DOI. A user could still "open this in the SQL builder" before submitting to do more complicated queries, but it'd hide SQL completely for anyone who didn't. I don't know what would be the more scalable option.