8000 Layers API · andrewxhill/MOL Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
eightysteele edited this page Feb 4, 2011 · 2 revisions

Description

This REST API supports listing, creating, updating, and tiling layer resources as JSON or PNG representations. Layer resources are identified by a MOL species id: GET | PUT /layers/species_id HTTP/1.1

GET is used to list all layer resources and to return a single layer resource by species id. A 200 status code is returned on success and a 404 is returned on error. For tiles, a .png extension is added to the species id along with required query string parameters x, y, and z. See the Google Maps Coordinates page for details on these parameters. An example call would be /layers/species_id.png?x=2&y=8&z=2 which is interpreted as "tile (2,8) at zoom level 2".

PUT is used to create or update layer resources. A layer resource is created if a TileSetIndex example entity doesn't exist for the MOL species id in which case a 201 status code is returned with Location and Content-Location headers. A layer resource is updated when the incoming dateCreated parameter is greater than the TileSetIndex.dateLastModified property in which case a 200 status code is returned. Otherwise a 409 status code is returned. A 404 status code is returned if there are problems with incoming parameters. The following are required:

zoom, proj, dateCreated, maxLat, minLat, maxLon, minLon, remoteLocation

Examples

Get a layer resource by MOL species id example

Get a list of all layer resources example

See the Layer.register function in the layers app for an example of creating/updating a layer resource: https://github.com/andrewxhill/MOL/blob/modularize/layers/layers/lib/mol/service/init.py example

Clone this wiki locally
0