4

I am reprojecting a SRTM 3 arc-second raster file from WGS84 geographic coordinate system, to projected coordinate system which is using Azimuthal Equidistant projection:

gdalwarp -s_srs EPSG:4326 -t_srs "+proj=merc +lat_ts=40.81266 +lon_0=14.414252" -r near -of GTiff C:/vesuvius2_wgs84.tif C:/vesuvius2_aeqd.tif

I attached the initial raster file in here (vesuvius_wgs84.tif).

The issue is that if I use the Nearest neighbor resampling method (-r near), some sort of "stripes" appear on terrain once I reproject the file to Azimuthal Equidistant projection. Here is the how the reprojected raster looks like:

vesuvius2_aeqd.tif

And here is its 3d representation:

vesuvius2_aeqd.tif 3D

Interestingly similar "stripes" appear in both direction if I reproject the initial raster to UTM:

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:32633 -r near -of GTiff C:/vesuvius2_wgs84.tif C:/vesuvius2_epsg32633.tif

The "stripes" go away when I use Bilinear or Cubic resampling methods (-r bilinear, -r cubic) instead of the Nearest Neighbor one.

Why do these "stripes" appear when Nearest Neighbor resampling method is used?

  • 1
    try -r <any other method> I think the 'near' is causing the stripes. Good choices are bilinear, cubic, cubicspline. These methods will take longer to create an output but I think it will be more usable. The boxes come from deep in the code. It's not as important to know where they come from only that they do appear when using this resample method. Near is supposed to be used for succinct data like land classes and not continuous like DEM data. – Michael Stimson Apr 25 '16 at 21:50
  • I have the feeling your source data were made by overlapping tiles. And you added the overlapping areas in the process. – nickves Apr 25 '16 at 21:57
  • Thank you for the replies, both @MichaelMiles-Stimson and nickves. - yes, the "stripes" disappear when bilinear or cubic are used. Can you just explain a little bit more what "succinct data like land classes" are? - nickves: No overlapping tiles, I downloaded a clean raster area from opentopography.org – marco Apr 25 '16 at 22:05
  • Succinct data is classified data, like a raster where 1='water', 2='urban' etc.. for each cell, the data is integer and only contains a collection of a few values, conversely continuous data is of a float (or int, but rarely) type and each cell potentially has a different value to all other cells. The nearest operator tries to assign the value of the closest warped cell expecting unique values which shows up as steps or boxes in continuous data. – Michael Stimson Apr 25 '16 at 22:09
  • @MichaelMiles-Stimson thank you. How can I mark your reply as the problem solving one? – marco Apr 25 '16 at 22:13
6

The resampling method 'near' or 'nearest' is generally to be considered only for succinct/classified data, it attempts to assign a cell value based on the closest source pixel: Example of classified data

This is most commonly integer (int8, int32, int64) types but can be of type float (float32, float64) where each cell represnts classified values and generally values appear more than once in the raster. This one is of an erosion model but can equally be a scanned and georeferenced map.

When using continuous data resampling methods like bilinear, cubic, cubicspline should be used as these will attempt to find the best value based on all the sourounding source pixels. Continous data can be int or float but differs in that each cell may have a value that is different to any other pixel: example continuous data Examples of this raster type are DEM (usually float, but may be int) and orthophotography (usually int8).

The main difference between these data types is that succinct data values must be maintained (if 1='water' and 2='land' 1.5 is not a valid value) but continuous data exact values are not mandatory and some interpolation is allowed without destroying the integrity of the data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.