Vector Tiles (alpha)

Vector Tiles Documentation

Rationale

Definition

Vector maps is a simple service, which, unlike boring old tile image services, returns vector data as a result of your requests.

Why vector data?

Vector formats give you a lot of ways to play with map data. Vector formats give you the ability to filter tags with certain attributes, change the way your map looks on-the-fly and lots more.

If you want to learn more about vector graphics, check out this article -- http://en.wikipedia.org/wiki/Vector_graphics.

Example usage

To fetch a map of Buena Vista Park in San Francisco:

http://vector-maps.cloudmade.com/BC9A493B41014CAABB98F0471D759707/37.76495/-122.44647/37.77185/-122.43669

For a larger example try this map of Huntingdon and St Ives in South England:

http://vector-maps.cloudmade.com/BC9A493B41014CAABB98F0471D759707/52.3/-0.25/52.37/0.02

Currently the SVG files returned have no stylization and contain only two types of geometry: circle and path. circle is a point of interest and path can be any other object on the map - road, building, river, etc.

Request specification

URL Structure is:
host-name/API-KEY/lat0/lon0/lat1/lon1[?style=some-style]

Parameters:

  • API key - Your API key
  • lon0, lat0, lon1, lat1 - Latitude/longitude pairs that delimit bounding box
  • style - Style by which tags will be filtered. Right now it's "default", which means that returned data is not filtered (all available data is being returned). If style is not specified, "_default_" style is used.

Returned data

XML header

Typical answer from CloudMade's server should contain at least these opening tags:

  • Declaration of XML:
    <?xml version="1.0" standalone="no"?>
  • Declaration of DTD:
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  • SVG root tag. width and height attributes specify view port of SVG document, version specifies version of SVG specification and xmlns attributes specify namespaces used in the document.
    <svg width="800px" height="800px" xmlns:cm="http://cloudmade.com/" xmlns="http://www.w3.org/2000/svg" version="1.1">
  • Scale coordinate system so objects in SVG document fit into the view port
    <g transform="scale(0.0143730445459)">
  • Move starting point of SVG coordinate system to new point
    <g transform="translate(-111319, 6946088)">

SVG attributes

Specification on SVG attributes used in returned data can be found on w3c site http://www.w3.org/TR/SVG/.

CloudMade's specific attributes

There are a lot of attributes that are CloudMade specific. All of them can be found in cm namespace. You can see all the key, value pairs you can look for right here http://wiki.openstreetmap.org/wiki/Map_Features

Known limitations

  • Currently, only bounding boxes of square no more than 0.25 degree can be requested.
    This limitation will be removed in future version of Vector Maps.
  • Style filters choice is somehow limited and messy. This is going to be fixed in future releases

Changes to Mobile Authorization

We've made some changes to the way mobile devices authorize against our API. Find out more here

Ready to Get started?

Get an API Key

Wiki

Start page
Index by title
Index by date

License info

Terms of Service

Also available in: HTML TXT