Skip to content
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

Shapefile Read Fails with NodeJS 18 but works with NodeJS 16 #989

Closed
crh3675 opened this issue Oct 20, 2023 · 2 comments
Closed

Shapefile Read Fails with NodeJS 18 but works with NodeJS 16 #989

crh3675 opened this issue Oct 20, 2023 · 2 comments

Comments

@crh3675
Copy link

crh3675 commented Oct 20, 2023

Using the example on the main page:

var mapnik = require('mapnik');
mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input'));
var ds = new mapnik.Datasource({type:'shape',file:'test/data/world_merc.shp'});
var featureset = ds.featureset()
var geojson = {
  "type": "FeatureCollection",
  "features": [
  ]
}
var feat = featureset.next();
while (feat) {
    geojson.features.push(JSON.parse(feat.toJSON()));
    feat = featureset.next();
}
fs.writeFileSync("output.geojson",JSON.stringify(geojson,null,2));

This fails with NodeJS 18:

Mapnik LOG> 2023-10-20 16:50:49: Shape Plugin: error processing field attributes, Shape Plugin: wrong file code -1532402325
@crh3675
Copy link
Author

crh3675 commented Oct 24, 2023

Related but for another project ZJONSSON/node-unzipper#286. And nodejs/node@654b747

@artemp
Copy link
Member

artemp commented Apr 24, 2024

Just checked (master) works with

lts/hydrogen -> v18.20.2
lts/iron -> v20.12.2

Closing as stale

@artemp artemp closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants