<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>awesome, that's cool Steve, thanks for sharing.<br><br><br><div>> To: gamejihou@hotmail.com; tilecache@lists.osgeo.org<br>> From: woodbri@swoodbridge.com<br>> Date: Thu, 9 Jul 2015 13:43:29 -0400<br>> Subject: Re: [Tilecache] Problem moving tilecache from Ubuntu 12.04 to 14.04<br>> <br>> So here is an example of how I converted it:<br>> <br>> <br>> tilecache.cfg<br>> ------------------<br>> <br>> [cache]<br>> type=DiskCache<br>> base=/var/tilecache<br>> <br>> [land]<br>> type=MapServerLayer<br>> mapfile=/maps/wms/land.map<br>> layers=land<br>> extension=png<br>> bbox=-131.00, 12.00, -66.00, 49.00<br>> maxResolution=0.10<br>> srs=EPSG:4326<br>> levels=15<br>> extent_type=loose<br>> debug=true<br>> <br>> mapcache.xml<br>> ------------------<br>> <?xml version="1.0" encoding="UTF-8"?><br>> <mapcache><br>> <metadata><br>> <title>WMS Tile Server</title><br>> <abstract>...</abstract><br>> </metadata><br>> <br>> <cache name="disk" type="disk"><br>> <base>/data/mapcache</base><br>> <symlink_blank/><br>> </cache><br>> <br>> <source name="land" type="wms"><br>> <getmap><br>> <params><br>> <FORMAT>image/png</FORMAT><br>> <MAP_IMAGETYPE>png</MAP_IMAGETYPE><br>> <LAYERS>land</LAYERS><br>> <MAP>/maps/wms/land.map</MAP><br>> </params><br>> </getmap><br>> <http><br>> <url>http://localhost/cgi-bin/mapserv</url><br>> </http><br>> </source><br>> <br>> <format name="PNGQ_FAST" type="PNG"><br>> <compression>fast</compression><br>> <colors>256</colors><br>> </format><br>> <br>> <grid name="WGS84_ALT"><br>> <metadata><br>> <title>GoogleCRS84Quad</title><br>> <br>> <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad</WellKnownScaleSet><br>> </metadata><br>> <extent>-131.00 12.00 -66.00 49.00</extent><br>> <srs>EPSG:4326</srs><br>> <units>dd</units><br>> <size>256 256</size><br>> <resolutions>0.10 0.05 0.025 0.0125 0.00625 0.003125 0.0015625 <br>> 0.00078125 0.000390625 0.0001953125 0.00009765625 0.000048828125 <br>> 0.0000244140625 0.00001220703125 0.000006103515625</resolutions><br>> </grid><br>> <br>> <tileset name="land"><br>> <source>land</source><br>> <cache>disk</cache><br>> <grid>WGS84_ALT</grid><br>> <format>PNGQ_FAST</format><br>> <metatile>5 5</metatile><br>> <!-- metabuffer must be the abs() of what is in the mapfile --><br>> <metabuffer>20</metabuffer><br>> <expires>3600</expires><br>> </tileset><br>> <br>> <default_format>PNGQ_FAST</default_format><br>> <br>> <service type="wms" enabled="true"><br>> <full_wms>assemble</full_wms><br>> <resample_mode>bilinear</resample_mode><br>> <format>PNGQ_FAST</format><br>> <maxsize>4096</maxsize><br>> </service><br>> <service type="tms" enabled="true"/><br>> <br>> <errors>report</errors><br>> <lock_dir>/tmp</lock_dir><br>> <br>> </mapcache><br>> <br>> <br>> /etc/apache2/mods-enabled/mapcache.conf<br>> ---------------------------------------<br>> <br>> <IfModule mapcache_module><br>> <Directory /data/mapcache><br>> Require all granted<br>> </Directory><br>> MapCacheAlias /mapcache "/data/mapcache/mapcache.xml"<br>> </IfModule><br>> <br>> <br>> Disk structure<br>> -----------------------------<br>> # ls -Rl /data/mapcache/<br>> /data/mapcache/:<br>> total 36<br>> <br>> drwxr-xr-x 2 root root 4096 Jul 8 14:40 land<br>> -rw-r--r-- 1 root root 6026 Jul 8 14:36 mapcache.xml<br>> <br>> /data/mapcache/land:<br>> total 0<br>> lrwxrwxrwx 1 root root 20 Jul 8 14:40 WGS84_ALT -> /data/tilecache/land<br>> <br>> <br>> And URLs for tiles look like:<br>> http://example.com/mapcache?LAYERS=land&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>> And that is all there is. Probably the tricky part is setting up the <br>> mapcache.xml grid to match the grid you are using in tilecache.cfg, but <br>> all in all, it should be pretty straight forward if you read the docs.<br>> <br>> I've been using mapcache and its predecessor for years. It is awesome <br>> and very fast. See also: http://mapserver.org/mapcache/index.html<br>> <br>> -Steve<br>> <br>> On 7/9/2015 12:48 PM, Gery . wrote:<br>> ><br>> > That's pretty cool Steve, it would be neat to know more about your<br>> > progress with mapcache.<br>> ><br>> > Gery<br>> ><br>> > > 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<br>> > 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>> > > ><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>> > > ><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<br>> > that works:<br>> > > ><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>> > > ><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<br>> > /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<br>> > 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<br>> > 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<br>> > 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>> <br></div> </div></body>
</html>