[mapserver-users] Mapserver and TileCache, parsing error thereby no cached images

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Jan 31 16:00:39 EST 2012


Hi,

Maybe the error means what is says and the size of image (256x256 pixels) does not suit any of the supported scales with the given BBOX. WMS-C requests be exactly correct to suit the cached tiles.

QGis and uDig support WMS-C so that they read the GetCapabilities from the service and adjust the GetMap requests accordingly automatically.

-Jukka Rahkonen-


________________________________
Lähettäjä: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] käyttäjän Michael Markieta [markieta.m at gmail.com] puolesta
Lähetetty: 31. tammikuuta 2012 20:39
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Mapserver and TileCache, parsing error thereby no cached images


My data is in WGS84 Major Auxiliary Sphere (as outputted by ArcGIS).. EPSG:3857

  *   Using this<http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&REQUEST=GetMap&WIDTH=500&HEIGHT=500&LAYERS=HII_railroads&VERSION=1.1.1&SRS=EPSG:3857&bbox=-10995797.347,5031174.730,-7855157.347,7815054.730&MAPUNIT=DecimalDegree&FORMAT=image/png&ClientId=&CLIENTMODE=TiledWmsRasterSource> GetMap request, I have verified that my data is in fact queryable

So I changed a few settings in my tilecache.cfg as so based on the GetMap query:

[HII_railroads]
type=WMS
url=http://141.117.104.183/cgi-bin/mapserv.exe
mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map
extension=png
layers=HII_railroads
srs=EPSG:3857
size=256,256
bbox=-10995797.347,5031174.730,-7855157.347,7815054.730
resolutions=10226.494362992187,5113.247181496094,2556.623590748047,1278.3117953740234,639.1558976870117,319.57794884350585,159.78897442175293,79.89448721087646,39.94724360543823,19.973621802719116,9.986810901359558,4.993405450679779,2.4967027253398895,1.2483513626699447,0.6241756813349724,0.3120878406674862,0.1560439203337431,0.07802196016687155,0.03901098008343577,0.019505490041717886


Still no luck<http://rinnerweb.arts.ryerson.ca/moot2_dev/>, darn.

You can see that layer hii_6 doesnt produce any images and I am given this error when I explore the url<http://rinnerweb.arts.ryerson.ca/cgi-bin/tilecache.cgi?LAYERS=HII_railroads&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A3857&BBOX=-10995797.347,6283519.00125,-9743453.07575,7535863.2725&WIDTH=256&HEIGHT=256> to these tiles:


An error occurred: can't find resolution index for 4891.969810. Available resolutions are:
[10226.494362992187, 5113.247181496094, 2556.623590748047, 1278.3117953740234, 639.1558976870117, 319.57794884350585, 159.78897442175293, 79.89448721087646, 39.94724360543823, 19.973621802719116, 9.986810901359558, 4.993405450679779, 2.4967027253398895, 1.2483513626699447, 0.6241756813349724, 0.3120878406674862, 0.1560439203337431, 0.07802196016687155, 0.03901098008343577, 0.019505490041717886]


Michael Markieta - (416) 833 5581
------------------------------------------------------
Research Assistant - Department of Geography &
Bachelor of Arts Candidate - Geographic Analysis
Ryerson University
Toronto, ON, Canada
------------------------------------------------------
www.spatialanalysis.ca<http://www.spatialanalysis.ca>



On Mon, Jan 30, 2012 at 11:06 AM, Michael Markieta <markieta.m at gmail.com<mailto:markieta.m at gmail.com>> wrote:
Which formatting is considered correct? Would this be the source of the parsing error?


[HII_railroads]
  type=WMS
  url=http://141.117.104.183/cgi-bin/mapserv.exe
  mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map
  extension=png
  layers=HII_railroads

or

[HII_railroads]
type=WMS
url=http://141.117.104.183/cgi-bin/mapserv.exe
mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map
extension=png
layers=HII_railroads

*Note the indentation.


Michael Markieta - (416) 833 5581<tel:%28416%29%20833%205581>
------------------------------------------------------
Research Assistant - Department of Geography &
Bachelor of Arts Candidate - Geographic Analysis
Ryerson University
Toronto, ON, Canada
------------------------------------------------------
www.spatialanalysis.ca<http://www.spatialanalysis.ca>



On Mon, Jan 30, 2012 at 2:11 AM, Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi<mailto:Jukka.Rahkonen at mmmtike.fi>> wrote:
Hi,

Perhaps it has something to do with newline characters?
[line 82]: '  type=WMS\n'

-Jukka Rahkonen-

________________________________
Michael Markieta  wrote:

 Hi all,

Original question was posted here: http://gis.stackexchange.com/questions/19459/tilecache-and-mapserver-not-producing-images-and-raising-parsing-error

Just a forewarning, I will try to be as extensive with my question as possible. Due to a number of reasons why this might not be working, I have posted all sorts of portions of my debugging below.

Web map located here<http://rinnerweb.arts.ryerson.ca/moot2_dev>

Tile cache is being setup as a test run for the "hii_5" layer in OpenLayers. MapServer is the backend.

I am trying to get TileCache to cache images of my MapServer WMS. However, no images are produced. The TileCache is "trying" to load the tiles (as you can see on the live page), however, no images are returned.

When I follow the path<http://rinnerweb.arts.ryerson.ca/cgi-bin/tilecache.cgi?LAYERS=HII_railroads&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:3857&BBOX=-10592586.767623,5113378.756775,-9340242.496373,6365723.028025&WIDTH=256&HEIGHT=256> of one of the image tiles, I see this error:

An error occurred: File contains parsing errors: C:\ms4w\Apache\cgi-bin\tilecache.cfg
    [line 82]: '  type=WMS\n'
    [line 83]: '  url=http://141.117.104.183/cgi-bin/mapserv.exe\n<http://141.117.104.183/cgi-bin/mapserv.exe%5Cn>'
    [line 84]: '  mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map\n'
    [line 85]: '  extension=png\n'
    [line 86]: '  layers=HII_railroads\n'
  File "C:\ms4w\Apache\cgi-bin\TileCache\Service.py", line 85, in _load
    config.read(files)
  File "C:\Python27\lib\ConfigParser.py", line 297, in read
    self._read(fp, filename)
  File "C:\Python27\lib\ConfigParser.py", line 538, in _read
    raise e


  *   I've run a GetCapabilities<http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/moot2_dev/hii_railroads.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities> request and there are no warnings
  *   but GetMap<http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/moot2_dev/hii_railroads.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=HII_railroads&STYLES=&SRS=EPSG:3857&BBOX=-173.537,35.8775,-11.9603,83.8009&WIDTH=400&HEIGHT=300&FORMAT=image/png> request returns a blank page
  *   and the template<http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&> return blank

Here are the relevant mapfile, tilecache.cfg, and openlayers source:

Not sure how much help I will get here, but the questions out there for anyone to take a stab at it!

________________________________

hii_railroads.map

MAP                                                     #-> BEGIN MAP
    OUTPUTFORMAT                                        #-> BEGIN OUTPUT FORMATTING DEFINITION
        NAME "png"                                      # Name of format
        DRIVER AGG/PNG                                  # Image driver
        MIMETYPE "image/png"                            # Type of image
        IMAGEMODE RGBA                                  # Image mode
        EXTENSION "png"                                 # Image filetype
        TRANSPARENT ON                                  # Transparency
    END                                                 #-> END OUTPUT FORMATTING DEFINITION

    WEB                                                 #-> BEGIN WEB DEFINITION

        METADATA
            "wms_title"           "HII_railroads"
            "wms_onlineresource"  "http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&"
            "wms_srs"             "EPSG:3857"
            "ows_enable_request"  "*"
        END

        TEMPLATE "template.html"
        IMAGEPATH "/ms4w/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
    END                                                 #-> END WEB DEFINITION

LAYER                                                   #-> BEGIN LAYER DEFINITION: Railroads <-#

    METADATA
        "wms_title" "HII_railroads"
    END

    NAME    HII_railroads                               # Layer identifier
    DATA    "data/wgs84/railroads_360.tif"              # Name of the data (in this case, string identifying a raster)
    STATUS  ON


________________________________

tilecache.cfg

[HII_railroads]
  type=WMS
  url=http://141.117.104.183/cgi-bin/mapserv.exe
  mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map
  extension=png
  layers=HII_railroads


________________________________

index.html

hii_5 = new OpenLayers.Layer.WMS("Railroads","../../cgi-bin/tilecache.cgi?",{
    layers:"HII_railroads",
    format:"image/png"},{
    isBaseLayer:false,
    transparent:true,
    format:"image/png",
    alpha:true,
    displayInLayerSwitcher:false
    });



Michael Markieta - (416) 833 5581<tel:%28416%29%20833%205581>
------------------------------------------------------
Research Assistant - Department of Geography &
Bachelor of Arts Candidate - Geographic Analysis
Ryerson University
Toronto, ON, Canada
------------------------------------------------------
www.spatialanalysis.ca<http://www.spatialanalysis.ca>





More information about the mapserver-users mailing list