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: no layers founds when parsing zipped shp file from the samples #213

Open
helxsz opened this issue Jun 23, 2024 · 0 comments
Open

Comments

@helxsz
Copy link

helxsz commented Jun 23, 2024

currently using vue3 with shpjs, the version is "^5.0.1".
i tried to use a public dataset found in the repository, https://github.com/calvinmetcalf/shapefile-js/blob/gh-pages/files/counties5.zip.

export async function loadGeojson(file: File): Promise<FeatureCollection<any>> {
    const format = file.name.split('.').at(-1).toLowerCase();
    let geojson: FeatureCollection<any>;
    switch (format) {
      case 'zip': {
        const parsed = await shp(await file.raw.arrayBuffer());
        geojson = parsed;
        break;
      }

but the codes running with an error

shpjs.js?v=9c11b5bb:6989 Uncaught (in promise) Error: no layers founds
    at parseZip (shpjs.js?v=9c11b5bb:6989:11)
    at async Module.loadGeojson (shp.ts:55:24)
    at async Proxy.uploadFile (upload.vue:146:13)

any idea how to work it out?

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