der-stefan / OpenTopoMap

A topographic map from OpenStreetMap and SRTM data
https://opentopomap.org
Other
463 stars 118 forks source link

Apostrophe notation for elevations in feet #363

Open 1ec5 opened 4 months ago

1ec5 commented 4 months ago

checkele() currently recognizes ft as the notation for feet within ele=*, converting it to meters:

https://github.com/der-stefan/OpenTopoMap/blob/e4467cfc2064afc379b0f8e8360db1740099cca3/mapnik/tools/isolation.c#L65 https://github.com/der-stefan/OpenTopoMap/blob/e4467cfc2064afc379b0f8e8360db1740099cca3/mapnik/tools/isolation.c#L78

There is another notation for feet, ' (ASCII apostrophe), that is 40 times more common on length-related keys in general (including common keys such as height=*). The “Units” page on the wiki encourages the ##'##" notation and strongly discourages ft or in.

On the other hand, the ele=* documentation currently discourages unit specifications altogether. Despite this longstanding guideline, several major data consumers support both ft and ' for specifying elevations in feet. This proposal would codify that option for mappers. It doesn’t prefer one notation over the other, but perhaps you might consider adding support for ' for completeness.