<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font face="Arial,sans-serif" size="2" style="font-size:10pt;" color="#366092"><br id="FontBreak"></font>That's pretty cool Steve, it would be neat to know more about your progress with mapcache.<div><br></div><div>Gery<br><br><div>> To: tilecache@lists.osgeo.org<br>> From: woodbri@swoodbridge.com<br>> Date: Thu, 9 Jul 2015 11:31:53 -0400<br>> Subject: Re: [Tilecache] Problem moving tilecache from Ubuntu 12.04 to 14.04<br>> <br>> After two days of trying to fix this problem and not making any headway, <br>> I gave up and converted the project over to mapcache which was pretty <br>> easy and straight forward. The whole conversion took about 1 hr to <br>> create the mapcache.xml file equivalent to the tilecache.cfg and to edit <br>> the html to point to mapcache and enable it in apache. This used the <br>> existing cache so I didn't need to repopulate it.<br>> <br>> -Steve<br>> <br>> On 7/7/2015 3:21 PM, Stephen Woodbridge wrote:<br>> > Hi All,<br>> ><br>> > I'm having a problem upgrading a system with tilecache installed on it.<br>> > After two days and no headway, I probably am missing some basic or I've<br>> > hit a real problem.<br>> ><br>> > The Problem:<br>> ><br>> > On the 14.04 server:<br>> ><br>> > http://74.208.113.181/tilecache-2.01/tilecache.py?LAYERS=bathy_contours&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-73.4,29.6,-71.8,31.2&WIDTH=256&HEIGHT=256<br>> ><br>> ><br>> > Errors out with:<br>> > An error occurred: Current x value -73.400000 is too far from tile<br>> > corner x -75.000000<br>> ><br>> > but with the same url on the 12.04 server I get an image:<br>> ><br>> > http://74.208.78.238/tilecache-2.01/tilecache.py?LAYERS=bathy_contours&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-73.4,29.6,-71.8,31.2&WIDTH=256&HEIGHT=256<br>> ><br>> ><br>> > some tiles are returned correctly and some are not. Here is one that works:<br>> ><br>> > http://74.208.113.181/tilecache-2.01/tilecache.py?LAYERS=bathy_model&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-76.6,36,-75,37.6&WIDTH=256&HEIGHT=256<br>> ><br>> ><br>> > http://74.208.78.238/tilecache-2.01/tilecache.py?LAYERS=bathy_model&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-76.6,36,-75,37.6&WIDTH=256&HEIGHT=256<br>> ><br>> ><br>> > Situation:<br>> ><br>> > Ubuntu 12.04 LTS server running:<br>> > tilecache/precise uptodate 2.11-2<br>> > apache2/precise-security 2.2.22-1ubuntu1.8<br>> > python/precise-updates uptodate 2.7.3-0ubuntu2.2<br>> ><br>> > and in the apache sites-enabled:<br>> >          Alias /tilecache-2.01 /var/lib/python-support/python2.7/<br>> >          <Directory /var/lib/python-support/python2.7/><br>> >                  SetHandler python-program<br>> >                  PythonHandler TileCache.Service<br>> >                  PythonOption TileCacheConfig /etc/tilecache.cfg<br>> >          </Directory><br>> ><br>> ><br>> > I setup a new server and rsync the tilecache, the /etc/tilecache.cfg and<br>> > set it up using:<br>> > tilecache:all/trusty 2.11-2 uptodate<br>> > apache2:amd64/trusty-security 2.4.7-1ubuntu4.4 uptodate<br>> > python:amd64/trusty 2.7.5-5ubuntu3 uptodate<br>> > python2.7:amd64/trusty-security 2.7.6-8ubuntu0.2 uptodate<br>> > python3:amd64/trusty 3.4.0-0ubuntu2 uptodate<br>> > python3.4:amd64/trusty-security 3.4.0-2ubuntu1.1 uptodate<br>> ><br>> > # python --version<br>> > Python 2.7.6<br>> ><br>> > and in the apache sites-enabled:<br>> >          Alias /tilecache-2.01 /var/lib/python-support/python2.7/<br>> >          <Directory /var/lib/python-support/python2.7/><br>> >                  #SetHandler python-program<br>> >                  AddHandler python-program .py<br>> >                  PythonHandler TileCache.Service<br>> >                  PythonOption TileCacheConfig /etc/tilecache.cfg<br>> >                  Require all granted<br>> >          </Directory><br>> ><br>> > The cache should be fully populated so there should be not need to hit<br>> > mapserver but I occasionally get mapserver processes running at 100% for<br>> > long periods of time, probably because the cache thinks it needs to<br>> > generate a metatile. I probably will need to check mapfiles because the<br>> > old server is running MapServer version 6.2.1 and the new server is on<br>> > MapServer version 6.4.1<br>> ><br>> > Problem Analysis:<br>> ><br>> > This is probably faulty or incomplete as it has not lead me to a solution.<br>> ><br>> > 1. tilecache is configured and running<br>> > 2. different versions of apache 2.2 vs 2.4<br>> >     - had to make changes in handler above<br>> >     - are there other changes like environment variables or initialization<br>> > 3. system has both python 2.7 and 3.0 installed is something strange<br>> > happening because of this?<br>> > 4. are the differences in mod_python between the two systems that might<br>> > cause this?<br>> > 5. there appears to be a pattern to what tiles are ok or broken but its<br>> > not clear what it means. Maybe some kind of rounding issue?<br>> > 6. I diff'd the files in /var/lib/python-support/python2.7/ tree and<br>> > they are all the same except a few of the pyc files. I recompiled them<br>> > on the new system just be be sure with python -m py_compile<br>> > /path/to/file.py but that did not change anything.<br>> ><br>> > I looked at the Layer.py code and it is failing in getCell() at:<br>> ><br>> >          if exact:<br>> >              if (abs(minx - tilex)  / res > 1):<br>> >                  raise TileCacheException("Current x value %f is too far<br>> > from tile corner x %f" % (minx, tilex))<br>> ><br>> > because abs(minx - tilex) / res = 256 which seems curious as this is the<br>> > size of a tile. So I'm thinking that this code might be behaving badly:<br>> ><br>> >      def getResolution (self, (minx, miny, maxx, maxy)):<br>> >          """<br>> >          >>> l = Layer("name")<br>> >          >>> l.getResolution((-180,-90,0,90))<br>> >          0.703125<br>> >          """<br>> >          return max( float(maxx - minx) / self.size[0],<br>> >                      float(maxy - miny) / self.size[1] )<br>> ><br>> > I'm getting res=0.00625 for the broken request.<br>> ><br>> > So the bottom line, I'm totally lost in this issue and probably looking<br>> > in all the wrong places.<br>> ><br>> > -Steve<br>> > _______________________________________________<br>> > Tilecache mailing list<br>> > Tilecache@lists.osgeo.org<br>> > http://lists.osgeo.org/mailman/listinfo/tilecache<br>> <br>> _______________________________________________<br>> Tilecache mailing list<br>> Tilecache@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/tilecache<br></div></div>                                     </div></body>
</html>