TileCache and MapWarper WMS

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

TileCache and MapWarper WMS

krisbulman
I am running an instance of Tim Waters' 'Map Warper', which warps maps and creates a WMS source.

How can I plug this into tilecache to create a cache of tiles from the source? I need to display this image as a tilecached image over a WMS map such as OpenLayers.

I need specific WMS layer information to put into tilecache.cfg, I've been able to get another WMS source working, but not this one.

Here is an example of the data I have:

KML
http://mapserver.bulman.ca/maps/11.kml

Warped Image
http://mapserver.bulman.ca/mapimages/dst/11.tif.png

Associated AUX XML
http://mapserver.bulman.ca/mapimages/dst/11.tif.png.aux.xml

WMS Link
http://mapserver.bulman.ca/maps/wms/11

WMS link suitable for JOSM OpenStreetMap Editor
http://mapserver.bulman.ca/maps/wms/11?request=GetMap&version=1.1.1&styles=&format=image/png&srs=epsg:4326&exceptions=application/vnd.ogc.se_inimage&

Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
It looks like I might be able to pull most the information out of the KML for the config options:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Folder>
    <open>1</open>
    <name>Map Warper Cascumpec</name>
    <description>Containing warped images and maps.</description>
    <GroundOverlay>
      <name>Cascumpec</name>
      <description></description>
      <Icon>
        <href>
         
