[OSM-dev] mc labs osm tiles now match main osm tiles

Christopher Schmidt crschmidt at metacarta.com
Tue Jul 24 05:36:29 BST 2007


The previously MetaCarta Labs, now hosted by OSGeo/Telascience,
tilecache-generated OSM tiles, now have a tileset which lines up with
the Google Maps tiles.

http://t3.hypercube.telascience.org/tiles/1.0.0/osm-merc-google/6/31/21.png?type=google

http://mt0.google.com/mt?n=404&v=w2.56&x=31&y=21&zoom=11

(Compare to
http://t3.hypercube.telascience.org/tiles/1.0.0/osm-merc/6/31/21.png?type=google
, which does not match up.)

The magic that I needed was eventually found in the proj4 FAQ: 

http://proj.maptools.org/faq.html
Changing Ellipsoid / Why can't I convert from WGS84 to Virtual Earth
Mercator?

which let me know that the proj4 text I needed was:

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

specifically, the "+nagrdis=@null" was something I couldn't get from
anywhere else.

The tiles on hypercube are updated by a cronjob every wednesday morning, 
after successful download of a new planet.osm file, loading into
postgres db, and the top few levels are pre-cached.    

Both the osm-merc-google and the osm-merc will continue to exist for the
forseeable future.

Putting the proj4 text above into an osm.xml (in the 'srs' attribute of
the <Map> element), then adding to tilecache.cfg something like:

[osm-merc-google]
type=MapnikLayer
mapfile=/mnt/agami/openstreetmap/config/osm.xml
bbox=-20037508.34,-20037508.34,20037508.34,20037508.34
maxresolution=156543
srs=OSGEO:41001
metaTile=yes
metaBuffer=40

You too can create google-friendly tiles with TileCache.

Regards,
-- 
Christopher Schmidt
MetaCarta




More information about the dev mailing list