Open alculquicondor opened 7 years ago
There is features=true
parameter of encode
method which should encode additional info into the grid JSON, see. This might be helpful.
I guess you are referring to something like this:
mapnik.render_layer(self.mapnik, grid, layer=index, fields=fields)
encoded_grid = grid.encode('utf', resolution=self.scale, features=True)
But that's a boolean. How do I set the data? In case you refer to the fields
parameter on render_layer call, AFAIK that refers to columns on the datasource, but I need the layer index, name or something equivalent.
But that's a boolean. How do I set the data?
The data should be already collected in the grid object. You will not get layer index or name directly, but you can distinguish it by the feature data. This is all I have, sorry.
I see, we have solved it in TileStache by manually inserting the layer name when adding each mapnik layer. But I wanted to do if there was already another solution in mapnik directly. Thanks
I'm rendering multiple layers (one on top of another), and I need a way to distinguish (on the utfgrid) to which layer the element corresponds to. Any other suggestion to accomplish this?