Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i use two seperate datasource for my layers:

  • sql database for main map data, this is using EPSG:900913
  • osm file for some extra features, this data use EPSG:4326 projection

tiles for both layers are created on server side. what i need to do to generate tiles for EPSG:900913 projection from data in EPSG:4326 projection? is it somewhere in tilecache configuration? in definition map or layer in osm file, or somewhere else?




<Map background-color="#00000000" srs="+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs" >
  <Style name="style">
      <PolygonSymbolizer fill="#ff0000" />
      <LineSymbolizer stroke="#00ff00" stroke-width="100" />
  <Layer name="global" srs="+proj=latlong +ellps=WGS84 +datum=WGS84 +no_defs" status="on">
      <Parameter name="type">osm</Parameter>
      <Parameter name="file">/var/www/tc/osm/test.osm</Parameter>


<osm version='0.6' upload='true' generator='JOSM'>
  <node id='-186' action='modify' visible='true' lat='50.0' lon='50.0' />
  <node id='-184' action='modify' visible='true' lat='50.0' lon='-50.0' />
  <node id='-182' action='modify' visible='true' lat='-50.0' lon='-50.0' />
  <node id='-180' action='modify' visible='true' lat='-50.0' lon='50.0' />
  <way id='-91' action='modify' visible='true'>
    <nd ref='-186' />
    <nd ref='-184' />
    <nd ref='-182' />
    <nd ref='-180' />
    <nd ref='-186' />


var   map = new OpenLayers.Map ("map", {
                    new OpenLayers.Control.MousePosition(),                    
                maxResolution: 156543.0339,
                units: 'm',
                projection: new OpenLayers.Projection("EPSG:900913"),
                maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
                displayProjection: new OpenLayers.Projection("EPSG:4326")
            } );

var test = new OpenLayers.Layer.WMS( "test", "http://localhost/tc/tilecache.cgi?",
    {layers: 'level_1', format: 'image/png'}, { isBaseLayer: false} );
share|improve this question

you can do it on your tilecache.cfg configuration file to changing tms_type parameter to #tms_type=google... you can get some information here...

    Setting this to “google” will cause tiles to switch vertical order (that is, 
    following the Google style x/y pattern).

i hope it helps you...

share|improve this answer
that sound reasonable, but its not working. actually i dont have my layer at all. – user902383 May 28 '12 at 16:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.