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

Cannot parse a geometry-only shapefile without a DBF #62

Open
michaelkirk opened this issue Oct 5, 2022 · 1 comment
Open

Cannot parse a geometry-only shapefile without a DBF #62

michaelkirk opened this issue Oct 5, 2022 · 1 comment

Comments

@michaelkirk
Copy link
Member

michaelkirk commented Oct 5, 2022

A user in discord reported not being able to process a shapefile because they didn't have a .dbf file.

I think we should be able to parse such a datasource, provided there's a .shp file, and just treat it as having empty properties while iterating over the geometries.

thread 'open_shp_file' panicked at 'called Result::unwrap() on an Err value: MissingDbf', src/main.rs:256:19
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/result.rs:1814:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/result.rs:1107:23
   4: geogcn::open_shp_file
             at ./src/main.rs:256:15
   5: geogcn::open_shp_file::{{closure}}
             at ./src/main.rs:249:1
   6: core::ops::function::FnOnce::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
@pka
Copy link
Member

pka commented Oct 6, 2022

I wonder whether GDAL supports this. But +1 from me, anyway.

@michaelkirk michaelkirk changed the title Cannot parse a geometry only shapefile without a DBF Cannot parse a geometry-only shapefile without a DBF Oct 6, 2022
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