You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
92a63df shows a problem with the current approach of creating the datasource. In a complex layer, there will be many rules referring to many attributes. We currently have to list all the attributes in the legend.json file, but a better approach would involve only listing e.g. "highway": "motorway"
Given we can assume that unmentioned attributes should be null (or equivalent), we could
modify the csv datasource and add an "assume missing attributes are null" option
figure out the full list of attributes mentioned in the style
For the latter, I've spent a while going through the mapnik source code, to see how it works. We already have access to the list of expressions (aka filters) e.g.
To get a list of attributes from a filter (which can be fairly complex) mapnik uses the attribute_collector (which happens during rendering at feature_style_processor_impl.hpp#L373).
Perhaps with some more ruby-mapnik bindings (specifically for attribute_collector), we could create our own attribute_collector instance to gather the attributes, then merge the missing ones in with the ones from legend.json and use the combined list when creating the datasource.
Other ideas welcome!
The text was updated successfully, but these errors were encountered:
92a63df shows a problem with the current approach of creating the datasource. In a complex layer, there will be many rules referring to many attributes. We currently have to list all the attributes in the legend.json file, but a better approach would involve only listing e.g.
"highway": "motorway"
Given we can assume that unmentioned attributes should be null (or equivalent), we could
For the latter, I've spent a while going through the mapnik source code, to see how it works. We already have access to the list of expressions (aka filters) e.g.
To get a list of attributes from a filter (which can be fairly complex) mapnik uses the attribute_collector (which happens during rendering at feature_style_processor_impl.hpp#L373).
Perhaps with some more ruby-mapnik bindings (specifically for attribute_collector), we could create our own attribute_collector instance to gather the attributes, then merge the missing ones in with the ones from legend.json and use the combined list when creating the datasource.
Other ideas welcome!
The text was updated successfully, but these errors were encountered: