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
Add SpatiaLite helpers to CLI #398
Comments
I like these designs a lot. I would suggest The other part of this story is how we support actually inserting spatial data from the command-line. I opened an issue about the challenges in doing that for the Python API here - #399 - but we need a good answer for the CLI too. I don't yet have any good ideas here. The |
That's a good call. I'm happy for |
For ingesting geometry data from the command-line maybe GeoJSON would be the best route? |
@eyeseast how do you usually insert geometries at the moment? |
I'm mostly using geojson-to-sqlite at the moment. Even with shapefiles, I'm usually converting to GeoJSON and projecting to EPSG:4326 (with ogr2ogr) first. I think an open question here is how much you want to leave to external libraries and how much you want here. My thinking has been that adding Spatialite helpers here would make external stuff easier, but it would be nice to have some standard way to insert geometries. I'm in the middle of adding GeoJSON and Spatialite support to geocode-sqlite, and that will probably use WKT. Since that's all points, I think I can just make the string inline. But for polygons, I'd generally use Shapely, which probably isn't a dependency you want to add to sqlite-utils. I've also been trying to get some of the approaches here to work, but haven't had any success so far. |
Yeah I'd like to avoid adding any geo-dependencies to |
Adding some thoughts to: |
Been chipping away at this between other things and realized I think it's probably worth keeping a SpatiaLite flag on |
Now that #385 is merged, add CLI versions of those methods.
Should be mostly straightforward. The one thing worth highlighting in docs is that geometry columns can only be added to existing tables. Trying to add a geometry column to a table that doesn't exist yet might mean you have a schema like
{"rowid": int, "geometry": bytes}
. Might be worth nudging people to explicitly create a table first, then add geometry columns.The text was updated successfully, but these errors were encountered: