Skip to content

Invalid index file #6

Open
Open

Description

@speg

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

mapnik-config --version
3.0.5
node -e "console.log(require('mapnik').version)"
3.4.15

This also happens in the tile examples. When the map.extent = bbox; line is removed it seems to work.

Activity

  1. changed the title [-]map.ZoomAll breaks first example[/-] [+]Invalid index file[/+] on Jan 22, 2016
  2. speg commented on Jan 27, 2016

    @speg
    Author

    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?

  3. sethfitz commented on Feb 4, 2016

    @sethfitz
    Member

    @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

    /cc @springmeyer

  4. springmeyer commented on Feb 11, 2016

    @springmeyer
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions