WIP: r.import: add null value option and use r.external before re-projecting
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).
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.
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...
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.
@ninsbl: can you please rebase this PR?