[gdal-dev] gdalwarp - Erroneous Outputs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] gdalwarp - Erroneous Outputs

Bryant
Hello!

I've been trying to use /gdalbuildvrt/ and /gdalwarp/ to merge, project, and
crop a set of overlapping images with a new resolution.

However, I've been running into an issue where the edges of the resulting
image have nondeterministic, erroneous values (ie. very large and small
values) and values in regions that I would expect only NoDataValues. The
images are Float32, 1 banded, and have nodata =
-340282346638528859811704183484516925440.

My commands are:
gdalbuildvrt -r cubic -srcnodata -340282346638528859811704183484516925440
-vrtnodata -340282346638528859811704183484516925440 -te -122.445455
37.747147 -122.433587 37.756551 -tr 0.000031 0.000031 -input_file_list
file-list.txt ~/raster.vrt
gdalwarp --config GDAL_CACHEMAX 1024 -t_srs "+proj=utm +datum=WGS84 +zone=10
+units=m" -tr 2.709812 3.424375 -te 548854.456592 4177905.79342
549893.700272 4178955.41704 -r cubic -srcnodata
-340282346638528859811704183484516925440 -dstnodata 0 ~/raster.vrt
~/raster.tif

Input files:
file-list.txt
<http://osgeo-org.1560.x6.nabble.com/file/t384756/file-list.txt>  ,
raster1.img <http://osgeo-org.1560.x6.nabble.com/file/t384756/raster1.img>
,  raster2.img
<http://osgeo-org.1560.x6.nabble.com/file/t384756/raster2.img>  , and
raster3.img <http://osgeo-org.1560.x6.nabble.com/file/t384756/raster3.img>  

In the region bounded by my extents, two images (raster1.img and
raster3.img) have only NoDataValues, while the other has valid values for
part of the region.

In my testing, I've found that this issue does not arise when using gdal
v2.2.0 or v2.2.4, but does with v2.3.0 and v2.4.0. See output from  v2.2.4
<http://osgeo-org.1560.x6.nabble.com/file/t384756/output-gdal2-2-4.tif>  
and  v2.4.0
<http://osgeo-org.1560.x6.nabble.com/file/t384756/output-gdal2-4-0.tif>  .

Some other things I've discovered while attempting to debug this issue:
- Setting the resampling method of gdalbuildvrt to anything besides nearest
results in the issue.
- Initializing the destination image in gdalwarp via -wo "INIT_DEST=NO_DATA"
fails to resolve this issue.

Any help would be appreciated!



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdalwarp - Erroneous Outputs

Bryant
bump



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdalwarp - Erroneous Outputs

Even Rouault-2
In reply to this post by Bryant
On lundi 8 avril 2019 08:55:49 CEST Bryant wrote:

> Hello!
>
> I've been trying to use /gdalbuildvrt/ and /gdalwarp/ to merge, project, and
> crop a set of overlapping images with a new resolution.
>
> However, I've been running into an issue where the edges of the resulting
> image have nondeterministic, erroneous values (ie. very large and small
> values) and values in regions that I would expect only NoDataValues. The
> images are Float32, 1 banded, and have nodata =
> -340282346638528859811704183484516925440.

That's likely a precision issue in how you specify the nodata value or how it
is serialized in the VRT. There have been fixes in that area (thinking to
https://github.com/OSGeo/gdal/issues/1071 ), but this is always fragile.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev