Tiles@home/APIs

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page describes some APIs for accessing tiles@home data on the tah server.

Using the map tiles

Map tile URLs are of the style: http://tah.openstreetmap.org/Tiles/tile/12/2042/1364.png, where the numbers are Z, X, and Y.

See Slippy map tilenames for details of what Z, X, and Y mean in this context (the same format as used in google maps, and in the other slippy map).

Get tile details

Returns tile metadata and shows the tile.

http://tah.openstreetmap.org/Browse/details/tile/12/2213/1195/ where tile is the "layer" name, and 12,2213,1195 are the Z,X,Y values of the tile.

Uploading tiles

HTTP POST request of a single ZIP file containing multiple tiles as 256x256 pixel opaque PNG images. Tiles must be uniquely named within the ZIP file, with names of the form tile_z_x_y.png, where z,x,y are as described in Slippy map tilenames. The ZIP file may contain subdirectories, these will be removed when it's received.

  • See [1] for an example of the field names
  • Example code at [2]

As upload credentials, use your OSM email and password. People who have upload passwords are listed at the Credits page.

Requesting updates

Go to http://tah.openstreetmap.org/Request/create/ and fill in the values (you can also send a HTTP POST form to that URL).

As a convenience you can also request a tile by calling an URL like that: http://tah.openstreetmap.org/Request/create/?x=1&y=2&priority=2

  • X,Y are Slippy map tilenames at zoom level 12
  • set priority=1 for time-sensitive requests, priority=2 for other requests, and priority=3 for large bulk requests which are not so urgent. Use the highest number possible here.
  • set src to a short description of your data source (up to 30 letters)
  • the URL will return one line of text indicating the result (e.g. "OK")

Websites which provide an interface for requesting updates:

Checking the requests queue

UPDATE: THERE IS NO SUCH CHECK YET. IT WILL BE IMPLEMENTED SOON.

Example response:

OK|2045|1363|0|HISTORICAL
  • Status - "OK" indicates that you're getting something from the script and not an error
  • X (at zoom 12)
  • Y (at zoom 12)
  • Machine-readable response
    • 0 = not in rendering queue
    • 1 = in rendering queue
  • Human-readable response
    • NOT_REQUESTED - tile update has never been requested
    • REQUESTED - tile update has been requested
    • RENDERING - tile update has been requested, and someone is processing the request
    • HISTORICAL - tile was requested in the past, but the results were already uploaded