Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
wow, a response from a creator of the spec. thanks –  maztaz Oct 24 '12 at 16:33
    
a couple points of clarification if you have time. You said there's no visual or DOM representation. I'm still confused about how the look-ups work with the hit grid then. It sounds like your tile-offset position is constantly being determined on mouse movement and that position corresponds to the json grid's rows/columns. Is that how the look-up for the utf characters is done? I know i should just probably read the OpenLayers code to figure this out and i will. –  maztaz Oct 24 '12 at 16:38
    
i noticed glower has a GoogleMaps and ModestMaps javascript. Is there one for OpenLayers? –  maztaz Oct 24 '12 at 16:39
    
well, i can't get a better explanation than this mapbox.com/demo/visiblemap –  maztaz Oct 24 '12 at 17:09
    
> It sounds like your tile-offset position is constantly being determined on mouse movement and that position corresponds to the json grid's rows/columns. Is that how the look-up for the utf characters is done? Yes - offsets based on the pixel position into a big array of strings. The encoding is just made to compress well with gzip. Right now I've only worked on glower for Modest Maps - at that point there was no UTFGrid support in OpenLayers. –  tmcw Oct 25 '12 at 15:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.