2022-03-23 22:54:04 +01:00
|
|
|
import sqlite3
|
|
|
|
|
|
|
|
def getCursorWithSpatialite(db_path: str = None) -> sqlite3.Cursor:
|
2022-04-12 23:17:40 +02:00
|
|
|
print(db_path)
|
2022-03-23 22:54:04 +01:00
|
|
|
db = sqlite3.connect(db_path)
|
|
|
|
cur = db.cursor()
|
|
|
|
db.enable_load_extension(True)
|
|
|
|
cur.execute('SELECT load_extension("mod_spatialite")')
|
|
|
|
return cur
|