GEO-BON / bon-in-a-box-pipelines

BON in a Box 2.0 - Sampling optimisation and indicator pipelines
Other
12 stars 7 forks source link

Make dropdown menu with searchable country names #202

Open JoryGriffith opened 2 days ago

JoryGriffith commented 2 days ago

It would be great to have a drop down menu with searchable country names because it is too easy to miswrite.

jmlord commented 2 days ago

This is absolutely necessary! Current workaround is to use the markdown feature in the input description to link to the list of acceptable values.

Proposed solution 1:

Proposed solution 2:

@glaroc, thoughts?

tpoisot commented 2 days ago

What about using GADM? They have a curated collection of territories and their subdivisions.

(and using the word "Country" may be debatable as well, not everyone agrees on what a country is...)

glaroc commented 2 days ago

The complicated part is the dependent dropdowns. For example, the choice of states/provinces has to depend on the choice of country. For the dependent dropdown, we could have something like

options_country:
  label: Country selector
  description: Choice of countries
  type: options
  options: http://site.com/api/countryList
  example: Colombia
options_province:
  label: State/province selectore
  description: Choice of state/province
  type: options_dependence 
  options: http://site.com/api/provinceList/{options_country}
  example: Putomayo
gottacatchenall commented 2 days ago

Quickest fix here is probably to query everything in GADM once and make a static JSON of the regions/subregions/subsubregions hierarchy

glaroc commented 2 days ago

We have these endpoints already here: https://geoio.biodiversite-quebec.ca/country_list and https://geoio.biodiversite-quebec.ca/state_list?country_name=Colombia

gottacatchenall commented 2 days ago

(and using the word "Country" may be debatable as well, not everyone agrees on what a country is...)

Huge agree here. These are things that should be addressed at a higher level of governance within GEO-BON, but the choices we make here could absolutely impact the reception of this platform by national policy makers, e.g. the decision to include Taiwan in the country list above.

glaroc commented 2 days ago

We obviously won't be the ones making those decisions. We could use the same country list the CBD/UN uses. Or change the title to Country/Territory

tpoisot commented 2 days ago

We could use the same country list the CBD/UN uses. Or change the title to Country/Territory

Agreed, and I think that's a decision for which we can ask advice from GEOBON leadership. Happy to bring it up on discourse for the IC.

jmlord commented 2 days ago

We have these endpoints already here: https://geoio.biodiversite-quebec.ca/country_list and https://geoio.biodiversite-quebec.ca/state_list?country_name=Colombia

Bare minimum, these should be linked in the description of the scripts referring to this country list while we find a more permanent solution.

As for the debate on what a country is, I'd gladly wash my hands of it and refer to some international authority... as long as they provide the polygons along with the region names!