<div><font face="verdana, sans-serif">Which formatting is considered correct? Would this be the source of the parsing error?</font></div><div><font face="verdana, sans-serif"><br></font></div><div><pre style><code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);background-color:rgb(238,238,238)">[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><pre style><code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);background-color:rgb(238,238,238)">or</code></pre>

<pre style><code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);background-color:rgb(238,238,238)"><pre style>

<code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);background-color:rgb(238,238,238)">[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>
</code></pre></div><font face="verdana,sans-serif"><div><font face="verdana,sans-serif">*Note the indentation.</font></div><div><br></div><br clear="all"></font><div><font size="1" face="'trebuchet ms', sans-serif" color="#333333">Michael Markieta - (416) 833 5581</font></div>

<div><font size="1" face="'trebuchet ms', sans-serif" color="#cccccc">------------------------------------------------------</font></div><div><font size="1" face="'trebuchet ms', sans-serif" color="#666666">Research Assistant - Department of Geography &</font></div>

<div><font size="1" face="'trebuchet ms', sans-serif" color="#666666">Bachelor of Arts Candidate - Geographic Analysis</font></div><div><font size="1" face="'trebuchet ms', sans-serif" color="#999999">Ryerson University</font></div>

<div><font size="1" face="'trebuchet ms', sans-serif" color="#999999">Toronto, ON, Canada</font></div><div><font size="1" face="'trebuchet ms', sans-serif" color="#cccccc">------------------------------------------------------</font></div>

<div><font size="1" face="'trebuchet ms', sans-serif" color="#333333"><a href="http://www.spatialanalysis.ca" target="_blank">www.spatialanalysis.ca</a></font></div><br>
<br><br><div class="gmail_quote">On Mon, Jan 30, 2012 at 2:11 AM, Rahkonen Jukka <span dir="ltr"><<a href="mailto:Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>





<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">Hi,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">Perhaps it has something to do with newline characters?</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">[line 82]: '  type=WMS\n'</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" 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" align="left">
<hr>
</div><div><div class="h5">
<div dir="ltr" lang="fi" align="left"><font face="Tahoma">Michael Markieta<span><font color="#0000ff" face="Arial">  wrote:</font></span></font><br>
<span><font color="#0000ff" face="Arial"> </font></span></div>
<div dir="ltr" lang="fi" align="left"><span> </span>Hi all,</div>
<div>
<p>Original question was posted here: <a href="http://gis.stackexchange.com/questions/19459/tilecache-and-mapserver-not-producing-images-and-raising-parsing-error" target="_blank">
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" target="_blank">
here</a></p>
<p>Tile cache is being setup as a test run for the "hii_5" 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 "trying" 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&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" rel="nofollow" target="_blank">
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%5Cn" target="_blank">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 "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
</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&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" rel="nofollow" target="_blank">
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&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" rel="nofollow" target="_blank">
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&" rel="nofollow" target="_blank">
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                                                     #-> 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"  "<a href="http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&" target="_blank">http://rinnerweb.arts.ryerson.ca/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/moot2_dev/hii_railroads.map&</a>"
            "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     
</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" target="_blank">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("Railroads","../../cgi-bin/tilecache.cgi?",{
    layers:"HII_railroads",
    format:"image/png"},{
    isBaseLayer:false,
    transparent:true,
    format:"image/png",
    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 - <a href="tel:%28416%29%20833%205581" value="+14168335581" target="_blank">(416) 833 5581</a></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 &</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>
</div></div></blockquote>
</div>

</blockquote></div><br>