-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tokens in Mapnik postgis sql sub-selects not replaced using options.variables for VectorTiles #679
Comments
Same example, but written in C++ (using C++ So, problem definitely in |
This problem appears only with Vector tiles. When rendering to raster image, tokens replaced properly. var opts = {};
opts.variables = { "fieldid": 1 };
// tokens from `opts.variables` replaced properly
map.render(new mapnik.Image(256, 256), opts, function(err, im) {
...
}
// tokens not replaced
map.render(new mapnik.VectorTile(0, 0, 0), opts, function(err, vtile) {
...
} |
Based on public methods, there no ability to set So, would be good to remove options.variables option from http://mapnik.org/documentation/node-mapnik/3.5/#VectorTile.render. |
This can be solved once mapbox/mapnik-vector-tile#248 from @rafatower is pulled in. |
@aleksejleonov the patch needed is CartoDB@5182b71. Would you be able to create a PR with that patch + testcases? |
@springmeyer Maybe @rafatower have plans to merge his branch CartoDB@5182b71 into node-mapnik master? Would be nice to have response from @rafatower to avoid work duplication. |
Sounds good, we can wait from word on plans from @rafatower |
I'll take a stab at writing some tests for my patch. Thanks! |
Hello, I saw that this topic is treated in many tickets and I am a bit lost. I hope being in the right one to ask my question. Currently I use node-mapnik 3.7.2 and this issue (options.variables are not taken into account for vector tiles) persists. In the tickets I saw that the versions 3.6.3 and 3.6.4 are mentionned but there are not released. Is the fix planned for the versions 3.7.x? Thank you for your answer. |
Nobody else? :-( |
@Cadfael31 next steps at #809 (comment). Maybe you can help get this landed? |
@springmeyer , thank you for your answer, I didn't read the previous comments carefully enough. I'm sorry. About helping you, sure I would like, but I'm not sure to be good enough in development. |
Accordingly to documentation, mapnik.Map
render
method haveoptions
attribute that could containvariables
object.http://mapnik.org/documentation/node-mapnik/3.5/#Map.render
options.variables
Also, example from
mapbox/tilelive-bridge
code:https://github.com/mapbox/tilelive-bridge/blob/master/index.js#L281
Test case
I tried to pass variables to mapnik PostGIS SQL query accordingly to docs (id = @fieldid).
map_conf.xml
file:Problem
id = @fieldid
must be replaced withid = 1
, but I always getid = null
.From log of SQL queries:
Mapnik version
The text was updated successfully, but these errors were encountered: