TileStache.Geography
index

The geography bits of TileStache.
 
A Projection defines the relationship between the rendered tiles and the
underlying geographic data. Generally, just one popular projection is used
for most web maps, "spherical mercator".
 
Built-in projections:
- spherical mercator
WGS84
 
Example use projection in a layer definition:
 
    "layer-name": {
        "projection": "spherical mercator",
        ...
    }
 
You can define your own projection, with a module and object name as arguments:
 
    "layer-name": {
        ...
        "projection": "Module:Object"
    }
 
The object must include methods that convert between coordinates, points, and
locations. See the included mercator and WGS84 implementations for example.
You can also instantiate a projection class using this syntax:
 
    "layer-name": {
        ...
        "projection": "Module:Object()"
    }

 
Modules
       
TileStache.Config
TileStache.Core

 
Classes
       
ModestMaps.Geo.LinearProjection(ModestMaps.Geo.IProjection)
WGS84
ModestMaps.Geo.MercatorProjection(ModestMaps.Geo.IProjection)
SphericalMercator

 
class SphericalMercator(ModestMaps.Geo.MercatorProjection)
    Spherical mercator projection for most commonly-used web map tile scheme.
 
This projection is identified by the name "spherical mercator" in the
TileStache config. The simplified projection used here is described in
greater detail at: http://trac.openlayers.org/wiki/SphericalMercator
 
 
Method resolution order:
SphericalMercator
ModestMaps.Geo.MercatorProjection
ModestMaps.Geo.IProjection

Methods defined here:
__init__(self)
coordinateProj(self, coord)
Convert from Coordinate object to a Point object in EPSG:900913
locationProj(self, location)
Convert from Location object to a Point object in EPSG:900913
projCoordinate(self, point)
Convert from Point object in EPSG:900913 to a Coordinate object
projLocation(self, point)
Convert from Point object in EPSG:900913 to a Location object

Data and other attributes defined here:
srs = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lo...0 +units=m +nadgrids=@null +wktext +no_defs +over'

Methods inherited from ModestMaps.Geo.MercatorProjection:
rawProject(self, point)
rawUnproject(self, point)

Methods inherited from ModestMaps.Geo.IProjection:
coordinateLocation(self, coordinate)
locationCoordinate(self, location)
project(self, point)
unproject(self, point)

 
class WGS84(ModestMaps.Geo.LinearProjection)
    Unprojected projection for the other commonly-used web map tile scheme.
 
This projection is identified by the name "WGS84" in the TileStache config.
 
 
Method resolution order:
WGS84
ModestMaps.Geo.LinearProjection
ModestMaps.Geo.IProjection

Methods defined here:
__init__(self)
coordinateProj(self, coord)
Convert from Coordinate object to a Point object in EPSG:4326
locationProj(self, location)
Convert from Location object to a Point object in EPSG:4326
projCoordinate(self, point)
Convert from Point object in EPSG:4326 to a Coordinate object
projLocation(self, point)
Convert from Point object in EPSG:4326 to a Location object

Data and other attributes defined here:
srs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'

Methods inherited from ModestMaps.Geo.LinearProjection:
rawProject(self, point)
rawUnproject(self, point)

Methods inherited from ModestMaps.Geo.IProjection:
coordinateLocation(self, coordinate)
locationCoordinate(self, location)
project(self, point)
unproject(self, point)

 
Functions
       
getProjectionByName(name)
Retrieve a projection object by name.
 
Raise an exception if the name doesn't work out.