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
When running the first example I get the following error. Removing the map.zoomAll(); line allows it to render an image.
I'm not sure if it's the expected output since // expected output: https://github.com/mapnik/node-mapnik-sample-code/blob/master/outputs/map.png is a 404.
node ./render/app.js ./stylesheet.xml map.png
/Users/Steve/Play/mapnik/node-mapnik-sample-code/render/app.js:33
map.renderFileSync(image);
^
Error: Invalid index file
at Error (native)
at Object.<anonymous> (/Users/Steve/Play/mapnik/node-mapnik-sample-code/render/app.js:33:5)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:1003:3
map.zoomAll is critical to rendering the image so removing it just resulted in a empty image. I found this which lead me to removing the .index file from my data. Now I am able to render the map successfully! Sounds like mapnik should handle the index file though?
@almccon and I recently ran into this too. It appears that somewhere in the mapnik-3.4 series the index file format has changed (we were reproducing it with 3.4.16).
We managed to solve it by using the shapeindex alternative that now ships with node-mapnik: node_modules/.bin/mapnik-shapeindex.js
I've just removed the index file from this repo to ensure that the same code works with all versions of node-mapnik. Sorry about being slow to help troubleshoot here but @mojodna had the right fix. More details at mapnik/node-mapnik#590
Activity
[-]map.ZoomAll breaks first example[/-][+]Invalid index file[/+]speg commentedon Jan 27, 2016
map.zoomAllis critical to rendering the image so removing it just resulted in a empty image. I found this which lead me to removing the.indexfile from my data. Now I am able to render the map successfully! Sounds like mapnik should handle the index file though?sethfitz commentedon Feb 4, 2016
@almccon and I recently ran into this too. It appears that somewhere in the mapnik-3.4 series the index file format has changed (we were reproducing it with 3.4.16).
We managed to solve it by using the
shapeindexalternative that now ships with node-mapnik:node_modules/.bin/mapnik-shapeindex.js/cc @springmeyer
springmeyer commentedon Feb 11, 2016
I've just removed the index file from this repo to ensure that the same code works with all versions of node-mapnik. Sorry about being slow to help troubleshoot here but @mojodna had the right fix. More details at mapnik/node-mapnik#590