<![CDATA[http://mapserver.bulman.ca/cgi/mapserv.fcgi?map=/var/mapwarper/db/mapfiles/11.map&layers=11&request=GetMap&version=1.1.1&styles=&format=image/png&srs=epsg:4326&exceptions=application/vnd.ogc.se_inimage&WIDTH=1022&HEIGHT=817&bbox=-64.0760552,46.7809782,-64.0422050,46.8061421]]>

        </href>
      </Icon>
      <LatLonBox>
        <north>46.8061421</north>
        <south>46.7809782</south>
        <east>-64.0422050</east>
        <west>-64.0760552</west>
        <rotation>0</rotation>
      </LatLonBox>
    </GroundOverlay>
  </Folder>

Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
oops, seems I got the WMS to work with:

[map_30]
type=WMS
url=http://mapserver.bulman.ca/cgi/mapserv.fcgi?map=/var/mapwarper/db/mapfiles/11.map
layers=11
extension=png
size=256,256
bbox=-64.0760552,46.7809782,-64.0422050,46.8061421
srs=EPSG:4326
levels=20

&

var layer3 = new OpenLayers.Layer.TMS("map_30",
                "tilecache.cgi/", {
                    serviceVersion: "1.0.0",
                    layername: "map_30",
                    type: "png" });



Which displays as a But what I'm actually looking for is a TMS Overlay, so it displays ontop of an existing WMS with 4326 projection..
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
ok, accomplished this by adding "isBaseLayer: false", but it still doesn't look right.. it's on the map, but not placed in the right coords.. what do I have to do to set the lat/long or filebounds?

            var layer3 = new OpenLayers.Layer.TMS("map_30",
                "tilecache.cgi/", {
                    serviceVersion: "1.0.0",
                    layername: "map_30",
                    type: "png",
                    isBaseLayer: false
       });
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
ok.. looks like the .map file holds all the info i need..

now it displays on the map in the right location, it;s just about an inch off to the right...
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
forgot to mention i removed bbox info in the cfg to get it to display
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
Can someone tell me if I'm at least doing this the right way?

config:

[map_30]
type=WMS
url=http://mapserver.bulman.ca/cgi/mapserv.fcgi?map=/var/mapwarper/db/mapfiles/11.map
layers=11
extension=png
size=256,256
srs=EPSG:4326


openlayers.html:
            var layer3 = new OpenLayers.Layer.TMS("map_30",
                "tilecache.cgi/", {
                    serviceVersion: "1.0.0",
                    layername: "map_30",
                    type: "png",
                    reproject: false,
                    isBaseLayer: false
       });
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
i notice that now the link which should show the full map now displays nothing

http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi/1.0.0/map_30/0/0/0.png

here is my map file 11.map

MAP
  NAME "Map Warper"
  SIZE 256 256
  EXTENT -180 -90 180 90
  IMAGETYPE png
  #INTERLACE OFF
  UNITS DD

  PROJECTION
"init=epsg:4326"
  END

  WEB
    IMAGEPATH "/tmp"
    METADATA
      "wms_title"     "Map Warper WMS"
      "wms_srs"       "EPSG:4269 EPSG:4326 EPSG:900913"
    END
  END


 LAYER
    NAME '11_original'
    TYPE RASTER
    DATA '/var/lib/maps/src/4011-56x93cm-CascmpcPt-med.jpg.tif'
    METADATA
      'wms_title' 'Cascumpec. Original.'
    END
    STATUS ON
    TRANSPARENCY 100
    PROJECTION
        'init=epsg:4326'
    END
 END



  LAYER
    NAME '11'
    TYPE RASTER
    DATA '/var/mapwarper/public/mapimages/dst/11.tif'
    METADATA
      'wms_title' 'Cascumpec'
    END
    STATUS ON
    TRANSPARENCY 100
    PROJECTION
        'init=epsg:4326'
    END
 END



  OUTPUTFORMAT
    NAME GEOTIFF
    DRIVER "GDAL/GTiff"
    MIMETYPE "image/tiff"
    IMAGEMODE "BYTE"
    EXTENSION "tif"
  END
  OUTPUTFORMAT
    NAME "png"
    DRIVER "GD/PNG"
    IMAGEMODE "rgba"
    EXTENSION "png"
    MIMETYPE "image/png"
    IMAGEMODE RGBA
    TRANSPARENT on
  END
  OUTPUTFORMAT
    NAME "png8"
    DRIVER "GD/PNG"
    IMAGEMODE "rgba"
    EXTENSION "png"
    MIMETYPE "image/png"
    TRANSPARENT on
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_DITHER=ON"
    FORMATOPTION "QUANTIZE_COLORS=250"
  END
  OUTPUTFORMAT
    NAME "gif"
    DRIVER "GD/GIF"
    MIMETYPE "image/gif"
    IMAGEMODE PC256
    EXTENSION "gif"
    TRANSPARENT ON
  END
END
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
anyone?
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

manel.clos
In reply to this post by krisbulman
Hi,

I've just checked your wms server and if the url for asking for the whole map is correct, it shows a blank tile.

http://mapserver.bulman.ca/cgi/mapserv.fcgi?map=/var/mapwarper/db/mapfiles/11.map&request=GetMap&Service=WMS&BBOX=-180,-90,180,90&version=1.1.1&layers=11&srs=epsg:4326&format=image/png&height=256&width=256

Can you check that the above is correct and your wms server setup is ok?


> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre de krisbulman
> Enviado el: jueves, 29 de abril de 2010 17:48
> Para: [hidden email]
> Asunto: [Tilecache] Re: TileCache and MapWarper WMS
>
>
> i notice that now the link which should show the full map now displays
> nothing
>
> http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi/1.0.0/m
> ap_30/0/0/0.png
>
> here is my map file 11.map
>
> MAP
>   NAME "Map Warper"
>   SIZE 256 256
>   EXTENT -180 -90 180 90
>   IMAGETYPE png
>   #INTERLACE OFF
>   UNITS DD
>
>   PROJECTION
> "init=epsg:4326"
>   END
>
>   WEB
>     IMAGEPATH "/tmp"
>     METADATA
>       "wms_title"     "Map Warper WMS"
>       "wms_srs"       "EPSG:4269 EPSG:4326 EPSG:900913"
>     END
>   END
>
>
>  LAYER
>     NAME '11_original'
>     TYPE RASTER
>     DATA '/var/lib/maps/src/4011-56x93cm-CascmpcPt-med.jpg.tif'
>     METADATA
>       'wms_title' 'Cascumpec. Original.'
>     END
>     STATUS ON
>     TRANSPARENCY 100
>     PROJECTION
>         'init=epsg:4326'
>     END
>  END
>
>
>
>   LAYER
>     NAME '11'
>     TYPE RASTER
>     DATA '/var/mapwarper/public/mapimages/dst/11.tif'
>     METADATA
>       'wms_title' 'Cascumpec'
>     END
>     STATUS ON
>     TRANSPARENCY 100
>     PROJECTION
>         'init=epsg:4326'
>     END
>  END
>
>
>
>   OUTPUTFORMAT
>     NAME GEOTIFF
>     DRIVER "GDAL/GTiff"
>     MIMETYPE "image/tiff"
>     IMAGEMODE "BYTE"
>     EXTENSION "tif"
>   END
>   OUTPUTFORMAT
>     NAME "png"
>     DRIVER "GD/PNG"
>     IMAGEMODE "rgba"
>     EXTENSION "png"
>     MIMETYPE "image/png"
>     IMAGEMODE RGBA
>     TRANSPARENT on
>   END
>   OUTPUTFORMAT
>     NAME "png8"
>     DRIVER "GD/PNG"
>     IMAGEMODE "rgba"
>     EXTENSION "png"
>     MIMETYPE "image/png"
>     TRANSPARENT on
>     FORMATOPTION "QUANTIZE_FORCE=ON"
>     FORMATOPTION "QUANTIZE_DITHER=ON"
>     FORMATOPTION "QUANTIZE_COLORS=250"
>   END
>   OUTPUTFORMAT
>     NAME "gif"
>     DRIVER "GD/GIF"
>     MIMETYPE "image/gif"
>     IMAGEMODE PC256
>     EXTENSION "gif"
>     TRANSPARENT ON
>   END
> END
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/TileCache-and-MapWarper
> -WMS-tp4971402p4980727.html
> Sent from the TileCache mailing list archive at Nabble.com.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/tilecache
>
_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
mapserver appears to be working fine, as I can view the map in openlayers with the tilecache settings I posted:

http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi/1.0.0/map_30/10/659/778.png

If you zoom into the Western Tip of Prince Edward Island, Canada you will see the offset overlay of the map
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
sorry the openlayers implementation is here:

http://mapserver.bulman.ca/cgi/tilecache/
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

manel.clos
In reply to this post by krisbulman
Hi,

This is right, as you are asking for the map_30 layer, which only contains your "11" image.

So,

World image:
http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi?LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-64.3359375,46.7578125,-63.984375,47.109375&WIDTH=256&HEIGHT=256

"11" image:
http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi?LAYERS=map_30&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-64.3359375,46.7578125,-63.984375,47.109375&WIDTH=256&HEIGHT=256


> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre de krisbulman
> Enviado el: jueves, 29 de abril de 2010 17:48
> Para: [hidden email]
> Asunto: [Tilecache] Re: TileCache and MapWarper WMS
>
>
> i notice that now the link which should show the full map now displays
> nothing
>
> http://mapserver.bulman.ca/cgi/tilecache/tilecache.cgi/1.0.0/m
> ap_30/0/0/0.png
>
> here is my map file 11.map
>
> MAP
>   NAME "Map Warper"
>   SIZE 256 256
>   EXTENT -180 -90 180 90
>   IMAGETYPE png
>   #INTERLACE OFF
>   UNITS DD
>
>   PROJECTION
> "init=epsg:4326"
>   END
>
>   WEB
>     IMAGEPATH "/tmp"
>     METADATA
>       "wms_title"     "Map Warper WMS"
>       "wms_srs"       "EPSG:4269 EPSG:4326 EPSG:900913"
>     END
>   END
>
>
>  LAYER
>     NAME '11_original'
>     TYPE RASTER
>     DATA '/var/lib/maps/src/4011-56x93cm-CascmpcPt-med.jpg.tif'
>     METADATA
>       'wms_title' 'Cascumpec. Original.'
>     END
>     STATUS ON
>     TRANSPARENCY 100
>     PROJECTION
>         'init=epsg:4326'
>     END
>  END
>
>
>
>   LAYER
>     NAME '11'
>     TYPE RASTER
>     DATA '/var/mapwarper/public/mapimages/dst/11.tif'
>     METADATA
>       'wms_title' 'Cascumpec'
>     END
>     STATUS ON
>     TRANSPARENCY 100
>     PROJECTION
>         'init=epsg:4326'
>     END
>  END
>
>
>
>   OUTPUTFORMAT
>     NAME GEOTIFF
>     DRIVER "GDAL/GTiff"
>     MIMETYPE "image/tiff"
>     IMAGEMODE "BYTE"
>     EXTENSION "tif"
>   END
>   OUTPUTFORMAT
>     NAME "png"
>     DRIVER "GD/PNG"
>     IMAGEMODE "rgba"
>     EXTENSION "png"
>     MIMETYPE "image/png"
>     IMAGEMODE RGBA
>     TRANSPARENT on
>   END
>   OUTPUTFORMAT
>     NAME "png8"
>     DRIVER "GD/PNG"
>     IMAGEMODE "rgba"
>     EXTENSION "png"
>     MIMETYPE "image/png"
>     TRANSPARENT on
>     FORMATOPTION "QUANTIZE_FORCE=ON"
>     FORMATOPTION "QUANTIZE_DITHER=ON"
>     FORMATOPTION "QUANTIZE_COLORS=250"
>   END
>   OUTPUTFORMAT
>     NAME "gif"
>     DRIVER "GD/GIF"
>     MIMETYPE "image/gif"
>     IMAGEMODE PC256
>     EXTENSION "gif"
>     TRANSPARENT ON
>   END
> END
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/TileCache-and-MapWarper
> -WMS-tp4971402p4980727.html
> Sent from the TileCache mailing list archive at Nabble.com.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/tilecache
>
_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: TileCache and MapWarper WMS

krisbulman
Here is the permalink to the location

http://mapserver.bulman.ca/cgi/tilecache/?zoom=13&lat=46.79634&lon=-64.07004&layers=B0T0

If you turn the map_30 layer on/off, you'll notice that it's shifted to the right of where it should be.

However if you preview the rectified image in mapwarper, the image is in the correct location..

http://mapserver.bulman.ca/maps/preview/11