[mapserver-dev] Communicating Tile Coordinates Between Mapcache and Mapserver

thomas bonfort thomas.bonfort at gmail.com
Wed Jun 24 10:35:11 PDT 2015


Mapcache queries the source as a wms getmap request, not as a tiled one.
Remove the 'tile' dimension from your tileset, and the mode=tile and all
the tile*= parameters from your mapcache source URL.
Thomas
On Jun 24, 2015 00:09, "seandisanti" <sdisanti at orionnetworksolutions.com>
wrote:

> I have a page that currently successfully requests tiles from Mapserver
> 6.0.3. The working request looks like:
>
> "?map=/map/ahps/precip.map&shape_path=2015/06/23/nws_precip_1day_observed_20150623&mode=tile&tilemode=gmap&service=WMS&version=1.1.1&request=GetMap&Styles=default&SRS=EPSG:102100&width=256&height=256&format=image/PNG&TRANSPARENT=TRUE&layers=conus-raster&dpi=120&tile=3+5+4"
>
> The layer is defined in the map file like:
>
>         LAYER
>                 NAME 'conus-raster'
>                 TYPE RASTER
>                 STATUS DEFAULT
>                 PROJECTION
>                         "init=epsg:4326"
>                 END
>                 VALIDATION
>                         "shape_path"
> "^[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/nws_precip_.*_[a-zA-Z]+_[0-9]{8}"
>                 END
>                 DATA "/shp/ahps/%shape_path%_conus.png"
>         END
>
> The decision has been made to use mapcache rather than querying mapserver
> directly, and I've set up a source and tileset (I will include below) but I
> am consistently running into errors. I have tried WMS and WMTS services
> because I need to use a dimension to pass the shape_path variable, but if I
> specify tile as a dimension, the regex requires me to treat the pluses in
> the value as spaces, but then it passes the literal string (with pluses) to
> mapserver. Mapserver returns an error that there are the wrong number of
> coordinates, that there should be 3.
>
> Any help would be greatly appreciated, the only thing stopping me from
> going
> in and modifying the source to split on plus or space is that I wouldn't be
> able to recompile mapserver in our production environment.
>
> The source in my config file is:
>    <source name="precip_conus" type="wms">
>       <getmap>
>          <params>
>             <map>/map/ahps/precip.map</map>
>             <version>1.3.0</version>
>             <SRS>EPSG:3857</SRS>
>             <CRS>EPSG:3857</CRS>
>                         <SRS>EPSG:102100</SRS>
>                         <CRS>EPSG:102100</CRS>
>             <TRANSPARENT>TRUE</TRANSPARENT>
>             <FORMAT>image/png</FORMAT>
>             <LAYERS>conus-raster</LAYERS>
>                         <MODE>TILE</MODE>
>                         <TILEMODE>gmap</TILEMODE>
>          </params>
>       </getmap>
>       <http>
>          <url>url_to_mapserver</url>
>          <headers>
>             <User-Agent>mod_mapcache/r175</User-Agent>
>             <Referrer>url_to_mapcache</Referrer>
>          </headers>
>          <connection_timeout>10</connection_timeout>
>           </http>
>    </source>
>
> and the tileset is:
>    <tileset name="precip_conus">
>       <source>precip_conus</source>
>           <LAYER>conus-raster</LAYER>
>       <cache>precip_cache</cache>
>       <grid>g2</grid>
>       <format>PNG</format>
>       <dimensions>
>          <dimension type="regex" name="shape_path"
>
> default="2015/01/01/nws_precip_1day_observed_20150101">^[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/nws_precip_.*_[a-zA-Z]+_[0-9]{8}$</dimension>
>                  <dimension type="regex" name="tile"
> default="3+5+4">^\d{1,3}\s\d{1,3}\s\d{1,3}$</dimension>
>       </dimensions>
>    </tileset>
>
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Communicating-Tile-Coordinates-Between-Mapcache-and-Mapserver-tp5212572.html
> Sent from the Mapserver - Dev mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20150624/9f50eac0/attachment-0001.html>


More information about the mapserver-dev mailing list