Skip to content
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

t.unregister: add support to unregister maps from other mapsets #2447

Merged
merged 2 commits into from
Jun 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions temporal/t.unregister/t.unregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

import grass.script as grass


# lazy imports at the end of the file

############################################################################
Expand All @@ -77,6 +76,13 @@ def main():
dbif = tgis.SQLDatabaseInterfaceConnection()
dbif.connect()

# modify a stds only if it is in the current mapset
# remove all connections to any other mapsets
# ugly hack !
currcon = {}
currcon[mapset] = dbif.connections[mapset]
dbif.connections = currcon
wenzeslaus marked this conversation as resolved.
Show resolved Hide resolved

# In case a space time dataset is specified
if input:
sp = tgis.open_old_stds(input, type, dbif)
Expand Down Expand Up @@ -129,7 +135,7 @@ def main():
map = tgis.dataset_factory(type, mapid)

# Unregister map if in database
if map.is_in_db(dbif):
if map.is_in_db(dbif, mapset=mapset):
# Unregister from a single dataset
if input:
# Collect SQL statements
Expand Down