[OSM-dev] openstreetmap uris

Tom Hughes tom at compton.nu
Thu Jan 24 17:21:13 GMT 2008


In message <4798BF0A.3060307 at berkeley.edu>
          Erik Wilde <dret at berkeley.edu> wrote:

> Tom Hughes wrote:
>
> > Well it isn't really supposed to be user comprehensible - it's a
> > permalink, ie an opaque token that takes you back to what you were
> > looking at when you saved it.
> 
> well, permalinks often do have structure, and it can be useful to
> process it. what i am working on is the following: based on a table of
> map service permalink structure, a browser-based tool (for now, a
> greasemonkey script) rewrites map service uris to your preferred map
> service. so if a web page contains a link to a yahoo map, then the
> script will turn that into a link to google maps. that of course may not
> work great all of the time, but my main interest is to look at the
> features shared by most map services. few map services document their
> uris properly, but i am always trying to find this information, and map
> services must be diligent in having a well-defined and stable uri
> format, if they don't want to routinely break older permalinks...

Well obviously they do have structure - my point was more that the
creators of the links probably don't necessarily intend people to
try and decode that structure.

> > I believe it is documented somewhere in the wiki that you can add
> > lat, lon and zoom parameters to a URL to get a map at a particular
> > location. I wouldn't encourage anybody to try and decode the layers
> > parameter, or to add one to any link they generated.
> 
> so there only is a map layer? most other services have satellite, nybrid
> and sometimes physical map layers, but the view type is one of the
> common features i want to include in my table of map service features.
> it would be great if i could find a place where it is said how uri are
> constructed (zoom levels, and can i do a query in a uri, which is
> supported in most map services). ok, i do see that there are 17 zoom
> levels, and the only available search seems to be based on post codes.

We have layers, yes - two map layers plus one overlay at the moment.

The problem is that the layers attribute in the URL is not in a
very stable format - specifically it is tied to the order in which
the layers are listed in the menu on the page. The result of that
is that if layers get added the meaning of the layers attribute
can change.

I realise that isn't brilliant, and we should probably do something
about it, but that's how it is at the moment.

There are actually 19 zoom levels for the Mapnik layer I think. The
Osmarender layer is only 17 or 18 I believe.

Search is not limited to postcodes - depending on what you enter in
the search box it will search a range of different sources. You can
actually also search using the URL by adding a query= parameter
although that isn't well documented or publicised at the moment.

Ah... I knew there was a better page in the wiki somewhere, and I've
just managed to find it:

  http://wiki.openstreetmap.org/index.php/Browsing

That details most of the things you can do with URLs although it
doesn't mention the query parameter currently.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/




More information about the dev mailing list