-
Notifications
You must be signed in to change notification settings - Fork 120
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
unzip throwing exception #46
Comments
HorshoeBa_ElevationToolbox_WedJun14163538.zip |
All that said the solution was to modify unzip thusly: `
}; ` |
I'm not sure I understand your fix |
On some loads the *.shx file would result in an exception. They were being processed by a.asText() (they are binary). The fix just ignores them. A better fix might be: thereby ignoring all files not required. |
yeah it think I switched it when we started handling cpg files, I should be
able to fix it monday
…On Fri, Jun 16, 2017 at 12:08 PM softsprocket ***@***.***> wrote:
On some loads the *.shx file would result in an exception. They were being
processed by a.asText() (they are binary). The fix just ignores them. A
better fix might be:
if (a.name.slice(-3).toLowerCase() === 'shp' ||
a.name.slice(-3).toLowerCase() === 'dbf') { out[a.name] =
a.asArrayBuffer(); } else if (a.name.slice(-3).toLowerCase() === 'prj' {
out[a.name] = a.asText(); }
thereby ignoring all files not required.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABE4n1G_qFApklp3gWbAOIXiIaEnGRF8ks5sEqiIgaJpZM4N7iJV>
.
|
I'm using zipped shapefiles loaded from dronedeploy and passing an arraybuffer to leaflet.shapefile. I'm working on three projects. One succeeds but two don't I traced into shape and found this being throw by unzip:
RangeError: Maximum call stack size exceeded
at utf8Slice (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:1029:30)
at Uint8Array.slowToString (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:710:16)
at Uint8Array.toString (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:739:23)
at Object.utf8decode (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:3984:53)
at Object.utf8decode (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:3590:21)
at ZipObject.dataToString (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:2788:22)
at ZipObject.asText (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:2835:29)
at http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:320:20
at Array.forEach (native)
at module.exports (http://localhost:1841/js/leaflet1/shp.js?_dc=1497547765872:315:8)
The line numbers won't mean much since I put some debugging in. I can download the zip file and drag it onto your test project and it works. I wondered if it's a size issue but the failed files give:
ArrayBuffer returned 12228250
ArrayBuffer returned 1882584
and the successful on:
ArrayBuffer returned 6531249
Only the successful one fires 'data:loaded' of course.
My code:
`
The text was updated successfully, but these errors were encountered: