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

Fix STRDS removement and unregistration of rasters in STRDS #354

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

anikaweinmann
Copy link
Member

@anikaweinmann anikaweinmann commented Jun 15, 2022

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.

@anikaweinmann anikaweinmann changed the title Fix STRDS removement and unregistration of rasters in STRDS Draft:Fix STRDS removement and unregistration of rasters in STRDS Jun 15, 2022
@anikaweinmann anikaweinmann marked this pull request as draft June 15, 2022 12:54
@anikaweinmann anikaweinmann changed the title Draft:Fix STRDS removement and unregistration of rasters in STRDS Fix STRDS removement and unregistration of rasters in STRDS Jun 15, 2022
@anikaweinmann anikaweinmann marked this pull request as ready for review June 17, 2022 14:31
source_path, target_path,
msg="merge mapsets. Error in linking")

def _copy_folder(
Copy link
Contributor

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}')"
Copy link
Contributor

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?

@metzm
Copy link
Contributor

metzm commented Jun 17, 2022

What about creating a list of space-time datasets to be copied and using t.copy?

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}')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"REPLACE({col}, '{source_mapset}', '{target_mapset}')"
f"REPLACE({col}, '@{source_mapset}', '@{target_mapset}')"

untested, make sure to verify 🙈

Copy link
Contributor

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".

@neteler neteler added this to the next_patch milestone Nov 8, 2022
@anikaweinmann anikaweinmann self-assigned this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants