User:John07/short links
Jump to navigation
Jump to search
Idea: Create a service for a) quick search links and b) short permalinks:
Important: NO difference between osm.org and openstreetmap.org, the services will work on both domains.
a) goal: links for direct search of the osm database
- example: openstreetmap.org/go/london will search for london using the (new) namefinder
- seperate link like osm.org/go or go.osm.org
- difficult which places is searched for (e.g. York): if the result is fairly clear (e.g. London) -> direct link to the place on the map and "More Results"-button. If it is not such clear (e.g. York) -> list with different results
___________________________________________________________________________________________________
SOLVED!!!
b) goal: short permalinks for usage in e-mails or twitter etc.
- example: openstreetmap.org/p/345qu53 will be resolved to http://www.openstreetmap.org/?lat=50.152&lon=8.498&zoom=10&layers=B000FFF
- The design of the short link is a compromise between humans and computers. Limiting the link to only lowercase letters and numbers makes them slightly memorisable, and typeable, but makes the link slightly longer than it might be if you accept a more difficult to type code. Compare typing the case-insensitive A0FFE4QP45, and the case-sensitive Aru4"@}
- The circumference of the earth is about 40 million meters. If you want to specify a location on a (approx) 10m grid, you need 4m possible locations, which take 21 bits. this is a total of 42 bits for latitude and longitude.
- With 6 bits per char (each character of the link being one of 64 (A-Z a-z 0-9 and a few others), this results in 42/6 = 7 chars.
- The design of the short link is a compromise between humans and computers. Limiting the link to only lowercase letters and numbers makes them slightly memorisable, and typeable, but makes the link slightly longer than it might be if you accept a more difficult to type code. Compare typing the case-insensitive A0FFE4QP45, and the case-sensitive Aru4"@}
- For example osm.org/p/48GguT8 - would result in a location, (technically comprised of the Quadtile address, simply encoded). To avoid problems with tile borders - you want to show a town, but it's cut in half by a tile boundary - you need a zoom too. This can be a trailing char - with for example the first 2 bits having some flags (cyclemap, ...), and the last 4 the zoom. Perhaps fewer than the last 4 for zoom - as you probably don't need more than 8 zoomlevels.
- With this scheme - an extra letter gives you 8 times higher resolution. So 8 total chars gives you 10m - maybe a house - (7) 100m - a housing estate - (6) 1000m - a town - (5) 10000 and 4 chars 100Km - a region.
- This is merely an example of a possible encoding scheme. Unfortunately, you can't get much better than this with whatever scheme - unless you get _really_ clever - which basically means context sensitive positioning - which would of course change with the database - which would be bad :) (an example might be the UK postcode - which solves this problem by not being a general location tool, but a list of houses)
- seperate link like osm.org/p or p.osm.org
- short permalink can be created on openstreetmap.org with a simple button/link
- maybe adding a marker with a "m" at the end or beginning
These ideas were discussed in the #osm IRC and these are the "results".
Please add your ideas and move the page to a separate wiki-page.
- Been thinking about the Quadtile/last character encoding a bit. Would 3 bits for zoom work if they covered (length(shortlink)-2)*2 to (length(shortlink)-2)*2+7? e.g. /p/43 would have the second character dictating a zoom level between 0 and 7 (and layers) for the quadtile defined by the first character, but once you get to /p/48GguT85 then the last character dictates a zoom level between 12 and 19 (and layers)? This assumes that the more accurately you are specifying the position then the closer you'll want to zoom in (and conversely if you specify a low zoom level then the position can be rounded slightly to be less accurate). --EdLoach 06:48, 5 June 2009 (UTC)