/usr/share/doc/tilestache/html/TileStache.Mapnik.html is in tilestache 1.49.8-3.
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 | <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module TileStache.Mapnik</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>.Mapnik</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>Mapnik Providers.<br>
<br>
<a href="#ImageProvider">ImageProvider</a> is known as "mapnik" in TileStache config, <a href="#GridProvider">GridProvider</a> is<br>
known as "mapnik grid". Both require Mapnik to be installed; Grid requires<br>
Mapnik 2.0.0 and above.</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="PIL.Image.html">PIL.Image</a><br>
<a href="json.html">json</a><br>
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
<a href="mapnik.html">mapnik</a><br>
</td><td width="25%" valign=top><a href="os.html">os</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.Mapnik.html#GridProvider">GridProvider</a>
</font></dt><dt><font face="helvetica, arial"><a href="TileStache.Mapnik.html#ImageProvider">ImageProvider</a>
</font></dt><dt><font face="helvetica, arial"><a href="TileStache.Mapnik.html#SaveableResponse">SaveableResponse</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="GridProvider">class <strong>GridProvider</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Built-in UTF Grid provider. Renders JSON raster objects from Mapnik.<br>
<br>
This provider is identified by the name "mapnik grid" in the<br>
Tilestache config, and uses Mapnik 2.0 (and above) to generate<br>
JSON UTF grid responses.<br>
<br>
Sample configuration for a single grid layer:<br>
<br>
"provider":<br>
{<br>
"name": "mapnik grid",<br>
"mapfile": "world_merc.xml", <br>
"fields": ["NAME", "POP2005"]<br>
}<br>
<br>
Sample configuration for multiple overlaid grid layers:<br>
<br>
"provider":<br>
{<br>
"name": "mapnik grid",<br>
"mapfile": "world_merc.xml",<br>
"layers":<br>
[<br>
[1, ["NAME"]],<br>
[0, ["NAME", "POP2005"]],<br>
[0, null],<br>
[0, []]<br>
]<br>
}<br>
<br>
Arguments:<br>
<br>
- mapfile (required)<br>
Local file path to Mapnik XML file.<br>
<br>
- fields (optional)<br>
Array of field names to return in the response, defaults to all.<br>
An empty list will return no field names, while a value of null is<br>
equivalent to all.<br>
<br>
- layer index (optional)<br>
Which layer from the mapfile to render, defaults to 0 (first layer).<br>
<br>
- layers (optional)<br>
Ordered list of (layer index, fields) to combine; if provided<br>
layers overrides both layer index and fields arguments.<br>
An empty fields list will return no field names, while a value of null <br>
is equivalent to all fields.<br>
<br>
- scale (optional)<br>
Scale factor of output raster, defaults to 4 (64x64).<br>
<br>
- layer id key (optional)<br>
If set, each item in the 'data' property will have its source mapnik<br>
layer name added, keyed by this value. Useful for distingushing<br>
between data items.<br>
<br>
Information and examples for UTF Grid:<br>
- https://github.com/mapbox/utfgrid-spec/blob/master/1.2/utfgrid.md<br>
- <a href="http://mapbox.github.com/wax/interaction-leaf.html">http://mapbox.github.com/wax/interaction-leaf.html</a><br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="GridProvider-__init__"><strong>__init__</strong></a>(self, layer, mapfile, fields<font color="#909090">=None</font>, layers<font color="#909090">=None</font>, layer_index<font color="#909090">=0</font>, scale<font color="#909090">=4</font>, layer_id_key<font color="#909090">=None</font>)</dt><dd><tt>Initialize Mapnik grid 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="GridProvider-getTypeByExtension"><strong>getTypeByExtension</strong></a>(self, extension)</dt><dd><tt>Get mime-type and format by file extension.<br>
<br>
This only accepts "json".</tt></dd></dl>
<dl><dt><a name="GridProvider-renderArea"><strong>renderArea</strong></a>(self, width, height, srs, xmin, ymin, xmax, ymax, zoom)</dt></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="GridProvider-prepareKeywordArgs"><strong>prepareKeywordArgs</strong></a>(config_dict)</dt><dd><tt>Convert configured parameters to keyword args for <a href="#GridProvider-__init__">__init__</a>().</tt></dd></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="ImageProvider">class <strong>ImageProvider</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Built-in Mapnik provider. Renders map images from Mapnik XML files.<br>
<br>
This provider is identified by the name "mapnik" in the TileStache config.<br>
<br>
Arguments:<br>
<br>
- mapfile (required)<br>
Local file path to Mapnik XML file.<br>
<br>
- fonts (optional)<br>
Local directory path to *.ttf font files.<br>
<br>
More information on Mapnik and Mapnik 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="ImageProvider-__init__"><strong>__init__</strong></a>(self, layer, mapfile, fonts<font color="#909090">=None</font>)</dt><dd><tt>Initialize Mapnik 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="ImageProvider-renderArea"><strong>renderArea</strong></a>(self, width, height, srs, xmin, ymin, xmax, ymax, zoom)</dt></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="ImageProvider-prepareKeywordArgs"><strong>prepareKeywordArgs</strong></a>(config_dict)</dt><dd><tt>Convert configured parameters to keyword args for <a href="#ImageProvider-__init__">__init__</a>().</tt></dd></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="SaveableResponse">class <strong>SaveableResponse</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Wrapper class for JSON response that makes it behave like a PIL.Image object.<br>
<br>
TileStache.getTile() expects to be able to save one of these to a buffer.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SaveableResponse-__init__"><strong>__init__</strong></a>(self, content, scale)</dt></dl>
<dl><dt><a name="SaveableResponse-crop"><strong>crop</strong></a>(self, bbox)</dt><dd><tt>Return a cropped grid response.</tt></dd></dl>
<dl><dt><a name="SaveableResponse-save"><strong>save</strong></a>(self, out, format)</dt></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="-decode_char"><strong>decode_char</strong></a>(char)</dt></dl>
<dl><dt><a name="-encode_id"><strong>encode_id</strong></a>(id)</dt></dl>
<dl><dt><a name="-get_mapnikMap"><strong>get_mapnikMap</strong></a>(mapfile)</dt><dd><tt>Get a new mapnik.Map instance for a mapfile</tt></dd></dl>
<dl><dt><a name="-merge_grids"><strong>merge_grids</strong></a>(grid1, grid2)</dt><dd><tt>Merge two UTF Grid objects.</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 0x1004b3228></td></tr></table>
</body></html>
|