calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
714 stars 228 forks source link

Doesn't work with file coming from an input file? #172

Closed diegottivos closed 2 years ago

diegottivos commented 2 years ago

I'm calling an onChange but it gives me an error

<input accept=".zip" onChange={importShape} type="file" />

const importShape = async (data) => {
    const file = data.target.files[0];

    const geojson = await shp(file);

    console.log(geojson);
  };

image

kuztom commented 5 months ago

Hi! Did you come up with a solution? Im having same problem.. Additional details on how this was accomplished would be appreciated.