Python: module TileStache.Goodies.Providers.Grid

TileStache.Goodies.Providers.Grid | index

`Grid rendering for TileStache.
UTM provider found here draws gridlines in tiles, in transparent images suitable
for use as map overlays.
Example TileStache provider configuration:
"grid":
{
"provider": {"class": "TileStache.Goodies.Providers.Grid:UTM",
"kwargs": {"display": "MGRS", "spacing": 200, "tick": 10}}
}`

Modules
`` |  |
PIL.Image PIL.ImageDraw | PIL.ImageFont PIL | TileStache sys |

Classes
`` |  | UTM
class UTM
`` | `UTM Grid provider, renders transparent gridlines. Example configuration: "grid": { "provider": {"class": "TileStache.Goodies.Providers.Grid.UTM", "kwargs": {"display": "MGRS", "spacing": 200, "tick": 10}} } Additional arguments: - display (optional, default: "UTM") Label display style. UTM: "18Q 0780 2052", MGRS: "18Q YF 80 52". - spacing (optional, default: 128) Minimum number of pixels between grid lines. - tick (optional, default 8) Pixel length of 1/10 grid tick marks.`
| Methods defined here: __init__(self, layer, display='UTM', spacing=128, tick=8) renderArea(self, width_, height_, srs, xmin_, ymin_, xmax_, ymax_, zoom)

Functions
`` |  | lat2hemi(lat) `Convert latitude to single-letter hemisphere, "N" or "S".` lat2zone(lat) `Convert longitude to single-letter UTM zone.` lon2zone(lon) `Convert longitude to numeric UTM zone, 1-60.` lonlat2grid(lon, lat) `Convert lat/lon pair to alphanumeric UTM zone.` transform(w, h, xmin, ymin, xmax, ymax) utm2mgrs(e, n, grid, zeros=0) `Convert UTM easting/northing pair and grid zone to MGRS-style grid reference, e.g. "18Q YF 80 52". Adapted from http://haiticrisismap.org/js/usng2.js`