/usr/share/doc/tilestache/html/TileStache.Providers.html is in tilestache 1.31.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module TileStache.Providers</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="TileStache.html"><font color="#ffffff">TileStache</font></a>.Providers</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a></font></td></tr></table>
<p><tt>The provider bits of TileStache.<br>
<br>
A Provider is the part of TileStache that actually renders imagery. A few default<br>
providers are found here, but it's possible to define your own and pull them into<br>
TileStache dynamically by class name.<br>
<br>
Built-in providers:<br>
- mapnik (<a href="#Mapnik">Mapnik</a>)<br>
- proxy (<a href="#Proxy">Proxy</a>)<br>
- vector (TileStache.Vector.Provider)<br>
- url template (<a href="#UrlTemplate">UrlTemplate</a>)<br>
- mbtiles (TileStache.MBTiles.Provider)<br>
<br>
Example built-in provider, for JSON configuration file:<br>
<br>
"layer-name": {<br>
"provider": {"name": "mapnik", "mapfile": "style.xml"},<br>
...<br>
}<br>
<br>
Example external provider, for JSON configuration file:<br>
<br>
"layer-name": {<br>
"provider": {"class": "Module:Classname", "kwargs": {"frob": "yes"}},<br>
...<br>
}<br>
<br>
- The "class" value is split up into module and classname, and dynamically<br>
included. If this doesn't work for some reason, TileStache will fail loudly<br>
to let you know.<br>
- The "kwargs" value is fed to the class constructor as a dictionary of keyword<br>
args. If your defined class doesn't accept any of these keyword arguments,<br>
TileStache will throw an exception.<br>
<br>
A provider must offer one of two methods for rendering map areas.<br>
<br>
The renderTile() method draws a single tile at a time, and has these arguments:<br>
<br>
- width, height: in pixels<br>
- srs: projection as Proj4 string.<br>
"+proj=longlat +ellps=WGS84 +datum=WGS84" is an example, <br>
see <a href="http://spatialreference.org">http://spatialreference.org</a> for more.<br>
- coord: Coordinate object representing a single tile.<br>
<br>
The renderArea() method draws a variably-sized area, and is used when drawing<br>
metatiles. It has these arguments:<br>
<br>
- width, height: in pixels<br>
- srs: projection as Proj4 string.<br>
"+proj=longlat +ellps=WGS84 +datum=WGS84" is an example, <br>
see <a href="http://spatialreference.org">http://spatialreference.org</a> for more.<br>
- xmin, ymin, xmax, ymax: coordinates of bounding box in projected coordinates.<br>
- zoom: zoom level of final map. Technically this can be derived from the other<br>
arguments, but that's a hassle so we'll pass it in explicitly.<br>
<br>
A provider may offer a method for custom response type, getTypeByExtension().<br>
This method accepts a single argument, a filename extension string (e.g. "png",<br>
"json", etc.) and returns a tuple with twon strings: a mime-type and a format.<br>
Note that for image and non-image tiles alike, renderArea() and renderTile()<br>
methods on a provider class must return a object with a save() method that<br>
can accept a file-like object and a format name, e.g. this should word:<br>
<br>
provder.renderArea(...).save(fp, "TEXT")<br>
<br>
... if "TEXT" is a valid response format according to getTypeByExtension().<br>
<br>
Non-image providers and metatiles do not mix.<br>
<br>
For an example of a non-image provider, see TileStache.Vector.Provider.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="TileStache.Geography.html">TileStache.Geography</a><br>
<a href="Image.html">Image</a><br>
<a href="TileStache.MBTiles.html">TileStache.MBTiles</a><br>
</td><td width="25%" valign=top><a href="ModestMaps.html">ModestMaps</a><br>
<a href="TileStache.Vector.html">TileStache.Vector</a><br>
<a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
<a href="urllib.html">urllib</a><br>
<a href="urllib2.html">urllib2</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="TileStache.Providers.html#Mapnik">Mapnik</a>
</font></dt><dt><font face="helvetica, arial"><a href="TileStache.Providers.html#Proxy">Proxy</a>
</font></dt><dt><font face="helvetica, arial"><a href="TileStache.Providers.html#UrlTemplate">UrlTemplate</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Mapnik">class <strong>Mapnik</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Built-in <a href="#Mapnik">Mapnik</a> provider. Renders map images from <a href="#Mapnik">Mapnik</a> XML files.<br>
<br>
This provider is identified by the name "mapnik" in the TileStache config.<br>
<br>
Additional arguments:<br>
<br>
- mapfile (required)<br>
Local file path to <a href="#Mapnik">Mapnik</a> XML file.<br>
<br>
- fonts (optional)<br>
Local directory path to *.ttf font files.<br>
<br>
More information on <a href="#Mapnik">Mapnik</a> and <a href="#Mapnik">Mapnik</a> XML:<br>
- <a href="http://mapnik.org">http://mapnik.org</a><br>
- <a href="http://trac.mapnik.org/wiki/XMLGettingStarted">http://trac.mapnik.org/wiki/XMLGettingStarted</a><br>
- <a href="http://trac.mapnik.org/wiki/XMLConfigReference">http://trac.mapnik.org/wiki/XMLConfigReference</a><br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Mapnik-__init__"><strong>__init__</strong></a>(self, layer, mapfile, fonts<font color="#909090">=None</font>)</dt><dd><tt>Initialize <a href="#Mapnik">Mapnik</a> provider with layer and mapfile.<br>
<br>
XML mapfile keyword arg comes from TileStache config,<br>
and is an absolute path by the time it gets here.</tt></dd></dl>
<dl><dt><a name="Mapnik-renderArea"><strong>renderArea</strong></a>(self, width, height, srs, xmin, ymin, xmax, ymax, zoom)</dt></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Proxy">class <strong>Proxy</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#Proxy">Proxy</a> provider, to pass through and cache tiles from other places.<br>
<br>
This provider is identified by the name "proxy" in the TileStache config.<br>
<br>
Additional arguments:<br>
<br>
- url (optional)<br>
URL template for remote tiles, for example:<br>
"<a href="http://tile.openstreetmap.org/{Z}/{X}/{Y}.png">http://tile.openstreetmap.org/{Z}/{X}/{Y}.png</a>"<br>
- provider (optional)<br>
Provider name string from Modest Maps built-ins.<br>
See ModestMaps.builtinProviders.keys() for a list.<br>
Example: "OPENSTREETMAP".<br>
<br>
One of the above is required. When both are present, url wins.<br>
<br>
Example configuration:<br>
<br>
{<br>
"name": "proxy",<br>
"url": "<a href="http://tile.openstreetmap.org/{Z}/{X}/{Y}.png">http://tile.openstreetmap.org/{Z}/{X}/{Y}.png</a>"<br>
}<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Proxy-__init__"><strong>__init__</strong></a>(self, layer, url<font color="#909090">=None</font>, provider_name<font color="#909090">=None</font>)</dt><dd><tt>Initialize <a href="#Proxy">Proxy</a> provider with layer and url.</tt></dd></dl>
<dl><dt><a name="Proxy-renderTile"><strong>renderTile</strong></a>(self, width, height, srs, coord)</dt></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="UrlTemplate">class <strong>UrlTemplate</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Built-in URL Template provider. Proxies map images from WMS servers.<br>
<br>
This provider is identified by the name "url template" in the TileStache config.<br>
<br>
Additional arguments:<br>
<br>
- template (required)<br>
String with substitutions suitable for use in string.Template.<br>
<br>
- referer (optional)<br>
String to use in the "Referer" header when making HTTP requests.<br>
<br>
More on string substitutions:<br>
- <a href="http://docs.python.org/library/string.html#template-strings">http://docs.python.org/library/string.html#template-strings</a><br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="UrlTemplate-__init__"><strong>__init__</strong></a>(self, layer, template, referer<font color="#909090">=None</font>)</dt><dd><tt>Initialize a <a href="#UrlTemplate">UrlTemplate</a> provider with layer and template string.<br>
<br>
<a href="http://docs.python.org/library/string.html#template-strings">http://docs.python.org/library/string.html#template-strings</a></tt></dd></dl>
<dl><dt><a name="UrlTemplate-renderArea"><strong>renderArea</strong></a>(self, width, height, srs, xmin, ymin, xmax, ymax, zoom)</dt><dd><tt>Return an image for an area.<br>
<br>
Each argument (width, height, etc.) is substituted into the template.</tt></dd></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-allocate_lock"><strong>allocate_lock</strong></a>(...)</dt><dd><tt><a href="#-allocate_lock">allocate_lock</a>() -> lock object<br>
(allocate() is an obsolete synonym)<br>
<br>
Create a new lock object. See LockType.__doc__ for information about locks.</tt></dd></dl>
<dl><dt><a name="-getProviderByName"><strong>getProviderByName</strong></a>(name)</dt><dd><tt>Retrieve a provider object by name.<br>
<br>
Raise an exception if the name doesn't work out.</tt></dd></dl>
<dl><dt><a name="-time"><strong>time</strong></a>(...)</dt><dd><tt><a href="#-time">time</a>() -> floating point number<br>
<br>
Return the current time in seconds since the Epoch.<br>
Fractions of a second may be present if the system clock provides them.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>global_mapnik_lock</strong> = <thread.lock object at 0x1004b3180></td></tr></table>
</body></html>
|