Talk:Osm.org
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,
http //osm.org/r/298285
is 20 characters shorter than
http://www.openstreetmap.org/relation/298285.
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
This is a first step to discuss and to polish the proposal. A general syntax and implementation architecture to express short URLs with the OSM.ORG
domain. General syntax as regular expression:
^http://osm\.org/([A-Z0-9])(/)?(.+)$
where
$1
is a upper-case base36-digit representing the namespace selector;$2
is the catalog mode indicator;$3
is 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:
http://osm.org
- The "root", redirects to the root of http://openstreetmap.org
http://osm.org/{namespace}/{name}
- 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
http://api.osm.org/catalog?ns={namespace}&id={name}
.
http://osm.org/{namespace}{name}
- The first-character-controled redirections. Can be a redirecion to something as
http://api.osm.org/?ns={namespace}&id={name}
.
- ... 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.
http://osm.org/{eleType}{ID_base36}
- 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 decimaldecID
, "/node/decID", "/way/decID" and "/relation/decID".
Q mode
The Wikidata "Q-ID" used by elements with the key:wikidata.
http://osm.org/Q{wdId_base36}
- 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 examples
Other for illustration, no relevance or discussion at now.
T mode
Short URLs to redirect to main https://taginfo.openstreetmap.org statistical uses. Examples:
Tk-highway
redirects https://taginfo.openstreetmap.org/keys/highwayThighway=residential
redirects https://taginfo.openstreetmap.org/tags/highway=residential- etc.
Towards a short PURL
... See Persistent Place Identifier and Permanent ID/Proposal-QID.