<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19154">
</head>
<body>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial">Hi,</font></span></div>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial">Perhaps it has something to do with&nbsp;newline characters?</font></span></div>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial">[line 82]: '&nbsp; type=WMS\n'</font></span></div>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial">-Jukka Rahkonen-</font></span></div>
<br>
<blockquote style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<div dir="ltr" lang="fi" class="OutlookMessageHeader" align="left">
<hr tabindex="-1">
</div>
<div dir="ltr" lang="fi" class="OutlookMessageHeader" align="left"><font size="2" face="Tahoma">Michael Markieta<span class="130560407-30012012"><font color="#0000ff" face="Arial">&nbsp; wrote:</font></span></font><br>
<span class="130560407-30012012"><font color="#0000ff" size="2" face="Arial">&nbsp;</font></span></div>
<div dir="ltr" lang="fi" class="OutlookMessageHeader" align="left"><span class="130560407-30012012">&nbsp;</span>Hi all,</div>
<div class="post-text">
<p>Original question was posted here: <a href="http://gis.stackexchange.com/questions/19459/tilecache-and-mapserver-not-producing-images-and-raising-parsing-error">
http://gis.stackexchange.com/questions/19459/tilecache-and-mapserver-not-producing-images-and-raising-parsing-error</a><br>
</p>
<p>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.</p>
<p>Web map located <a href="http://rinnerweb.arts.ryerson.ca/moot2_dev" rel="nofollow">
here</a></p>
<p>Tile cache is being setup as a test run for the &quot;hii_5&quot; layer in OpenLayers. MapServer is the backend.</p>
<p>I am trying to get TileCache to cache images of my MapServer WMS. However, no images are produced. The TileCache is &quot;trying&quot; to load the tiles (as you can see on the live page), however, no images are returned.</p>
<p>When I follow the <a href="http://rinnerweb.arts.ryerson.ca/cgi-bin/tilecache.cgi?LAYERS=HII_railroads&amp;FORMAT=image/png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;SRS=EPSG:3857&amp;BBOX=-10592586.767623,5113378.756775,-9340242.496373,6365723.028025&amp;WIDTH=256&amp;HEIGHT=256" rel="nofollow">
path</a> of one of the image tiles, I see this error:</p>
<pre><code>An error occurred: File contains parsing errors: C:\ms4w\Apache\cgi-bin\tilecache.cfg
    [line 82]: '  type=WMS\n'
    [line 83]: '  url=<a href="http://141.117.104.183/cgi-bin/mapserv.exe\n">http://141.117.104.183/cgi-bin/mapserv.exe\n</a>'
    [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 &quot;C:\ms4w\Apache\cgi-bin\TileCache\Service.py&quot;, line 85, in _load
    config.read(files)
  File &quot;C:\Python27\lib\ConfigParser.py&quot;, line 297, in read
    self._read(fp, filename)
  File &quot;C:\Python27\lib\ConfigParser.py&quot;, line 538, in _read
    raise e
</code></pre>
<ul>
<li>I've run a <a href="http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/moot2_dev/hii_railroads.map&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetCapabilities" rel="nofollow">
GetCapabilities</a> request and there are no warnings </li><li>but <a href="http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/moot2_dev/hii_railroads.map&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;LAYERS=HII_railroads&amp;STYLES=&amp;SRS=EPSG:3857&amp;BBOX=-173.537,35.8775,-11.9603,83.8009&amp;WIDTH=400&amp;HEIGHT=300&amp;FORMAT=image/png" rel="nofollow">
GetMap</a> request returns a blank page </li><li>and the <a href="http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&amp;" rel="nofollow">
template</a> return blank</li></ul>
<p>Here are the relevant mapfile, tilecache.cfg, and openlayers source:</p>
<p>Not sure how much help I will get here, but the questions out there for anyone to take a stab at it!</p>
<hr>
<p><strong>hii_railroads.map</strong></p>
<pre><code>MAP                                                     #-&gt; BEGIN MAP
    OUTPUTFORMAT                                        #-&gt; BEGIN OUTPUT FORMATTING DEFINITION
        NAME &quot;png&quot;                                      # Name of format
        DRIVER AGG/PNG                                  # Image driver
        MIMETYPE &quot;image/png&quot;                            # Type of image
        IMAGEMODE RGBA                                  # Image mode
        EXTENSION &quot;png&quot;                                 # Image filetype
        TRANSPARENT ON                                  # Transparency
    END                                                 #-&gt; END OUTPUT FORMATTING DEFINITION

    WEB                                                 #-&gt; BEGIN WEB DEFINITION

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

        TEMPLATE &quot;template.html&quot;
        IMAGEPATH &quot;/ms4w/tmp/ms_tmp/&quot;
        IMAGEURL &quot;/ms_tmp/&quot;
    END                                                 #-&gt; END WEB DEFINITION

LAYER                                                   #-&gt; BEGIN LAYER DEFINITION: Railroads &lt;-#

    METADATA
        &quot;wms_title&quot; &quot;HII_railroads&quot;
    END

    NAME    HII_railroads                               # Layer identifier
    DATA    &quot;data/wgs84/railroads_360.tif&quot;              # Name of the data (in this case, string identifying a raster)
    STATUS  ON     
</code></pre>
<hr>
<p><strong>tilecache.cfg</strong></p>
<pre><code>[HII_railroads]
  type=WMS
  url=<a href="http://141.117.104.183/cgi-bin/mapserv.exe">http://141.117.104.183/cgi-bin/mapserv.exe</a>
  mapfile=C:/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map
  extension=png
  layers=HII_railroads
</code></pre>
<hr>
<p><strong>index.html</strong></p>
<pre><code>hii_5 = new OpenLayers.Layer.WMS(&quot;Railroads&quot;,&quot;../../cgi-bin/tilecache.cgi?&quot;,{
    layers:&quot;HII_railroads&quot;,
    format:&quot;image/png&quot;},{
    isBaseLayer:false,
    transparent:true,
    format:&quot;image/png&quot;,
    alpha:true,
    displayInLayerSwitcher:false
    });
</code></pre>
</div>
<br>
<font face="verdana,sans-serif"><br clear="all">
</font>
<div><font color="#333333" size="1" face="'trebuchet ms', sans-serif">Michael Markieta - (416) 833 5581</font></div>
<div><font color="#cccccc" size="1" face="'trebuchet ms', sans-serif">------------------------------------------------------</font></div>
<div><font color="#666666" size="1" face="'trebuchet ms', sans-serif">Research Assistant - Department of Geography &amp;</font></div>
<div><font color="#666666" size="1" face="'trebuchet ms', sans-serif">Bachelor of Arts Candidate - Geographic Analysis</font></div>
<div><font color="#999999" size="1" face="'trebuchet ms', sans-serif">Ryerson University</font></div>
<div><font color="#999999" size="1" face="'trebuchet ms', sans-serif">Toronto, ON, Canada</font></div>
<div><font color="#cccccc" size="1" face="'trebuchet ms', sans-serif">------------------------------------------------------</font></div>
<div><font color="#333333" size="1" face="'trebuchet ms', sans-serif"><a href="http://www.spatialanalysis.ca" target="_blank">www.spatialanalysis.ca</a></font></div>
<br>
</blockquote>
</body>
</html>