Mapnik+OSM and TileCache

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Mapnik+OSM and TileCache

Christopher Schmidt-2
After a heck of a lot of hacking last night, I finally got OSM rendering
via mapnik. After some more playing, I added a mapnik layer to
TileCache[1].

The upshot?

http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F

Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.

Questions that I have been asked:
 * Can it do mercator? Yes, absolutely. It only doesn't because the
   existing caches for the other 7 layers are not Mercator.
 * Is it WMS? TileCache can take requests in either TMS or WMS formats,
   but it simply parses these requests down to the appropriate TileID.
 * Does it have any additional dependancies? Nope. Once you have Mapnik
   installed, the only additional dependancy is TileCache, which is
   pure-python BSD licensed code.
 * How are the tiles stored on disk? Because of the limitations of the
   ext3 filesystem, tiles are split up into multiple subdirectories, but
   these directories are regular, and very similar to the 'GoogleLike'
   file structure:
     ./14/000/016/352/000/012/853.png
       (zoom) (x0, x1, x2) (y0, y1, y2)  
   It's also possible (simple) to write your own file caching plugin,
   that (for example) stores tiles on multiple servers, or use the
   memcached memory caching plugin for faster access and distributed
   caching.  

The Mapnik layer should be in the next release of TileCache, sometime in
the next two weeks.

[1] http://labs.metacarta.com/wms-c/

Regards,
--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Mikel Maron
Nice work Chris

Two thoughts..

Looks like this demo auto-resizes in IE correctly .. can this solve the problem with OSM index-new.html?
(sorry if this is already discussed, I missed some of that thread earlier)

Also, am I correct understanding that the WMS-C spec itself can not support GoogleLike schemes,
because the origin is in the upper-left, while WMS-C specifies that the origin is the lower-left?
Anything we can do on that, to extend the spec for this?

Mikel

----- Original Message ----
From: Christopher Schmidt <[hidden email]>
To: [hidden email]
Sent: Sunday, November 26, 2006 3:28:20 PM
Subject: [OSM-talk] Mapnik+OSM and TileCache

After a heck of a lot of hacking last night, I finally got OSM rendering
via mapnik. After some more playing, I added a mapnik layer to
TileCache[1].

The upshot?

http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F

Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.

Questions that I have been asked:
 * Can it do mercator? Yes, absolutely. It only doesn't because the
   existing caches for the other 7 layers are not Mercator.
 * Is it WMS? TileCache can take requests in either TMS or WMS formats,
   but it simply parses these requests down to the appropriate TileID.
 * Does it have any additional dependancies? Nope. Once you have Mapnik
   installed, the only additional dependancy is TileCache, which is
   pure-python BSD licensed code.
 * How are the tiles stored on disk? Because of the limitations of the
   ext3 filesystem, tiles are split up into multiple subdirectories, but
   these directories are regular, and very similar to the 'GoogleLike'
   file structure:
     ./14/000/016/352/000/012/853.png
       (zoom) (x0, x1, x2) (y0, y1, y2)  
   It's also possible (simple) to write your own file caching plugin,
   that (for example) stores tiles on multiple servers, or use the
   memcached memory caching plugin for faster access and distributed
   caching.  

The Mapnik layer should be in the next release of TileCache, sometime in
the next two weeks.

[1] http://labs.metacarta.com/wms-c/

Regards,
--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk




_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

J.D. Schmidt
In reply to this post by Christopher Schmidt-2
Thats bloody damn sweet Christopher.. Now just get it in Mercator and
we have a slippy map..
I perused the areas where I have uploaded data and tagged ways, it is
great seeing ones work visualized like a map that works, even at high
zooms.

http://labs.metacarta.com/wms-c/demo.html?lat=55.67364&lon=12.56564&zoom=13&layers=00B00000F

 Center of Copenhagen


J.D. "Dutch" Schmidt



2006/11/26, Christopher Schmidt <[hidden email]>:

> After a heck of a lot of hacking last night, I finally got OSM rendering
> via mapnik. After some more playing, I added a mapnik layer to
> TileCache[1].
>
> The upshot?
>
> http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F
>
> Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.
>
> Questions that I have been asked:
>  * Can it do mercator? Yes, absolutely. It only doesn't because the
>   existing caches for the other 7 layers are not Mercator.
>  * Is it WMS? TileCache can take requests in either TMS or WMS formats,
>   but it simply parses these requests down to the appropriate TileID.
>  * Does it have any additional dependancies? Nope. Once you have Mapnik
>   installed, the only additional dependancy is TileCache, which is
>   pure-python BSD licensed code.
>  * How are the tiles stored on disk? Because of the limitations of the
>   ext3 filesystem, tiles are split up into multiple subdirectories, but
>   these directories are regular, and very similar to the 'GoogleLike'
>   file structure:
>     ./14/000/016/352/000/012/853.png
>       (zoom) (x0, x1, x2) (y0, y1, y2)
>   It's also possible (simple) to write your own file caching plugin,
>   that (for example) stores tiles on multiple servers, or use the
>   memcached memory caching plugin for faster access and distributed
>   caching.
>
> The Mapnik layer should be in the next release of TileCache, sometime in
> the next two weeks.
>
> [1] http://labs.metacarta.com/wms-c/
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
> _______________________________________________
> talk mailing list
> [hidden email]
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
>

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Christopher Schmidt-2
In reply to this post by Mikel Maron
On Sun, Nov 26, 2006 at 08:41:30AM -0800, Mikel Maron wrote:
> Nice work Chris
>
> Two thoughts..
>
> Looks like this demo auto-resizes in IE correctly .. can this solve the problem with OSM index-new.html?
> (sorry if this is already discussed, I missed some of that thread earlier)

From IRC last night:

17:44 < crschmidt> There are a couple options. 1. make the left sidebar
a percentage based width, then use the rest of the page for the map.
This works in all browsers, but it means that people with Very Small
Resolutions could see a sidebar which is too small, and people wit hVery
Large Resolutions would see too much whitespace.
17:45 < crschmidt> 2. Use absolute positioning on the map div, with
'left', and 'right'. This doesn't work in IE
17:45 < crschmidt> 3. Use width: auto. This doesn't correctly work in
Safari or IE
17:45 < crschmidt> 4. Use javascript hackery. This can be made to work
in all browsers, but takes a bit more work.

This is a different case of 1 -- since we have no sidebar, we just use
100% width, and all is hunky dory.


> Also, am I correct understanding that the WMS-C spec itself can not support GoogleLike schemes,
> because the origin is in the upper-left, while WMS-C specifies that the origin is the lower-left?
> Anything we can do on that, to extend the spec for this?

You're thinking of TMS. WMS-C uses WMS-like requests with specific
bounding boxes. For TMS discussion, see the lists.eogeo.org tiling list,
being led by Paul Ramsey.

--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Christopher Schmidt-2
In reply to this post by J.D. Schmidt
On Sun, Nov 26, 2006 at 06:17:01PM +0100, Dutch wrote:
> Thats bloody damn sweet Christopher.. Now just get it in Mercator and
> we have a slippy map..
> I perused the areas where I have uploaded data and tagged ways, it is
> great seeing ones work visualized like a map that works, even at high
> zooms.
>
> http://labs.metacarta.com/wms-c/demo.html?lat=55.67364&lon=12.56564&zoom=13&layers=00B00000F
>
> Center of Copenhagen

Once TileCache is released, anyone else can set it up in Mercator. I
don't plan to set it up that way in the short term.

Regards,
--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Christopher Schmidt-2
In reply to this post by J.D. Schmidt
On Sun, Nov 26, 2006 at 06:17:01PM +0100, Dutch wrote:
> Thats bloody damn sweet Christopher.. Now just get it in Mercator and
> we have a slippy map..
> I perused the areas where I have uploaded data and tagged ways, it is
> great seeing ones work visualized like a map that works, even at high
> zooms.
>
> http://labs.metacarta.com/wms-c/demo.html?lat=55.67364&lon=12.56564&zoom=13&layers=00B00000F

