| |
- cgiHandler(environ, config='./tilestache.cfg', debug=False)
- Read environment PATH_INFO, load up configuration, talk to stdout by CGI.
Calls requestHandler().
Config parameter can be a file path string for a JSON configuration file
or a configuration object with 'cache', 'layers', and 'dirpath' properties.
- getPreview(layer)
- Get a type string and dynamic map viewer HTML for a given layer.
- getcwd(...)
- getcwd() -> path
Return a string representing the current working directory.
- mergePathInfo(layer, coord, extension)
- Converts layer name, coordinate and extension back to a PATH_INFO string.
See also splitPathInfo().
- modpythonHandler(request)
- Handle a mod_python request.
Calls requestHandler().
Example Apache configuration for TileStache:
<Directory /home/migurski/public_html/TileStache>
AddHandler mod_python .py
PythonHandler TileStache::modpythonHandler
PythonOption config /etc/tilestache.cfg
</Directory>
Configuration options, using PythonOption directive:
- config: path to configuration file, defaults to "tilestache.cfg",
using request.filename as the current working directory.
- parseConfigfile(configpath)
- Parse a configuration file and return a Configuration object.
Configuration file is formatted as JSON with two sections, "cache" and "layers":
{
"cache": { ... },
"layers": {
"layer-1": { ... },
"layer-2": { ... },
...
}
}
The full path to the file is significant, used to
resolve any relative paths found in the configuration.
See the Caches module for more information on the "caches" section,
and the Core and Providers modules for more information on the
"layers" section.
- requestHandler(config_hint, path_info, query_string, script_name='')
- Generate a set of headers and response body for a given request.
Requires a configuration and PATH_INFO (e.g. "/example/0/0/0.png").
Config_hint parameter can be a path string for a JSON configuration file
or a configuration object with 'cache', 'layers', and 'dirpath' properties.
Query string is optional, currently used for JSON callbacks.
Calls getTile() to render actual tiles, and getPreview() to render preview.html.
- requestLayer(config, path_info)
- Return a Layer.
Requires a configuration and PATH_INFO (e.g. "/example/0/0/0.png").
Config parameter can be a file path string for a JSON configuration file
or a configuration object with 'cache', 'layers', and 'dirpath' properties.
- splitPathInfo(pathinfo)
- Converts a PATH_INFO string to layer name, coordinate, and extension parts.
Example: "/layer/0/0/0.png", leading "/" optional.
- time(...)
- time() -> floating point number
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.
|