<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Matthew,<div><br><div>The first step in rendering smaller size tiles with TileCache Mapnik is to request 8-bit pngs.</div><div><br></div><div>Using TileCache trunk you can do that with:</div><div><br></div><div>extension = png256</div><div><br></div><div>Dane</div><div><br></div><div><br></div><div><div><div>On Dec 26, 2008, at 5:03 PM, Matthew Rushton wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Much better, that works as expected. Right now I'm looking into the size of the png files that are produced which are ~3x bigger than those I was producing previously. I was not using PIL before and I suspect the images are not getting properly compressed. I'll keep digging, if anyone knows of a quick fix let me know.<br>-Matt<br><br>--- On <b>Fri, 12/26/08, Christopher Schmidt <i><<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Christopher Schmidt <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>><br>Subject: Re: [Tilecache] Permissions and TileSize<br>To: "Matthew Rushton" <<a href="mailto:mrushton7@yahoo.com">mrushton7@yahoo.com</a>><br>Cc: <a href="mailto:tilecache@openlayers.org">tilecache@openlayers.org</a><br>Date: Friday, December 26, 2008, 1:34 PM<br><br><pre>On Fri, Dec 26, 2008 at 09:43:44AM -0800, Matthew Rushton wrote:<br>> Thanks Chris
here's some more info:<br>> <br>> From my tilecache.cfg:<br>> <br>> [basic]<br>> type=MapnikLayer<br>> layers=basic<br>> mapfile=/opt/tile_server/mapnik/osm.xml<br>> size=64,64<br>> tms_type=google<br>> spherical_mercator=true<br>> metaTile=true<br>> <br>> a request which I expect to produce the entire world but is part of a 4x4<br>grid:<br>> myserver.com/tilecache.py/1.0.0/basic/0/0/0.png<br><br>spherical_mercator=true implies maxResolution 156543.0339. You want a<br>maxResolution of 4x that, if you want the whole world in one 64 pixel<br>tile: 626172.1356 . I don't know if the OSM.xml file actually has rules<br>to account for that, but adding maxresolution=626172.1356 to your config<br>will certainly get you closer.<br><br><br><br>> Also I am using mod_python so perhaps the performance isn't as a big<br>> deal if the xml isn't being read with every request that was a cache<br>> miss. My basic concern
was how much faster could I make a custom<br>> apache module if I were so inclined. Thanks again!<br><br>Much faster, probably, but not in any important way. I've *never* seen<br>anyone peg a CPU with serving cached tiles: I have seen TileCache peg a<br>1gbps network connection, though.<br><br>Again, the time to read the XML vs. time to render a tile is tiny. If<br>you're concerned about speed, the most important thing to do is make<br>sure your tiles are pre-cached, not worry about the TileCache time,<br>which will be miniscule by comparison.<br><br>-- Chris<br><br>> -Matt<br>> <br>> --- On Fri, 12/26/08, Christopher Schmidt <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>><br>wrote:<br>> From: Christopher Schmidt <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>><br>> Subject: Re: [Tilecache] Permissions and TileSize<br>> To: <a href="mailto:tilecache@openlayers.org">tilecache@openlayers.org</a><br>> Date: Friday, December 26, 2008, 11:47 AM<br>> <br>> On Fri, Dec 26, 2008 at 08:17:22AM -0800, Matthew
Rushton wrote:<br>> > I finally figured out the issue, it ended up being a boundary file<br>> > that had the wrong permissions, so all is good and appears to be<br>> > working. One issue that remains is my tile size. I'm using 64x64<br>and<br>> > this makes zoom level zero not be the entire world. <br>> <br>> This isn't enough information to understand what you're hoping<br>for.<br>> Please share your TileCache config and a tile that you're looking for.<br><br>> <br>> > The only other issue I was curious about was performance with osm<br>> > data. I'm worried about the xml file being parsed too frequently.<br>> > Does anyone have experience with this? Is my concern valid?<br>> <br>> Since: <br>> * Pre-cached tiles never touch the XML file<br>> * Non-precached tiles will take much longer to render than to use<br>> a C-based XML parser to read the XML file<br>> <br>> My
guess is that your concern is a case of premature optimization.<br>> <br>> If you are using mod_python, the config file is read once per apache<br>> child startup. If you are using CGI, it is read with every request that<br>> needs to generate tiles.<br>> <br>> -- Chris<br>> <br>> > -Matt<br>> > <br>> > --- On Thu, 12/25/08, Matthew Rushton <<a href="mailto:mrushton7@yahoo.com">mrushton7@yahoo.com</a>><br>wrote:<br>> > From: Matthew Rushton <<a href="mailto:mrushton7@yahoo.com">mrushton7@yahoo.com</a>><br>> > Subject: <br>> > To: <a href="mailto:tilecache@openlayers.org">tilecache@openlayers.org</a><br>> > Date: Thursday, December 25, 2008, 10:09 PM<br>> > <br>> > I'm trying to set up TileCache and running into a few problems<br>with<br>> likely simple solutions. I'm using Mapnik to render the tiles to a<br>disk<br>> cache. I previously was using another tile server, so I know mapnik is<br>working<br>> great. This is the error I'm getting below. I know it's a problem<br>with<br>>
loading the osm.xml file I just don't know why. I've changed<br>> persmissions so it shouldn't be an issue. What sort of problem could<br>this<br>> be? What do people generally keep the permissions of this file and others,<br>> including tiles, at. Thanks in advance.<br>> > -Matt <br>> > <br>> > An error occurred<br>> > <br>> > : failed opening file: Bad file descriptor<br>> > File "/var/www/tilecache-2.04/TileCache/Service.py", line<br>224,<br>> in modPythonHandler<br>> > host )<br>> > File "/var/www/tilecache-2.04/TileCache/Service.py", line<br>208,<br>> in dispatchRequest<br>> > return self.renderTile(tile,<br>> > params.has_key('FORCE'))<br>> > File "/var/www/tilecache-2.04/TileCache/Service.py", line<br>138,<br>> in renderTile<br>> > data = layer.render(tile)<br>> > File "/var/www/tilecache-2.04/TileCache/Layer.py",
line<br>437,<br>> in render<br>> > return self.renderTile(tile)<br>> > File<br>"/var/www/tilecache-2.04/TileCache/Layers/Mapnik.py",<br>> line 40, in renderTile<br>> > mapnik.load_map(m,self.mapfile)<br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > _______________________________________________<br>> > Tilecache mailing list<br>> > <a href="mailto:Tilecache@openlayers.org">Tilecache@openlayers.org</a><br>> > <a href="http://openlayers.org/mailman/listinfo/tilecache">http://openlayers.org/mailman/listinfo/tilecache</a><br>> <br>> <br>> -- <br>> Christopher Schmidt<br>> MetaCarta<br>> _______________________________________________<br>> Tilecache mailing list<br>> <a href="mailto:Tilecache@openlayers.org">Tilecache@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/tilecache">http://openlayers.org/mailman/listinfo/tilecache</a><br>> <br>> <br>> <br>> <br>-- <br>Christopher Schmidt<br>MetaCarta<br></pre></blockquote></td></tr></tbody></table><br> _______________________________________________<br>Tilecache mailing list<br><a href="mailto:Tilecache@openlayers.org">Tilecache@openlayers.org</a><br>http://openlayers.org/mailman/listinfo/tilecache<br></blockquote></div><br></div></div></body></html>