http://labs.metacarta.com/wms-c/osm.html (Mercator)

Steve: If you want to use this on the OSM slippy map, you'd need to make
two changes:
 
Change:

layer = new OpenLayers.Layer.LikeGoogle( "OSM",
"http://artem.dev.openstreetmap.org/osm_tiles/", {type:'png'} );

to:

layer = new OpenLayers.Layer.WMS( "OSM",
    "http://labs.metacarta.com/wms-c/Basic.py?", {layers:'osm-merc'});

Change the maxResolution from: 156543 to: 156543.03390625

(I'd also divide the 156543.03390625 by 4, since that seems closer to
the old base.)

Regards,
--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Thomas Walraet
In reply to this post by Christopher Schmidt-2
Christopher Schmidt a écrit :
>
> http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F
>
> Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.


Very nice !


A little bug report : Some tiles are rendered blank from time to times.
http://labs.metacarta.com/wms-c/demo.html?lat=48.9869&lon=2.70305&zoom=15&layers=00B00000F

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Christopher Schmidt-2
On Mon, Nov 27, 2006 at 12:44:34AM +0100, Thomas Walraet wrote:

> Christopher Schmidt a ?crit :
> >
> > http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F
> >
> > Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.
>
>
> Very nice !
>
>
> A little bug report : Some tiles are rendered blank from time to times.
> http://labs.metacarta.com/wms-c/demo.html?lat=48.9869&lon=2.70305&zoom=15&layers=00B00000F

Yes. This is the result of mapnik not closing postgresql connections.
After a while, these build up, and eventually, postgresql will start
refusing additional clients. I've upped the limits as far as I can, and
tweaked the apache config to not have this happen as much as possible,
but it will still happen occasionally. Unfortunately, I don't know where
this bug is exactly, and I don't have the C++ knkowledge to fix it in
mapnik. Until it is fixed, this will occasionally happen.

I'll be working on a way to clear out the cache for a given area soon.
(Soon is on the days/week, not hour, scale.)

Regards,
--
Christopher Schmidt
MetaCarta

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Reply | Threaded
Open this post in threaded view
|

Re: Mapnik+OSM and TileCache

Artem Pavlenko
In reply to this post by Christopher Schmidt-2
Brilliant!

Artem.

Christopher Schmidt wrote:

> After a heck of a lot of hacking last night, I finally got OSM rendering
> via mapnik. After some more playing, I added a mapnik layer to
> TileCache[1].
>
> The upshot?
>
> http://labs.metacarta.com/wms-c/demo.html?lat=51.51777&lon=-0.10979&zoom=9&layers=00B00000F
>
> Just-in-time (cache as you drag) OSM, based on the 11-20-06 planet.
>
> Questions that I have been asked:
>  * Can it do mercator? Yes, absolutely. It only doesn't because the
>    existing caches for the other 7 layers are not Mercator.
>  * Is it WMS? TileCache can take requests in either TMS or WMS formats,
>    but it simply parses these requests down to the appropriate TileID.
>  * Does it have any additional dependancies? Nope. Once you have Mapnik
>    installed, the only additional dependancy is TileCache, which is
>    pure-python BSD licensed code.
>  * How are the tiles stored on disk? Because of the limitations of the
>    ext3 filesystem, tiles are split up into multiple subdirectories, but
>    these directories are regular, and very similar to the 'GoogleLike'
>    file structure:
>      ./14/000/016/352/000/012/853.png
>        (zoom) (x0, x1, x2) (y0, y1, y2)  
>    It's also possible (simple) to write your own file caching plugin,
>    that (for example) stores tiles on multiple servers, or use the
>    memcached memory caching plugin for faster access and distributed
>    caching.  
>
> The Mapnik layer should be in the next release of TileCache, sometime in
> the next two weeks.
>
> [1] http://labs.metacarta.com/wms-c/
>
> Regards,
>  

_______________________________________________
talk mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk