Skip to content

Conversation

jayneel-shah18
Copy link
Contributor

This PR addresses the four issues in the i.in.spotvgt module that previously led to incorrect imports or completely null raster outputs as highlighted in #6175.

Summary of Changes:

  • Line if f < 2: caused type error due to comparison of list directly, it has been correctly fixed as if len(f) < 2:
  • Previously, qname = spotname.replace("NDV", "SM") resulted in missing file error due to missing extension. This has been fixed by changing it to qname = spotname.replace("NDV", "SM") + ".HDF"
  • In the old version,
rules = [
    r + "\n"
    for r in [
        "8 50 50 50",
        ...
    ]
]
gs.write_command("r.colors", map=smfile, rules="-", stdin=rules)

raised TypeError as stdin can only accept string or bytes. This has been fixed by modifying it to:

rules = """8 50 50 50
11 70 70 70
...
252 green
"""
  • Line gs.use_temp_region() caused the output map to be null, since the temporary region prevented g.rename and r.mapcalc results from being preserved in main mapset. This line has been commented out.

This PR closes #6175.

@github-actions github-actions bot added Python Related code is in Python module imagery labels Aug 7, 2025
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

I have a question/suggestion for the rules block change, and I'm not sure of commenting out the temporary project and its effects. Please someone evaluate this.

Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

The line for using temporary region needs to stay there, otherwise running the script will change the global region, which is unexpected. I don't see how the problem could be caused by this, could you show how to reproduce the problem?

@petrasovaa petrasovaa enabled auto-merge (squash) August 21, 2025 18:41
@petrasovaa petrasovaa merged commit f81f4c8 into OSGeo:main Aug 21, 2025
27 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imagery module Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Multiple issues in i.in.spotvgt causing silent failures and NULL outputs
3 participants