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

shp2json error in node v4.2.6 #38

Closed
ghost opened this issue Aug 3, 2017 · 3 comments
Closed

shp2json error in node v4.2.6 #38

ghost opened this issue Aug 3, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2017

I see you have an example that use exactly what i want to have:
https://gist.github.com/mbostock/5557726

My node version:

node --version

v4.2.6

shp2json --version

0.6.4

v4.2.6 and 0.6.4 are the default for the ubuntu LTS realease.

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

Here what i do:

curl -o estados.zip http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip
curl -o  municipios.zip http://mapserver.inegi.org.mx/MGN/mgm2010v5_0.zip
unzip estados.zip 
unzip municipios.zip
ogr2ogr states.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
ogr2ogr municipalities.shp Municipios_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"

shp2json fail in both cases:

shp2json states.shp -o states2.json

(node) Buffer.set is deprecated. Use array indexes instead.
error: Invalid array length

shp2json municipalities.shp -o municipalities2.json

(node) Buffer.set is deprecated. Use array indexes instead.
error: Offset is outside the bounds of the DataView

Thanks.

@mbostock
Copy link
Owner

mbostock commented Aug 3, 2017

Thank you. It appears the current version requires Node v6+ as it depends on buffer.set using the TypedArray implementation; see the release notes. However I can make a small change to make this work on older versions.

@mbostock
Copy link
Owner

mbostock commented Aug 3, 2017

Fixed in 0.6.5.

@mbostock mbostock closed this as completed Aug 3, 2017
@ghost
Copy link
Author

ghost commented Aug 3, 2017

@mbostock thanks to you, you are like a machine creating useful things.... :)

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

1 participant