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
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package TileStache</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>TileStache</strong></big></big> (version N.N.N)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a></font></td></tr></table>
<p><tt>A stylish alternative for caching your map tiles.<br>
<br>
TileStache is a Python-based server application that can serve up map tiles<br>
based on rendered geographic data. You might be familiar with TileCache<br>
(<a href="http://tilecache.org">http://tilecache.org</a>), the venerable open source WMS server from MetaCarta.<br>
TileStache is similar, but we hope simpler and better-suited to the needs of<br>
designers and cartographers.<br>
<br>
Documentation available at <a href="http://tilestache.org/doc/">http://tilestache.org/doc/</a></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>Package Contents</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.Caches.html">Caches</a><br>
<a href="TileStache.Config.html">Config</a><br>
<a href="TileStache.Core.html">Core</a><br>
</td><td width="25%" valign=top><a href="TileStache.Geography.html">Geography</a><br>
<a href="TileStache.Goodies.html"><strong>Goodies</strong> (package)</a><br>
<a href="TileStache.MBTiles.html">MBTiles</a><br>
</td><td width="25%" valign=top><a href="TileStache.Memcache.html">Memcache</a><br>
<a href="TileStache.Pixels.html">Pixels</a><br>
<a href="TileStache.Providers.html">Providers</a><br>
</td><td width="25%" valign=top><a href="TileStache.S3.html">S3</a><br>
<a href="TileStache.Vector.html"><strong>Vector</strong> (package)</a><br>
</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.html#WSGITileServer">WSGITileServer</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="WSGITileServer">class <strong>WSGITileServer</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Create a WSGI application that can handle requests from any server that talks WSGI.<br>
<br>
The WSGI application is an instance of this class. Example:<br>
<br>
app = <a href="#WSGITileServer">WSGITileServer</a>('/path/to/tilestache.cfg')<br>
werkzeug.serving.run_simple('localhost', 8080, app)<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="WSGITileServer-__call__"><strong>__call__</strong></a>(self, environ, start_response)</dt></dl>
<dl><dt><a name="WSGITileServer-__init__"><strong>__init__</strong></a>(self, config, autoreload<font color="#909090">=False</font>)</dt><dd><tt>Initialize a callable WSGI instance.<br>
<br>
Config parameter can be a file path string for a JSON configuration<br>
file or a configuration object with 'cache', 'layers', and<br>
'dirpath' properties.<br>
<br>
Optional autoreload boolean parameter causes config to be re-read<br>
on each request, applicable only when config is a JSON file.</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="-cgiHandler"><strong>cgiHandler</strong></a>(environ, config<font color="#909090">='./tilestache.cfg'</font>, debug<font color="#909090">=False</font>)</dt><dd><tt>Read environment PATH_INFO, load up configuration, talk to stdout by CGI.<br>
<br>
Calls <a href="#-requestHandler">requestHandler</a>().<br>
<br>
Config parameter can be a file path string for a JSON configuration file<br>
or a configuration object with 'cache', 'layers', and 'dirpath' properties.</tt></dd></dl>
<dl><dt><a name="-getPreview"><strong>getPreview</strong></a>(layer)</dt><dd><tt>Get a type string and dynamic map viewer HTML for a given layer.</tt></dd></dl>
<dl><dt><a name="-getTile"><strong>getTile</strong></a>(layer, coord, extension, ignore_cached<font color="#909090">=False</font>)</dt><dd><tt>Get a type string and tile binary for a given request layer tile.<br>
<br>
Arguments:<br>
- layer: instance of Core.Layer to render.<br>
- coord: one ModestMaps.Core.Coordinate corresponding to a single tile.<br>
- extension: filename extension to choose response type, e.g. "png" or "jpg".<br>
- ignore_cached: always re-render the tile, whether it's in the cache or not.<br>
<br>
This is the main entry point, after site configuration has been loaded<br>
and individual tiles need to be rendered.</tt></dd></dl>
<dl><dt><a name="-getcwd"><strong>getcwd</strong></a>(...)</dt><dd><tt><a href="#-getcwd">getcwd</a>() -> path<br>
<br>
Return a string representing the current working directory.</tt></dd></dl>
<dl><dt><a name="-mergePathInfo"><strong>mergePathInfo</strong></a>(layer, coord, extension)</dt><dd><tt>Converts layer name, coordinate and extension back to a PATH_INFO string.<br>
<br>
See also <a href="#-splitPathInfo">splitPathInfo</a>().</tt></dd></dl>
<dl><dt><a name="-modpythonHandler"><strong>modpythonHandler</strong></a>(request)</dt><dd><tt>Handle a mod_python request.<br>
<br>
Calls <a href="#-requestHandler">requestHandler</a>().<br>
<br>
Example Apache configuration for TileStache:<br>
<br>
<Directory /home/migurski/public_html/TileStache><br>
AddHandler mod_python .py<br>
PythonHandler TileStache::modpythonHandler<br>
PythonOption config /etc/tilestache.cfg<br>
</Directory><br>
<br>
Configuration options, using PythonOption directive:<br>
- config: path to configuration file, defaults to "tilestache.cfg",<br>
using request.filename as the current working directory.</tt></dd></dl>
<dl><dt><a name="-parseConfigfile"><strong>parseConfigfile</strong></a>(configpath)</dt><dd><tt>Parse a configuration file and return a Configuration object.<br>
<br>
Configuration file is formatted as JSON with two sections, "cache" and "layers":<br>
<br>
{<br>
"cache": { ... },<br>
"layers": {<br>
"layer-1": { ... },<br>
"layer-2": { ... },<br>
...<br>
}<br>
}<br>
<br>
The full path to the file is significant, used to<br>
resolve any relative paths found in the configuration.<br>
<br>
See the Caches module for more information on the "caches" section,<br>
and the Core and Providers modules for more information on the<br>
"layers" section.</tt></dd></dl>
<dl><dt><a name="-requestHandler"><strong>requestHandler</strong></a>(config_hint, path_info, query_string)</dt><dd><tt>Generate a mime-type and response body for a given request.<br>
<br>
Requires a configuration and PATH_INFO (e.g. "/example/0/0/0.png").<br>
<br>
Config_hint parameter can be a path string for a JSON configuration file<br>
or a configuration object with 'cache', 'layers', and 'dirpath' properties.<br>
<br>
Query string is optional, currently used for JSON callbacks.<br>
<br>
Calls <a href="#-getTile">getTile</a>() to render actual tiles, and <a href="#-getPreview">getPreview</a>() to render preview.html.</tt></dd></dl>
<dl><dt><a name="-requestLayer"><strong>requestLayer</strong></a>(config, path_info)</dt><dd><tt>Return a Layer.<br>
<br>
Requires a configuration and PATH_INFO (e.g. "/example/0/0/0.png").<br>
<br>
Config parameter can be a file path string for a JSON configuration file<br>
or a configuration object with 'cache', 'layers', and 'dirpath' properties.</tt></dd></dl>
<dl><dt><a name="-splitPathInfo"><strong>splitPathInfo</strong></a>(pathinfo)</dt><dd><tt>Converts a PATH_INFO string to layer name, coordinate, and extension parts.<br>
<br>
Example: "/layer/0/0/0.png", leading "/" optional.</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>__version__</strong> = 'N.N.N'<br>
<strong>stdout</strong> = <open file '<stdout>', mode 'w' at 0x1004160b8></td></tr></table>
</body></html>
|