[GIS] Displaying UTFGrids with Mapnik and TileStache

mapniktilestacheutfgrid

I'm new to using Mapnik and TileStache. The reason i wanted to use these two pieces of software was to understand the UTFGrid specification i've seen used all over the place ( examples here, here, here )

I copied the OpenLayers examples linked to above. And i've created my own here.

I have a couple questions about Mapnik and TileStache that maybe someone here can help me resolve:

1) Does anyone know how i can display the UTF Character overlays by themselves? The endgame here is twofold — a) i want to make a cool ascii-art-like map and b) i want to understand more about how this technology works. I assume the utfgrid overlays are drawing as vector tiles beneath the image tiles but firebug isn't showing me much.

2) It seems that the utfgrid will exactly match the the geometry it is created from in the mapnik xml file — meaning a direct overlay. If i render custom marker .png(s) for points is there anyway to make the utfgrids overlay for the whole marker instead of just the point? Is there a way to use utfgrids with points or is it meaningless ( pointless even 😉 )?

Thanks
Mazery

Best Answer

Does anyone know how i can display the UTF Character overlays by themselves?

Something like this is done by glower - it'd be possible to just display all grids all the time.

i want to understand more about how this technology works. I assume the utfgrid overlays are drawing as vector tiles beneath the image tiles but firebug isn't showing me much.

No, UTFGrid is not a vector format, and its being a raster hit-grid is the reason why it's more efficient than vectors for most use cases. The hitgrids are stored in javascript and accessed via offsets from each tile bound, so there's no default visual representation, or representation in the DOM, for the grid.

It seems that the utfgrid will exactly match the the geometry it is created from in the mapnik xml file -- meaning a direct overlay. If i render custom marker .png(s) for points is there anyway to make the utfgrids overlay for the whole marker instead of just the point? Is there a way to use utfgrids with points or is it meaningless ( pointless even ;-) )?

The Mapnik UTFGrid renderer supports any sort of feature representation (except for Raster), including points, and it will cover all semi-opaque parts of any symbolizer.

Related Question