Skip to content

Commit

Permalink
Try fix "SQLite objects created in a thread can only be used in that …
Browse files Browse the repository at this point in the history
…same thread"
  • Loading branch information
uba committed Aug 5, 2024
1 parent 2b32560 commit 2b83c00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tathu/io/spatialite.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, database, table, attrs, outputRaster=True, raster2int=True):
initSpatialMetadata = True

# Make connection
self.conn = sqlite3.connect(database, detect_types=sqlite3.PARSE_DECLTYPES)
self.conn = sqlite3.connect(database, detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False)
self.conn.row_factory = sqlite3.Row

# Load spatial extension (SpatiaLite)
Expand Down Expand Up @@ -387,7 +387,7 @@ def __fetchSystems(self, cur, attrs):

# Apply mask
raster = np.ma.masked_where(raster == nodata, raster, False)

s.raster = raster
if raster.dtype == np.int16:
s.raster = raster/100.0
Expand Down

0 comments on commit 2b83c00

Please sign in to comment.