Tilecache and MapServer

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

Tilecache and MapServer

zenzero-2001
Hello fellow tilecachers

I am in the process of implementing TileCache and OpenLayers with
MapServer on Debian Etch. I am serving three MapServer raster layers and
the Metacarta vmap0 layer. For the first stage I made sure that my
MapServer layers worked correctly in a standard MapServer interface.
Next, I went on to an OpenLayers interface and both the local MapServer
layers and the Metacarta layer were correctly displayed.

Most recently, I have tried to add Tilecache into the mix, but I cannot
get it to work with my local MapServer layers; however, it does work
with the Metacarta layer. When trying to display a MapServer layer all
that appears are broken links where the tiles should be. I have checked
my installation of python mapscript with a 'Hello World' program and
this appears to work fine. The fact that the Metacarta layer is
displayed seems to imply that all the file and directory permissions are
ok and that apache has permission to run cgi scripts in the appropriate
directory. I have checked the apache logs and cannot find anything
wrong. In tilecache.cgi I have references to my layers, for example a
MapServer layer:

[land]
type=MapServerLayer
layers=land
mapfile=/var/www/gbhgis/demo.map

And the Metacarta layer that does work:

[vmap0]
type=WMSLayer
url=http://labs.metacarta.com/wms/vmap0

These layers are themselves referenced to by index.html like so:

var baseLayerLUS = new OpenLayers.Layer.WMS("1930s Land Utilisation",
document.location+"tilecache.cgi?", {layers: "land", format: "image/png"
}, {projection: "none"});
var openLayersWMS = new OpenLayers.Layer.WMS("OpenLayers WMS",
document.location+"tilecache.cgi?", {layers: "vmap0", format:
"image/png" });


I am a bit stumped at the moment. Any ideas or advice on what could be
wrong would be greatly appreciated. I did notice that there is a
separate debian directory in the tilecache directory, perhaps this is a
clue? Or a red herring?

Thanks,

Regards,

John W.


_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

Christopher Schmidt-2
On Fri, Apr 27, 2007 at 03:37:57PM +0100, John Westwood wrote:

> Most recently, I have tried to add Tilecache into the mix, but I cannot
> get it to work with my local MapServer layers; however, it does work
> with the Metacarta layer. When trying to display a MapServer layer all
> that appears are broken links where the tiles should be. I have checked
> my installation of python mapscript with a 'Hello World' program and
> this appears to work fine. The fact that the Metacarta layer is
> displayed seems to imply that all the file and directory permissions are
> ok and that apache has permission to run cgi scripts in the appropriate
> directory. I have checked the apache logs and cannot find anything
> wrong. In tilecache.cgi I have references to my layers, for example a
> MapServer layer:

> I am a bit stumped at the moment. Any ideas or advice on what could be
> wrong would be greatly appreciated. I did notice that there is a
> separate debian directory in the tilecache directory, perhaps this is a
> clue? Or a red herring?

We're currenty working on getting TileCache into Debian proper, but this
shouldn't affect you.

If you right click on a 'pink' image, and view it in your browser, you
should get a more informative error message. If you can do this, and
then report back on the error message -- or even better, paste/post a
URL that's giving you trouble so that it can be looked at, that would be
helpful.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

Tim Langlois
In reply to this post by zenzero-2001
I've had similar problems.  I successfully implemented Openlayers +
TileCache + MapServer on a RHEL4 box.   However, I tried the same
installation on a newer Fedora Core 5 box and ran into difficulties.
The same as you, I verified that MapServer and Openlayers work
correctly, but when I try to put TileCache into the mix, I get the pink
tiles.  I am beginning to think the version of python may be the
culprit. (FC5 comes with a much newer version).  

Openlayers may disguise any Python errors you are seeing, but if you
take the actual image url from the pink tile and run it in a separate
browser, you may see some python errors which may point you to a
solution.  This is the only advice I can offer right now.

Tim L


On Fri, 2007-04-27 at 15:37 +0100, John Westwood wrote:

