grass icon indicating copy to clipboard operation
grass copied to clipboard

WIP: r.import: add null value option and use r.external before re-projecting

Open ninsbl opened this issue 5 years ago • 5 comments

The changes would allow users to specify a NoData value for data sources that do not necessarily provide one. This can be useful before re-projection. Furthermore, r.in.gdal would be replaced with r.external in case of re-projection (which should speed-up the process a bit).

ninsbl avatar May 03 '20 21:05 ninsbl

This PR raises the question if r.import should support all options and flags of r.in.gdal + r.proj. Please remove calls to print() or replace them with GRASS debug messages and make sure the messages do not attempt to print a variable that is None.

metzm avatar May 04 '20 19:05 metzm

This PR raises the question if r.import should support all options and flags of r.in.gdal + r.proj.

Valid question! I have no strong opinion here. Being able to specify a NoData value before reprojection might be helpful (e.g. in i.sentinel.import). Also, using r.external instead of r.in.gdal might make the process more efficient. Though, I am not sure if that could cause issues depending on the data source (e.g. HDF kind of data with subdatasets...). So, I am open to changes and even dropping the PR if potential issues outweigh usefulness of the enhancements...

ninsbl avatar May 04 '20 20:05 ninsbl

In the meantime, r.import has changed, conflicts need to be resolved.

IMHO, this PR should be merged first, then we can think of special cases like Sentinel-2 where e.g. some water areas have wrong zero cells which could be corrected with i.zero2null, see comments in addons PR506.

metzm avatar May 14 '21 19:05 metzm

@ninsbl: can you please rebase this PR?

neteler avatar Nov 07 '23 13:11 neteler