I'm working with Sentinel-1 data and trying to use the raster package in r to read it. I got the following error. The raster seems not to be well georeferenced. The resolution and extent are not displayed correctly. Meanwhile, I reckon r also does not read the dimensions correctly. The matrix of 26503*16885 should be the dimensions of valid pixels only.
> library(raster)
> x = raster('s1a-iw-grd-vv-20180130t193923-20180130t193948-020388-022d67-001.tiff')
> x
class : RasterLayer
dimensions : 16885, 26503, 447503155 (nrow, ncol, ncell)
resolution : 1, 1 (x, y)
extent : 0, 26503, 0, 16885 (xmin, xmax, ymin, ymax)
crs : +proj=longlat +datum=WGS84 +no_defs
source : /scratch/os22/yy4778/SingleChannelAlgo_90m/sentinel/S1A_IW_GRDH_1SDV_20180130T193923_20180130T193948_020388_022D67_6CF9.SAFE/measurement/s1a-iw-grd-vv-20180130t193923-20180130t193948-020388-022d67-001.tiff
names : s1a.iw.grd.vv.20180130t193923.20180130t193948.020388.022d67.001
values : 0, 65535 (min, max)
When I use ArcGIS or QGIS to read it, it can be displayed correctly. It can be seen that the dimensions have been adjusted to 30344*20520 and the extent can be read correctly.
### Information from QGIS###
Name s1a-iw-grd-vv-20180130t193923-20180130t193948-020388-022d67-001
Path /g/data/fj4/users/yu/s1a-iw-grd-vv-20180130t193923-20180130t193948-020388-022d67-001.tiff
CRS EPSG:4326 - WGS 84 - Geographic
Extent 143.5295688650110151,-32.2190784216897512 : 146.6789677467667730,-30.0893109205815179
Unit degrees
Width 30344
Height 20520
Data type UInt16 - Sixteen bit unsigned integer
GDAL Driver Description GTiff
GDAL Driver Metadata GeoTIFF
Dataset Description
Compression
Band 1
STATISTICS_APPROXIMATE=YES
STATISTICS_MAXIMUM=1175
STATISTICS_MEAN=71.533019359901
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=68.573526261316
STATISTICS_VALID_PERCENT=100
More information
Dimensions X: 30344 Y: 20520 Bands: 1
Origin 143.53,-30.0893
Pixel Size 0.0001037898392352941792,-0.0001037898392352941792
A correct display by QGIS is attached as below.
Can I ask how should I use R to correctly read the data?
I have tried methods like gdal utils (e.g. gdal_translate) to set the four corners but does not work for this one.
The tiff data is available from: https://drive.google.com/file/d/1Ox6uOhQYSFMzO1Hut-CjAqjPu06_-y1o/view?usp=sharing