GDALwarp: Re-projecting from EPSG to EPSG; problem: "double pixels"

المشرف العام

Administrator
طاقم الإدارة
I would like to change the projection from a png file that shows river pixels that exceed a certain threshold. Therefore I am following this workflow: (note: it is part of a larger R script)

1) transform from png to geotiff

system("gdal_translate -of Gtiff -a_ullr -180 90 180 -60 -a_srs EPSG:4326 -a_nodata 0 RPdis20140102+024h_temp.png RPdis20140102+024h_temp.tiff")

Here a screenshot showing one particular area (Not whole image is shown here,as coloured pixels would not be visible without zooming in):

2) reproject from WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs to #GOOGLE/Spherical Mercator projection coordinate system +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

system("gdalwarp -s_srs EPSG:4326 -t_srs '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' -srcnodata 0 -dstnodata 0 -to RPC_HEIGHT=0.1 -te -20037507.0671618 -8409028.04161379 20042492.9328382 30240971.9583862 -tr 10000 10000 -tap RPdis20140102+024h_temp.tiff RPdis20140102+024h_proj_temp.tiff")

Same area after re-projection:

All works well, except that now the river is at some locations 2 pixels wide, and not one as originally (and needed). I tried to play with the resampling method and the transformer options, but I can't figure out how to get rid of this effect.



أكثر...
 
أعلى