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

Error occured while write polygon. #87

Open
YuWebGIS opened this issue Jul 13, 2021 · 1 comment
Open

Error occured while write polygon. #87

YuWebGIS opened this issue Jul 13, 2021 · 1 comment

Comments

@YuWebGIS
Copy link

I modify a function

function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}

to

function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined &&
t.geometry.coordinates[0][0][0][0] !== undefined ) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}

Simple polygon have three [] in geometry, and multiple have four.

@sheindel
Copy link
Contributor

Hello! We should now be able to write correctly write the basic shapes, so I'm hoping this is resolved. Can you try with the latest version and close this issue if it is resolved? Thanks!

Mapbox changed their deployment organization so this library is now hosted under a different package name

@mapbox/shp-write
https://unpkg.com/@mapbox/shp-write@latest/shpwrite.js

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