[Tilecache] Projecting with a different SRS

Dane Springmeyer blake at hailmail.net
Wed Aug 27 15:54:30 EDT 2008


Tyler,

In your tilecache.cfg you can pass a parameter like:

projection=+proj=merc +k=1.0 +datum=WGS84 +over +units=m

which will override the projection in the mapnik XML and reproject  
your data to that projection.

Or you can do as it sounds like you've done and just change the proj4  
code in your original XML.

Either way the only other step needed to fetch projected tiles through  
TileCache should be to set the proper extents in OpenLayers.

I'm not clear on the smartest way to do this but in my tilecache.cfg I  
have:

[polar]
type=Mapnik
mapfile=/Library/WebServer/Documents/mapfile.xml
srs=EPSG:3031
projection= +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0  
+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
bbox=-3721203.143138902,-951869.332207036,  
3560164.0478620003,1844986.6977515414

the bbox which nests inside the maxextent specified in the OpenLayers  
map options that read:
...
projection: new OpenLayers.Projection("EPSG:3031") ,
maxExtent: new OpenLayers.Bounds(-196813697.178490, -100120989.481879,  
160561884.749931,191038283.027071)
...

then call map.zoomToMaxExtent(); somewhere lower in the page and you  
should be rendering projected tiles of your data in OpenLayers.

Cheers,

Dane



On Aug 27, 2008, at 1:48 AM, Tyler Durden wrote:

> I've in my geoms fields(Postgis) in WSG84(EPSG:4326) and I want to
> make the projection and generate the tiles with TileCache to World
> Mercator(EPSG:3395), althougth I've srs=EPSG:3395 in my tilecache.cfg
> it doesn't convert.
> I'm using TileCache, OpenLayers and Mapnik. In my Mapnik osm.xml I've:
> <Map bgcolor="&color_water;" srs="+proj=merc +k=1.0 +datum=WGS84 +over
> +units=m">
>
> This conversion is possible? Or I've must have the geoms in EPSG:3395?
>
> Thanks,
> Tyler
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache




More information about the Tilecache mailing list