country-coder
country-coder copied to clipboard
More data
Let's brainstorm here on what other data we want to include for each country. Would be great to remove some of these datasets from iD.
- Drive Left/Right
- Units Imperial/Metric
- Telephone Code
- Address Format (maybe too hard)
We could support country TLDs pretty easily since they mostly map to ISO codes. We would just have to note the exceptions.
Another thing I ran into with the community index conversion..
It would be useful to have an "area" property. We use this in downstream projects to sort the features, and it would be nice to have it in the data so consumers don't need to calculate it. I know that these are very rough polygons and so the area is not very accurate, but for relative size it works ok.
In community index, the area is calculated like this:
const calcArea = require('@mapbox/geojson-area');
...
// calculate area and set a property for it
let props = feature.properties || {};
let area = calcArea.geometry(feature.geometry) / 1e6; // mΒ² to kmΒ²
props.area = Number(area.toFixed(2));
(the conversion and rounding is just to make the numbers more human readable - it's not really important)
@bhousel Area sounds useful. Might be best to just include the official areas from Wikidata or whatnot since some of the island features have enormously distorted shapes.
A random assortment:
- Spoken/official languages β for the multilingual name fields and label fallbacks, but this might require more granular geocoding
- Official currencies β for the payment fields
- Dominant road sign standard (Vienna Convention, MUTCD, SADC-RTSM) β would make it easier to come up with more intuitive icons for some presets
- Maximum speed limit β for validating (catching usage of the wrong unit) and omitting invalid suggestions
- Phone number format(s) β maybe for validating the
phone
andfax
fields or just generating placeholder text for them - Dominant railway track gauge
- Popular social media sites β for enabling contact fields but not obscure ones
One thing to keep in mind is that weβre potentially reinventing the wheel with some of this data. Traffic speed units are provided by CLDR, though CLDR happens to be less accurate than country-coder in this case. (CLDR is a gold mine of internationalization data, so definitely take a look at it for inspiration.)