[Qgis-user] gdal_translate and gdalwarp questions

Antonio Silva aolinto.lst at gmail.com
Mon Sep 21 11:27:41 PDT 2015


Hello,

I have some doubts on the usage of some gdal tools. I'm trying to make a R
script, but I know that we can run gdal commands from the terminal and also
from QGIS. I use Linux/Ubuntu.

Well, after converting a hdf file from MODIS Aqua (L3) with sea surface
temperature data to tif I want to reproject to SIRGAS2000 and clip between
lats of 22 to 29 S and lats of 40 to 50 W.

HDF file (need to unpack) can be downloaded at
https://app.box.com/s/16cf7qv6af6gsz1v66staori2mtneu0r

To convert HDF file I'm using:

gdal_translate("A20080012008031.L3m_MO_SST_4","georef.tif",sd_index=1,a_ullr=c(0,4320,8640,0),
a_srs="+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371007
+b=6371007 +units=m +no_defs")

Without a_ullr and a_srs options I was getting an error message when using
gdalwarp: "ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates"

a_ullr and a_srs values I got with GDALinfo("georef.tif"). I also tryed
a_ullr=c(-180,90,180,-90).

My problem now is reproject to SIRGAS2000 and clip the image georef.tif:

gdalwarp("georef.tif", "georef2.tif",
s_srs="+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371007
+b=6371007 +units=m +no_defs",
t_srs="+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs")

georef2.tif is not in SIRGAS2000 projection and clipping option
te=c(-50,-29,-40,-22) does not work.

Where is my mistake? I hope someone can tell me.

Thanks for any help.

Antonio Olinto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150921/c4e10989/attachment.html>


More information about the Qgis-user mailing list