1

Imported data by using Osm2pgsql, to get rid off all problems related to data conversion, I stored this as latlong (-l parameter). I created a stylesheet, and I tested with Python script and it was working (so both data and stylesheet should be fine).

Here comes problem... when I tried to use it with OpenLayers, I got my basic layer covered by pinkish "image not found" tile, but when I try to access tile by calling cgi script "http://localhost/tc/tilecache.cgi/1.0.0/osm/5/31/26.png" I have a nicely generated tile.

Does any one have idea what I'm doing wrong?

files:

osm.xml

<Map background-color="#00000000" srs="+proj=latlong +datum=WGS84">
  <Style name="roadStyle">
    <Rule>
      <LineSymbolizer stroke="#ff0000" stroke-width="100" />
    </Rule>
  </Style>
  <Layer name="roads" srs="+proj=latlong +datum=WGS84">
    <StyleName>roadStyle</StyleName>
      <Datasource>
       <Parameter name="table">
       (select way,highway from planet_osm_line where highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified') order by z_order) as roads
       </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="user">www-data</Parameter>
      <Parameter name="password">gis</Parameter>
      <Parameter name="dbname">gis</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
</Map>

tilecatche.cfg

[cache]
type=Disk
base=/tmp/tilecache

[osm]
type=Mapnik
mapfile=/var/www/tc/osm/osm.xml
extension=png

[basic]
type=WMS
url=http://labs.metacarta.com/wms/vmap0
extension=png

Definition of my layers:

var map = new OpenLayers.Map('map',
      {
        numZoomLevels: 12,
        projection: new OpenLayers.Projection("EPSG:4326"),
        displayProjection: new OpenLayers.Projection("EPSG:4326")
      });    
var layer = new OpenLayers.Layer.WMS( "VMap0", 
        "tilecache.cgi?", {layers: 'basic', format: 'image/png' } );
var tms = new OpenLayers.Layer.WMS( "osm","tilecache/tilecache.cgi?",
      { layers:'osm',  format: 'image/png'},{ isBaseLayer: false}  );  
1

Not enough reputation so can't add a comment.

There can be multiple reasons behind it,

Firstly, did you check the server logs? Apache for instance. Might be an issue with the permissions.

Also, I am not much aware of TileCache have been using ModTile and Renderd (http://wiki.openstreetmap.org/wiki/Mod_tile) so not aware of the logging of TileCache. Can you check tilecache logs?

Also, make sure you have configured your server (Apache in my case) properly with TileCache

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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