calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
MIT License
735 stars 230 forks source link

Buffer rewrite/encoding #74

Closed calvinmetcalf closed 7 years ago

calvinmetcalf commented 7 years ago

for use in tandem with calvinmetcalf/parseDBF#10

calvinmetcalf commented 7 years ago

this change brings the size from 60KB to 234KB, almost all of that is for non utf8 encodings

calvinmetcalf commented 7 years ago

actually more like 260k, and 200k is from iconv lite

calvinmetcalf commented 7 years ago

gzipped and minified sizes for various options, in bytes

Option Size
original 59,172
just utf8 60,363
IE needs a shim for non-utf8 65,676
all encodings 236,209
calvinmetcalf commented 7 years ago

ok if we use the polyfill and require IE users who want other encodings to include a file then we can do it in 65676 bytes, though it's waiting on inexorabletash/text-encoding#70

calvinmetcalf commented 7 years ago

done