Towards a short URL
Since the first year of operation with Openstreetmap in 2009, the OSM.ORG is used as a short alias for OPENSTREETMAP.ORG, redirecting to it.
... But for short reference to a map feature is not the shortest: we can reduce "/relation" to "/r", "/node" to "/n" and "/way" to "/w". For instance,
is 20 characters shorter than
And we can do better: instead to express the element ID as a decimal number, we can compact it expressing as a base-36 or base-58 number. Using base36, for instance, the decimal "298285" will be 30% shorter, "6E5P", and better to spell or audit by humans.
PS: the biggest possible ID, "9223372036854775807" is "1Y2P0IJ32E8E7" in base-36.
For other uses and advantages see short URL article.
Base36 prefix proposal
$1is a upper-case base36-digit representing the namespace selector;
$2is the catalog mode indicator;
$3is the identifier of an entity in the selected namespace.
- Note: there are no need for "reserved words" as "NODE", "COPYRIGHT", etc. because all has lower-case first-letter names: /copyright, /export, /node, etc. The traditional redirection, in use since 2009, is preserved.
General syntax options as URL-templates:
- The "root", redirects to the root of http://openstreetmap.org
- A "catalog" interface for all namespaces. To show metadata about the intention of the redirectin, to debug or check metadata. Can be a redirecion to something as
- The first-character-controled redirections. Can be a redirecion to something as
- ... the 36 possible namespace options ...
- For instance namespaces "N" for nodes, "R" for relations, "G" for Geohash, etc. all simple and fast redirections, each one with its namespace conventions.
Below all template URLs organized by upper-case letter namespace.
N R W mode
The "n, r or w" namespace, for OSM's elements (node, relation or way) and its 64-bit identifier represented in base36, for short URLs.
- A compact expresion, starting by the first letter of the
eleType("n","r" or "w"), and followed by the ID, a positive 64-bit integer expressed in base36. Redirects as the traditional URL expanding ID to a decimal
decID, "/node/decID", "/way/decID" and "/relation/decID".
The Wikidata "Q-ID" used by elements with the key:wikidata.
- The letter "Q" (same as "q") can be reserved for Wikidata value (the eternal "Q" ID) redirection, as specifyed by Permanent ID/Proposal-QID.
Other for illustration, no relevance or discussion at now.
Short URLs to redirect to main https://taginfo.openstreetmap.org statistical uses. Examples: