SpaceApi / schema

SpaceAPI JSON schema files.
24 stars 14 forks source link

Country code #74

Closed dbrgn closed 2 months ago

dbrgn commented 4 years ago

Sometimes seeing the country code of a space might be useful. For example:

Downsides:

Any opinions on adding an optional ISO 3166 ALPHA-2 country code to the "location" field in the schema? Useful? Redundant and useless? A symptom of conservative nationalistic opressive patriarchy?

dbrgn commented 2 months ago

A note regarding alpha-2 vs alpha-3: ISO-3166 recommends alpha-2 as the general-purpose code. https://www.iso.org/iso-3166-country-codes.html

s3lph commented 2 months ago

I don't really see a use case for it. All the scenarios you describe are "human user consumes the country code", which IMO is already covered by the address field, where the large majority of endpoints already put the country.

dbrgn commented 2 months ago

This can also be done using the coordinates, but requires a geo-database to do a reverse lookup with a "contained-inside-boundary" check, which isn't trivial.

One could argue that countries should't matter, and that distance around a point should be used instead to find nearby spaces. But sometimes I know that "I'll visit the Czech Republic in 2 months and would like to see what spaces there are in that country" without having to do find out the centerpoint coordinates of the country and doing a proximity query.

Some spaces do include the country in the address, but not all of them do, and it's not really machine readable without lots of ugly heuristics.