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

Make geo_types directly Writable and Readable without having to use Convertions #22

Open
tmontaigu opened this issue May 1, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@tmontaigu
Copy link
Owner

tmontaigu commented May 1, 2021

This might not be possible as some geotypes are not compatible / has no shapefile equivalent, but should still be looked into

@tmontaigu tmontaigu added the enhancement New feature or request label May 1, 2021
@tmontaigu
Copy link
Owner Author

What is this geozero thing, and could it be used/implemented ? 🤔

@tmontaigu tmontaigu self-assigned this May 1, 2021
@michaelkirk
Copy link

I've used geozero just a bit, but haven't used the shapefile features. If you haven't already found it, there is some support for reading (but not yet writing) shapefiles https://github.com/georust/geozero/blob/master/geozero-shp/src/shp_reader.rs

The reading support leverages your dbase crate.

If you have questions, the primary author @pka might be able to help.

@pka
Copy link

pka commented May 3, 2021

Converting between formats without intermediate representation is the primary goal of geozero. The mentioned driver is a stripped down version of shapefile-rs which supports reading shapefiles and converting to geo_types, but also to GeoJSON, WKT, GEOS, GDAL and others. But the other direction is not supported and not high on the priority list. If there is a idea for collaboration, I'm open for it.

@tmontaigu
Copy link
Owner Author

I wanted to explore the possibility of reading and writing directly to geo_types without going through conversions between shapefile-rs types and geo_types as I think geo_types are often used.

Implementing that using geozero, if I understand correctly, would give more flexibility in the output type of the reader
however I also need the ability to write and I'd like this to be an optional feature

@worace
Copy link

worace commented Jul 30, 2021

I'm interested in following the discussion here as well as I've started trying to use this library to add shp reading to https://github.com/worace/geoq.

1 thing that I've run into a lot when working in the geo rust ecosystem is that geo_types coordinates only support x and y. With that limitation, I think you are always going to need some additional set of types to handle the Z and M variants, right?

I was looking at similarly reading shp -> geojson, and while I could potentially rely on the shapefile -> geo_types conversions shipped with this library to go shp -> geo_types -> geojson, it would only work for the 2d variants. So I think I may end up doing the whole shp -> geojson matching myself for the sake of handling as many geom types as possible.

@worace
Copy link

worace commented Jul 30, 2021

geozero is new to me as well; I will need to spend some time reading up on that. But from a quick scan it looks like it does support the dimensions needed at least. Maybe that would be a better fit for the kind of things I'm doing as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants