[Qgis-user] gdal_translate and gdalwarp questions

Andre Joost andre+joost at nurfuerspam.de
Wed Sep 23 09:58:28 PDT 2015


Am 21.09.2015 um 20:27 schrieb Antonio Silva:

>
> 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")

you entered the pixel size as a_ullr, that is definitely wrong. And 
maybe the a_srs too, because the image looks like 360x180 degree.


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

That would be correct, but a_srs should be epsg:4326.

If you are unsure, you can load intermediate output files into QGIS, and 
compare with known datasources like Openstreetmap from the openlayers 
plugin, or Natural Earth shapefiles.

>
> 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")

Again, s_srs is wrong, it should be something longlat. Since there is no 
big difference between SIRGAS2000 and WGS84, you can leave out that 
step, and add SIRGAS directly in the first step.

HTH,
André Joost




More information about the Qgis-user mailing list