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

Clearification regarding "resampling" in wiki needed #85

Open
simjoh opened this issue Apr 15, 2024 · 3 comments
Open

Clearification regarding "resampling" in wiki needed #85

simjoh opened this issue Apr 15, 2024 · 3 comments

Comments

@simjoh
Copy link

simjoh commented Apr 15, 2024

In the documentation on the wiki page of this repo in the section updateRasterInfo() there are some information about the keyword "resampling". I've been playing a little with this parameter while trying to to get a python raster function to behave as we want. I've a few questions regarding this parameter.

  1. Should the parameter name be "Resampling" instead of "resampling"? Using kwargs['output_info']['Resampling'] = False has some effect but not kwargs['output_info']['resampling'] = False
  2. The documentation says that the default value of resampling is False but I've the experience of the opposite. I'm aware of the 'inheritProperties' and 'invalidateProperties' parameters of get configuration. But I'm not able to configure those so that False becomes the default value of 'Resampling'.
  3. In getConfiguration() i've found that adding a keword of "Resampling" or "resampling" has effect on kwargs['output_info']['Resampling'] in updateRasterInfo() . What is the effect of setting this paramter to True/False? Is it the same as changing it in

On the wiki page I also founds some information regarding selectRasters(). But I can't trigger this to run. Is it possilbe to get it to run on a single raster dataset?

@simjoh simjoh changed the title Clearification regarding "resampling" needed Clearification regarding "resampling" in documentation needed Apr 16, 2024
@simjoh simjoh changed the title Clearification regarding "resampling" in documentation needed Clearification regarding "resampling" in wiki needed Apr 16, 2024
@shenganzhan
Copy link
Contributor

shenganzhan commented Apr 17, 2024

@simjoh please see below:

  1. The keywork is “resampling” only. It's suggested to set this property in .getConfiguration() as well as .updateRasterInfo().
    As per the code, it seems like if the property is set in .getConfiguration() you don’t need to set the property in .updateRasterInfo(). It should already have the correct value. Setting the property only in .updateRasterInfo() may not work as expected.
    If this doesn’t work, please share your py script with us and so we can take a look.
  2. The default value is False. Probably No.1 above is affecting your workflow.
  3. Please see 1 – the resampling flag is read from the properties returned by .getConfiguration() and then passed along to .updateRasterInfo().

@simjoh
Copy link
Author

simjoh commented Apr 18, 2024

@shenganzhan Thanks for your input. I've changed the code by setting resampling in getConfiguration(). But If it is suggested to set the propery in .getConfiguration() and updateRasterInfo(), then I think 'Resampling' is needed in updateRasterInfo.

Regarding default property my exceprience with the current dataset is that the default is False. Maybe it is a property of the dataset but I try to ovverride inheritence of properties by

'inheritProperties': 1,# inherit just PixelType
'invalidateProperties': 1| 2 | 4 |8,      # invalidate histogram and statistics because we are modifying pixel values

In my first post I also mentioned the method -selectRasters() how do I use that. I don't get it to run in my prf.

@shenganzhan
Copy link
Contributor

@simjoh selectRasters works on multiple raster inputs

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

No branches or pull requests

2 participants