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?
to your account
In conjunction with #135 - this would do the same thing as --load-extension=path-to-spatialite (see #134)
The text was updated successfully, but these errors were encountered:
I think this should initialize SpatiaLite against the current database if it has not been initialized already.
Relevant code: https://github.com/simonw/shapefile-to-sqlite/blob/e754d0747ca2facf9a7433e2d5d15a6a37a9cf6e/shapefile_to_sqlite/utils.py#L112-L126
def init_spatialite(db, lib):
# Initialize SpatiaLite if not yet initialized
if "spatial_ref_sys" in db.table_names():
def ensure_table_has_geometry(db, table, table_srid):
if "geometry" not in db[table].columns_dict:
"SELECT AddGeometryColumn(?, 'geometry', ?, 'GEOMETRY', 2);",
Not sure if I should add a utility function or CLI command for that ensure_table_has_geometry bit.
Sorry, something went wrong.
The --spatialite option should be available for other useful commands too, refs #137.
To keep the code cleaner, I'm tempted to support this instead:
Where spatialite is a special shortcut value that triggers a search for that module in known locations.
Users could still load a module in a file called spatialite in the current directory using:
In fact, --load-extension=spatialite could handle that case too by always checking for a file called spatialite before attempting to search for it in known locations.
Refs #182 #137 #136 #184 #181
No branches or pull requests