> Hello fellow tilecachers
>
> I am in the process of implementing TileCache and OpenLayers with
> MapServer on Debian Etch. I am serving three MapServer raster layers and
> the Metacarta vmap0 layer. For the first stage I made sure that my
> MapServer layers worked correctly in a standard MapServer interface.
> Next, I went on to an OpenLayers interface and both the local MapServer
> layers and the Metacarta layer were correctly displayed.
>
> Most recently, I have tried to add Tilecache into the mix, but I cannot
> get it to work with my local MapServer layers; however, it does work
> with the Metacarta layer. When trying to display a MapServer layer all
> that appears are broken links where the tiles should be. I have checked
> my installation of python mapscript with a 'Hello World' program and
> this appears to work fine. The fact that the Metacarta layer is
> displayed seems to imply that all the file and directory permissions are
> ok and that apache has permission to run cgi scripts in the appropriate
> directory. I have checked the apache logs and cannot find anything
> wrong. In tilecache.cgi I have references to my layers, for example a
> MapServer layer:
>
> [land]
> type=MapServerLayer
> layers=land
> mapfile=/var/www/gbhgis/demo.map
>
> And the Metacarta layer that does work:
>
> [vmap0]
> type=WMSLayer
> url=http://labs.metacarta.com/wms/vmap0
>
> These layers are themselves referenced to by index.html like so:
>
> var baseLayerLUS = new OpenLayers.Layer.WMS("1930s Land Utilisation",
> document.location+"tilecache.cgi?", {layers: "land", format: "image/png"
> }, {projection: "none"});
> var openLayersWMS = new OpenLayers.Layer.WMS("OpenLayers WMS",
> document.location+"tilecache.cgi?", {layers: "vmap0", format:
> "image/png" });
>
>
> I am a bit stumped at the moment. Any ideas or advice on what could be
> wrong would be greatly appreciated. I did notice that there is a
> separate debian directory in the tilecache directory, perhaps this is a
> clue? Or a red herring?
>
> Thanks,
>
> Regards,
>
> John W.
>
>
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache
>

The information transmitted is the property of Archetype, Inc. and is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Statements and opinions expressed in this e-mail may not represent those of the company.  Any review, retransmission, dissemination and other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, received late or incomplete, or could contain viruses. The sender therefore does not accept liability for any error or omission in the contents of this message, which arises as a result of e-mail transmission.

_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
In reply to this post by Christopher Schmidt-2
Hi Christopher,

I did try right clicking on the broken link before, but it did not mean
a lot to me - although I know it to be a WMS request. Anyway, here is an
example of a broken link location:

http://148.197.55.226/tilecache-1.7/tilecache.cgi?LAYERS=land&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=-11.25%2C45%2C0%2C56.25&WIDTH=256&HEIGHT=256


The tilecache version url is:

http://148.197.55.226/tilecache-1.7/ 

And the non-tilecache version url is:

http://148.197.55.226/gbhgis/mapserver.html 

Regards,

John W.


_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
In reply to this post by Tim Langlois
Hi Tim,

I tried that but the browser asks me about opening tilecache.cgi .
Obviously I need to execute it, but not sure how.

John W.



================================
John Westwood
Research Assistant
Great Britain Historical GIS Project
Department of Geography, University of Portsmouth
Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
 
GIS Project Office: (023) 9284 2500


>>> Tim Langlois <[hidden email]> 27/04/2007 21:22 >>>
I've had similar problems.  I successfully implemented Openlayers +
TileCache + MapServer on a RHEL4 box.   However, I tried the same
installation on a newer Fedora Core 5 box and ran into difficulties.
The same as you, I verified that MapServer and Openlayers work
correctly, but when I try to put TileCache into the mix, I get the
pink
tiles.  I am beginning to think the version of python may be the
culprit. (FC5 comes with a much newer version).  

Openlayers may disguise any Python errors you are seeing, but if you
take the actual image url from the pink tile and run it in a separate
browser, you may see some python errors which may point you to a
solution.  This is the only advice I can offer right now.

Tim L

_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

Christopher Schmidt-2
In reply to this post by zenzero-2001
On Mon, Apr 30, 2007 at 04:14:10PM +0100, John Westwood wrote:
> Hi Christopher,
>
> I did try right clicking on the broken link before, but it did not mean
> a lot to me - although I know it to be a WMS request. Anyway, here is an
> example of a broken link location:

Your machine has not been accessible to me since you sent your original
email. I've tried to access it more than a dozen times. Can you copy the
*content* of that URL and send it to the mailing list?w
Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

Christopher Schmidt-2
In reply to this post by zenzero-2001
On Mon, Apr 30, 2007 at 04:21:02PM +0100, John Westwood wrote:
> Hi Tim,
>
> I tried that but the browser asks me about opening tilecache.cgi .
> Obviously I need to execute it, but not sure how.

Ah! Okay, this makes more sense. You probably don't have CGI execution
enabled for the directory in question.
http://httpd.apache.org/docs/1.3/howto/cgi.html#cgioutsideofscriptaliasdirectories
is probably good for learning how to do that.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
In reply to this post by Christopher Schmidt-2
Hi Christopher,

Sorry about that. It must be the firewall, I should have known better.
Here is the content of index.html


<html>
    <head>
        <style type="text/css">
            #map {
                width: 75%;
                height: 80%;
                border: 1px solid black;
            }
        </style>

    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">

    function init(){
            // Define the map start position
//            var lon = -3.0;
//            var lat = 55.0;
//    var zoom = 5;
            var lon = 0.0;
            var lat = 0.0;
            var zoom = 1;


            // Create the map object
            var map = new OpenLayers.Map('map', {controls: [new
OpenLayers.Control.PanZoomBar()]});


            // Create the map layer objects
            var baseLayer19th = new OpenLayers.Layer.WMS(
                "Nineteenth Century",
                document.location+"tilecache.cgi?",
                {layers: "nineteenth", format: "image/png"},
                {projection: "none"});

            var baseLayer20th = new OpenLayers.Layer.WMS(
                "Twentieth Century",
                document.location+"tilecache.cgi?",
                {layers: "twentieth", format: "image/png"},
                {projection: "none"});

            var baseLayerLUS = new OpenLayers.Layer.WMS(
                "1930s Land Utilisation",
                document.location+"tilecache.cgi?",
                {layers: "land", format: "image/png"},
                {projection: "none"});

            var openLayersWMS = new OpenLayers.Layer.WMS(
                "OpenLayers WMS",
                document.location+"tilecache.cgi?",
                {layers: "vmap0", format: "image/png" });


            // Add the layers to the map
            map.addLayers([openLayersWMS, baseLayer19th, baseLayer20th,
baseLayerLUS]);

            // Set the start position
            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

            // Add the map controls
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.MouseToolbar());
     }

        </script>
  </head>

  <body onload="init()">

    <title>Tilecache Test</title>
    <div id="map"></div>
  </body>

</html>


Thanks for being patient.

Regards,

John W.

================================
John Westwood
Research Assistant
Great Britain Historical GIS Project
Department of Geography, University of Portsmouth
Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
 
GIS Project Office: (023) 9284 2500


>>> Christopher Schmidt <[hidden email]> 04/30/07 4:52 pm >>>
On Mon, Apr 30, 2007 at 04:14:10PM +0100, John Westwood wrote:
> Hi Christopher,
>
> I did try right clicking on the broken link before, but it did not
mean
> a lot to me - although I know it to be a WMS request. Anyway, here is
an
> example of a broken link location:

Your machine has not been accessible to me since you sent your
original
email. I've tried to access it more than a dozen times. Can you copy
the
*content* of that URL and send it to the mailing list?w
Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
In reply to this post by Christopher Schmidt-2
Hi Christopher,

I don't think it is that because I have added:

<Directory /var/www/tilecache-1.7>
    AddHandler cgi-script .cgi
    Options +ExecCGI
</Directory>

to httpd.conf

Regards,

John W.

================================
John Westwood
Research Assistant
Great Britain Historical GIS Project
Department of Geography, University of Portsmouth
Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
 
GIS Project Office: (023) 9284 2500


>>> Christopher Schmidt <[hidden email]> 04/30/07 4:52 pm >>>
On Mon, Apr 30, 2007 at 04:14:10PM +0100, John Westwood wrote:
> Hi Christopher,
>
> I did try right clicking on the broken link before, but it did not
mean
> a lot to me - although I know it to be a WMS request. Anyway, here is
an
> example of a broken link location:

Your machine has not been accessible to me since you sent your
original
email. I've tried to access it more than a dozen times. Can you copy
the
*content* of that URL and send it to the mailing list?w
Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
In reply to this post by zenzero-2001
Hi Tim,

Looking at tilecache.cgi with a text editor reveals the following
error:

msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must
be valid for all requested layers.

Which seems to indicate that there is a problem with the projection. In
the index html file I have set projection: "none" for each of the
MapServer layers. This worked fine when just using OpenLayers without
TileCache. If I specified "epsg:4326" when just using OpenLayers then I
would receive a similar error, but not if I specified "none".

Maybe I should try specifying "epsg:4326" in index.html

Regards,

John W.


================================
John Westwood
Research Assistant
Great Britain Historical GIS Project
Department of Geography, University of Portsmouth
Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
 
GIS Project Office: (023) 9284 2500


>>> Tim Langlois <[hidden email]> 04/30/07 4:27 pm >>>
Hmmm, try opening it with a text editor and see what it shows.  When
it
works correctly it returns an image; otherwise it should return some
text error message.

On Mon, 2007-04-30 at 16:21 +0100, John Westwood wrote:

> Hi Tim,
>
> I tried that but the browser asks me about opening tilecache.cgi .
> Obviously I need to execute it, but not sure how.
>
> John W.
>
>
>
> ================================
> John Westwood
> Research Assistant
> Great Britain Historical GIS Project
> Department of Geography, University of Portsmouth
> Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
>  
> GIS Project Office: (023) 9284 2500
>
>
> >>> Tim Langlois <[hidden email]> 27/04/2007 21:22 >>>
> I've had similar problems.  I successfully implemented Openlayers +
> TileCache + MapServer on a RHEL4 box.   However, I tried the same
> installation on a newer Fedora Core 5 box and ran into difficulties.
> The same as you, I verified that MapServer and Openlayers work
> correctly, but when I try to put TileCache into the mix, I get the
> pink
> tiles.  I am beginning to think the version of python may be the
> culprit. (FC5 comes with a much newer version).  
>
> Openlayers may disguise any Python errors you are seeing, but if you
> take the actual image url from the pink tile and run it in a
separate
> browser, you may see some python errors which may point you to a
> solution.  This is the only advice I can offer right now.
>
> Tim L
>
>

The information transmitted is the property of Archetype, Inc. and is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. Statements and opinions
expressed in this e-mail may not represent those of the company.  Any
review, retransmission, dissemination and other use of, or taking of any
action in reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received this in
error, please contact the sender immediately and delete the material
from any computer. E-mail transmission cannot be guaranteed to be
secured or error-free as information could be intercepted, corrupted,
lost, destroyed, received late or incomplete, or could contain viruses.
The sender therefore does not accept liability for any error or omission
in the contents of this message, which arises as a result of e-mail
transmission.

_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

Christopher Schmidt-2
On Mon, Apr 30, 2007 at 05:08:52PM +0100, John Westwood wrote:
> Hi Tim,
>
> Looking at tilecache.cgi with a text editor reveals the following
> error:

John --

The first step to getting TileCache working is getting WMS working via
MapServer. You should first set up a WMS layer talking directly to the
MapServer in OpenLayers. Once you have that working, you can move on to
the next step.

The MapServer documentation has information on setting up a mapfile for
use by a WMS client -- the MapServer layer in OpenLayers does not need
full WMS layer support, but TileCache, as a WMS client, does. So does
the Layer.WMS in OpenLayers, so if you get it working there, TileCache
should be all set.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Tilecache and MapServer

zenzero-2001
Hi Christopher,

Thanks for your help, it now works. I just had to set up MapServer as a
WMS server. I accomplished this by adding something similar to the
following to the WEB definition of my map file:

METADATA
   "wms_title" "My Global Map WMS Server"
   "wms_srs" "EPSG:4326"
END

The EPSG:4326 being longitude / latitude.

To make the layer available through WMS, I added something similar to
the following to the LAYER definitions:

METADATA
   "wms_title" "Layer Name"
END

Thanks!

John W.


================================
John Westwood
Research Assistant
Great Britain Historical GIS Project
Department of Geography, University of Portsmouth
Buckingham Building, Lion Terrace, Portsmouth PO1 3HE
 
GIS Project Office: (023) 9284 2500


>>> Christopher Schmidt <[hidden email]> 30/04/2007 17:19 >>>
On Mon, Apr 30, 2007 at 05:08:52PM +0100, John Westwood wrote:
> Hi Tim,
>
> Looking at tilecache.cgi with a text editor reveals the following
> error:

John --

The first step to getting TileCache working is getting WMS working via
MapServer. You should first set up a WMS layer talking directly to the
MapServer in OpenLayers. Once you have that working, you can move on
to
the next step.

The MapServer documentation has information on setting up a mapfile
for
use by a WMS client -- the MapServer layer in OpenLayers does not need
full WMS layer support, but TileCache, as a WMS client, does. So does
the Layer.WMS in OpenLayers, so if you get it working there, TileCache
should be all set.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache