Using TC to display PG tables in OL served with MS over GE

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Using TC to display PG tables in OL served with MS over GE

Gery
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hello

I'm new around here and using tilecache, so sorry for these simple questions. I want to use TileCache (TC) because I've heard this is a beautiful tool. The thing is that I have a simple application where I display PostGis (PG) tables in EPSG:4326 in OpenLayers (OL), where these tables are served by MapServer (MS) and they are lying over Google Earth (GE) maps as well as the basic OpenLayers WMS, OpenStreetMap and Global Imagery. This has worked quite nice so far, but I want to add TileCache to improve this application.

I've added the tilecache.wsgi suggested here and installed with easy_install the Paste and wsgiref suggested here.

After using this basic test, I can see the map and the 0.png is stored successfully in my /tmp/tilecache path. However, when I tried my own PG layer (the one displayed in OL), this doesn't appear nor the PNG in /tmp/tilecache directory. This is my setup:

--> /etc/httpd/conf/httpd.conf <--
<VirtualHost *:80>
...
# WSGI & TileCache
    WSGIScriptAlias /tilecache /var/www/html/mop/tilecache/tilecache.wsgi
...
</VirtualHost>

--> /var/www/html/mop/tilecache/tilecache.cfg <--
...
[seismic_profiles_line_wgs84]
type=WMS
url=http://localhost/cgi-bin/mapserv?map=/var/www/html/mop/map/moppg.map
extension=png
size=256,256
extent_type=loose
srs=EPSG:4326
layers=seismic_profiles_line_wgs84
##### setting in seismic_profiles_line_wgs84 #####
#filebounds=-82.6088,-18.3661266,-68.8800825782689,-1.18159615763331
#resolutions=0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,8.58306884765625e-05,4.291534423828125e-05,2.1457672119140625e-05,1.0728836059570312e-05,5.3644180297851562e-06,2.6822090148925781e-06,1.3411045074462891e-06
##################################################
##### setting in openlayers #####
bbox=-20037508.34,-20037508.34,20037508.34,20037508.34
resolutions=156543.03390000001,78271.516950000005,39135.758475000002,19567.879237500001,9783.9396187500006,4891.9698093750003,2445.9849046875001,1222.9924523437501,611.49622617187504,305.74811308593752,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.5546285339355475,4.7773142669677737,2.3886571334838869,1.1943285667419434,0.59716428337097172,0.29858214168548586
levels=20
maxResolution=156543.0339
#################################

--> index.html <--
...
new OpenLayers.Layer.WMS("Seismic profiles","http://www.example.com/tilecache?",
                {
                    layers: "seismic_profiles_line_wgs84",
                    format: "image/png"
                },
                {
                    isBaseLayer: false,
                    format: "image/png"
                }
                ),
...

I think this should work well but don't know what is missing, any help is appreciated,

Best regards,

Gery

PS. I'm using:
rhel 5
Apache 2 (rpm: httpd-2.2.3-43.el5)
Python 2.4 (rpm: python-2.4.3-27.el5)
mod_wsgi 3.3
TileCache 2.11 (tilecache-2.11.tar.gz)
Paste 1.7.5.1 (Paste-1.7.5.1-py2.4.egg/)
wsgiref 0.1.2 (wsgiref-0.1.2-py2.4.egg)
OpenLayers 2.11
MapServer 5.6.7
PostGis 1.5
Google Earth v3.6
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
This post has NOT been accepted by the mailing list yet.
sorry, I forgot to tell that after doing this (right click over the pink tile and selecting "view image"):

http://www.mop.org/tilecache?LAYERS=seismic_profiles_line_wgs84&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=-8922952.9326563,-1252344.27125,-8766409.89875,-1095801.2373437&WIDTH=256&HEIGHT=256

this error shows up:

An error occurred: can't find resolution index for 611.496226. Available resolutions are:
[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125, 8.58306884765625e-05, 4.291534423828125e-05, 2.1457672119140625e-05, 1.0728836059570312e-05, 5.3644180297851562e-06, 2.6822090148925781e-06, 1.3411045074462891e-06]
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
This post has NOT been accepted by the mailing list yet.
After deleting the tilecache/ directory from my root dir (ie. /var/www/html/mop) and rewriting the things about my layer in the new tilecache.cfg and copying a new tilecache.wsgi, I got black tiles after using getcapabilities, and the seismic_profiles_line_wgs84/ directory now appears in /tmp/tilecache with several directories but with only transparent PNGs. I'm wondering if this is a problem of permissions, because my tileache/ directory is in /var/www/html, I'll move this one and see what happens.
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
This post has NOT been accepted by the mailing list yet.
it seems there are no problems with permissions in /var/www/html, someone that could give some extra ideas please?
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
it seems also that this post is not getting the mailing list, I did all the steps to subscribe the list but still I'm getting this:

This message will be sent from gamejihou@hotmail.com to the tilecache@lists.osgeo.org mailing list.
You may need to subscribe to this mailing list for your message to be accepted.
Please respect mailing list etiquette:

    Quote what you reply to and trim it to only the relevant parts. This provides context for those who will read your message by email.
    Avoid small talk such as "Thank you", "Great"... You can send a private email if you want.

What is a "mailing list"?

Is someone else reading this post??
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
After several days on this getting transparent tiles as PNGs, I got this error in the apache log (/etc/httpd/logs/error_log)

[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8453323.83419,-1565430.34259,-8296780.80029,-1408887.30869, Tile: x: 74, y: 118, z: 8, time: 0.000178098678589, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8296780.80029,-1565430.34259,-8140237.76639,-1408887.30869, Tile: x: 75, y: 118, z: 8, time: 0.000138998031616, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8766409.90199,-1565430.34259,-8609866.86809,-1408887.30869, Tile: x: 72, y: 118, z: 8, time: 0.000137090682983, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8922952.93589,-1565430.34259,-8766409.90199,-1408887.30869, Tile: x: 71, y: 118, z: 8, time: 0.000151872634888, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9079495.96979,-1721973.37649,-8922952.93589,-1565430.34259, Tile: x: 70, y: 117, z: 8, time: 0.000137090682983, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8922952.93589,-1721973.37649,-8766409.90199,-1565430.34259, Tile: x: 71, y: 117, z: 8, time: 0.000167846679688, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8766409.90199,-1721973.37649,-8609866.86809,-1565430.34259, Tile: x: 72, y: 117, z: 8, time: 0.000139951705933, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8609866.86809,-1721973.37649,-8453323.83419,-1565430.34259, Tile: x: 73, y: 117, z: 8, time: 0.000118970870972, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8453323.83419,-1721973.37649,-8296780.80029,-1565430.34259, Tile: x: 74, y: 117, z: 8, time: 0.000113010406494, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8140237.76639,-1408887.30869,-7983694.73249,-1252344.27479, Tile: x: 76, y: 119, z: 8, time: 0.000144958496094, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8296780.80029,-1721973.37649,-8140237.76639,-1565430.34259, Tile: x: 75, y: 117, z: 8, time: 0.000133991241455, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8140237.76639,-1721973.37649,-7983694.73249,-1565430.34259, Tile: x: 76, y: 117, z: 8, time: 0.000121831893921, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8140237.76639,-1565430.34259,-7983694.73249,-1408887.30869, Tile: x: 76, y: 118, z: 8, time: 0.000123023986816, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8296780.80029,-1408887.30869,-8140237.76639,-1252344.27479, Tile: x: 75, y: 119, z: 8, time: 0.000144004821777, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8453323.83419,-1408887.30869,-8296780.80029,-1252344.27479, Tile: x: 74, y: 119, z: 8, time: 0.000117063522339, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8609866.86809,-1408887.30869,-8453323.83419,-1252344.27479, Tile: x: 73, y: 119, z: 8, time: 0.000133037567139, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8766409.90199,-1408887.30869,-8609866.86809,-1252344.27479, Tile: x: 72, y: 119, z: 8, time: 0.000148057937622, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8922952.93589,-1408887.30869,-8766409.90199,-1252344.27479, Tile: x: 71, y: 119, z: 8, time: 0.000128984451294, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9079495.96979,-1408887.30869,-8922952.93589,-1252344.27479, Tile: x: 70, y: 119, z: 8, time: 0.000117063522339, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9236039.00369,-1408887.30869,-9079495.96979,-1252344.27479, Tile: x: 69, y: 119, z: 8, time: 0.000138998031616, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9236039.00369,-1565430.34259,-9079495.96979,-1408887.30869, Tile: x: 69, y: 118, z: 8, time: 0.000123023986816, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8609866.86809,-1565430.34259,-8453323.83419,-1408887.30869, Tile: x: 73, y: 118, z: 8, time: 0.000136137008667, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9236039.00369,-1721973.37649,-9079495.96979,-1565430.34259, Tile: x: 69, y: 117, z: 8, time: 0.00012993812561, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8922952.93589,-1878516.41039,-8766409.90199,-1721973.37649, Tile: x: 71, y: 116, z: 8, time: 0.000126123428345, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9079495.96979,-1878516.41039,-8922952.93589,-1721973.37649, Tile: x: 70, y: 116, z: 8, time: 0.000138998031616, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8766409.90199,-1878516.41039,-8609866.86809,-1721973.37649, Tile: x: 72, y: 116, z: 8, time: 0.000124931335449, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8609866.86809,-1878516.41039,-8453323.83419,-1721973.37649, Tile: x: 73, y: 116, z: 8, time: 0.000185966491699, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9079495.96979,-1565430.34259,-8922952.93589,-1408887.30869, Tile: x: 70, y: 118, z: 8, time: 0.000138998031616, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9236039.00369,-1878516.41039,-9079495.96979,-1721973.37649, Tile: x: 69, y: 116, z: 8, time: 0.000123023986816, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8453323.83419,-1878516.41039,-8296780.80029,-1721973.37649, Tile: x: 74, y: 116, z: 8, time: 0.000151872634888, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8296780.80029,-1878516.41039,-8140237.76639,-1721973.37649, Tile: x: 75, y: 116, z: 8, time: 0.000149965286255, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8140237.76639,-1878516.41039,-7983694.73249,-1721973.37649, Tile: x: 76, y: 116, z: 8, time: 0.000125885009766, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -7983694.73249,-1878516.41039,-7827151.69859,-1721973.37649, Tile: x: 77, y: 116, z: 8, time: 0.000150203704834, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -7983694.73249,-1565430.34259,-7827151.69859,-1408887.30869, Tile: x: 77, y: 118, z: 8, time: 0.000125885009766, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -7983694.73249,-1721973.37649,-7827151.69859,-1565430.34259, Tile: x: 77, y: 117, z: 8, time: 0.000149965286255, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -7983694.73249,-1408887.30869,-7827151.69859,-1252344.27479, Tile: x: 77, y: 119, z: 8, time: 0.000142812728882, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -7983694.73249,-1252344.27479,-7827151.69859,-1095801.24089, Tile: x: 77, y: 120, z: 8, time: 0.000127077102661, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8140237.76639,-1252344.27479,-7983694.73249,-1095801.24089, Tile: x: 76, y: 120, z: 8, time: 0.000130176544189, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8296780.80029,-1252344.27479,-8140237.76639,-1095801.24089, Tile: x: 75, y: 120, z: 8, time: 0.000136137008667, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8453323.83419,-1252344.27479,-8296780.80029,-1095801.24089, Tile: x: 74, y: 120, z: 8, time: 9.29832458496e-05, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8609866.86809,-1252344.27479,-8453323.83419,-1095801.24089, Tile: x: 73, y: 120, z: 8, time: 0.000131845474243, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8766409.90199,-1252344.27479,-8609866.86809,-1095801.24089, Tile: x: 72, y: 120, z: 8, time: 0.000133037567139, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -8922952.93589,-1252344.27479,-8766409.90199,-1095801.24089, Tile: x: 71, y: 120, z: 8, time: 0.000125169754028, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9079495.96979,-1252344.27479,-8922952.93589,-1095801.24089, Tile: x: 70, y: 120, z: 8, time: 8.89301300049e-05, debug: True
[Mon Nov 05 11:55:05 2012] [error] Cache hit: -9236039.00369,-1252344.27479,-9079495.96979,-1095801.24089, Tile: x: 69, y: 120, z: 8, time: 0.000124931335449, debug: True

I know the big numbers are the layer extent (by tiles I think), but what means the x, y and z? I think this is why the layers are not being displayed. Any idea is much appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
Now after zooming into the map (whatever area), I got the image, so tilecache is working properly, but I get this in the apache error log:

[Mon Nov 05 12:35:46 2012] [error] Cache miss: -8805545.66046,-1526294.58411,-8766409.90199,-1487158.82564, Tile: x: 287, y: 473, z: 10, time: 0.0658960342407

If I click the openlayers permalink (default zoom in html) I get nothing, where could the problem be?
Reply | Threaded
Open this post in threaded view
|

Re: Using TC to display PG tables in OL served with MS over GE

Gery
This post was updated on .
I've been testing things in my MAP file about projections and after playing with the resolution bar of the openlayers I noticed that the layer displays correctly in all the 20 resolution levels I have, except in the 611.4962261962891, it's really strange, any ideas?