-
-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New run_sanity_checks mechanism, for SpatiLite
Moved VirtualSpatialIndex check into a new mechanism that should allow us to add further sanity checks in the future. To test this I've had to commit a binary sample SpatiaLite database to the repository. I included a build script for creating that database. Closes #466
- Loading branch information
Showing
5 changed files
with
68 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sqlite3 | ||
|
||
# This script generates the spatialite.db file in our tests directory. | ||
|
||
|
||
def generate_it(filename): | ||
conn = sqlite3.connect(filename) | ||
# Lead the spatialite extension: | ||
conn.enable_load_extension(True) | ||
conn.load_extension("/usr/local/lib/mod_spatialite.dylib") | ||
conn.execute("select InitSpatialMetadata(1)") | ||
conn.executescript("create table museums (name text)") | ||
conn.execute("SELECT AddGeometryColumn('museums', 'point_geom', 4326, 'POINT', 2);") | ||
# At this point it is around 5MB - we can shrink it dramatically by doing thisO | ||
conn.execute("delete from spatial_ref_sys") | ||
conn.execute("delete from spatial_ref_sys_aux") | ||
conn.commit() | ||
conn.execute("vacuum") | ||
conn.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
generate_it("spatialite.db") |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters