-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix STRDS removement and unregistration of rasters in STRDS #354
base: main
Are you sure you want to change the base?
Conversation
source_path, target_path, | ||
msg="merge mapsets. Error in linking") | ||
|
||
def _copy_folder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using shutil.copytree()
?
for col in columns: | ||
if col not in skip_columns: | ||
update_statement = f"UPDATE {table_name} SET {col} = " \ | ||
f"REPLACE({col}, '{source_mapset}', '{target_mapset}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the name of the map and of the source mapset are the same, e.g. elevation@elevation
? This would then not only replace the mapset name, but also the map name?
What about creating a list of space-time datasets to be copied and using |
for col in columns: | ||
if col not in skip_columns: | ||
update_statement = f"UPDATE {table_name} SET {col} = " \ | ||
f"REPLACE({col}, '{source_mapset}', '{target_mapset}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f"REPLACE({col}, '{source_mapset}', '{target_mapset}')" | |
f"REPLACE({col}, '@{source_mapset}', '@{target_mapset}')" |
untested, make sure to verify 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for the column "id" but not for the column "mapset".
The STRDS support is adjusted so that the tgis sqlite.db is copied by creating a temporare mapset and copies (with renamed mapset) the tgis sqlite.db by the mapset merge.
This can only work if OSGeo/grass#2447 is merged.