2

I am working with GPM(Global Precipitation Measurement) satellite data which are in .netcdf format. When I open the data in qgis it is in a different projection and I can not overlap the shape for the region I am trying to analyze. How can I solve this?

The link to download the data is: https://disc.gsfc.nasa.gov/datasets?keywords=GPM%20DPR&page=1 Product:'GPM DPR Precipitation Profile 1 Day 0.25 degree x 0.25 degree V05 (GPM_3DPRD.05)' In the metadata: lat.resolution = 0.25 lon.resolution = 0.25 NorthBoundingCoordinate = 67 SouthBoundingCoordinate =-67 EastBoundingCoordinate = 180 WestBoundingCoordinate=-180

The option that I selected was 'precipRateNearSurfaceMean'.

CRS-GPM_3DPRD.05 file: Undefined; CRS-Shapefile: SIRGAS 2000, EPSG:4674

  • It would help if you add a link to the data, the CRS of the data, the CRS that QGIS assignes to it, and the CRS of the shapefile. You might try to add an Openstreetmap basemap with the QMS plugin and see if that aligns. – AndreJ Oct 10 '18 at 15:14
  • Ok AndreJ. I put up with the question. – Bruno Rodrigues Oct 10 '18 at 16:12
  • Unfortunately, I can't get it to display in QGIS. Maybe the netcdf structure is too complicated. – AndreJ Oct 11 '18 at 12:13
  • It is true! I found some similar issues here like this topic that was answered by you: (https://gis.stackexchange.com/questions/213083/unable-to-project-gpm-precipitation-data-correctly-in-qgis?rq=1) , but I could not solve... – Bruno Rodrigues Oct 11 '18 at 12:20
  • Selecting a single dataset on the website gives me a file that displays fine in Panoply, but flipped vertically in QGIS. I'm not sure how to handle that without programming. – AndreJ Oct 11 '18 at 16:14
  • Yes that's right! – Bruno Rodrigues Oct 11 '18 at 16:34

1 Answers1

2

There seems to be a bug in the data. Ncdump reads:

netcdf \3a-day {
dimensions:
    AD = 2 ;
    chn = 2 ;
    nlon = 1440 ;
    nlat = 536 ;

and Panolpy plots it correctly, while exporting to tif with GDAL returns a 536x1440 raster with coordinates flipped. So you can use this workaround:

gdal_translate -of VRT -gcp -67 180 180 -67 -gcp -67 -180 -180 -67 -gcp 67 180 180 67 -gcp 67 -180 -180 67  3a-day.nc tmp.vrt
gdalwarp -t_srs EPSG:4326 tmp.vrt warpout.tif
gdal_translate -a_ullr -180 67 180 -67 warpout.tif 3a-day.tif

Please check the result with a dataset that has an uneven placement of data around the world.

See also http://osgeo-org.1560.x6.nabble.com/gdal-dev-Netcdf-coordinates-swapped-td5381627.html for a reply from the GDAL dev's.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
  • Thanks AndreJ...Do I have to use all these commands in the gdal together? I will do this, if not solve the problem I will try in other software because as you spoke the file .nc in qgis is very complex. – Bruno Rodrigues Oct 15 '18 at 12:28
  • You can put all three commands in a batch file and run that. – AndreJ Oct 15 '18 at 14:04
  • I tried to do what you suggested but a message appears: FAILURE: Too many command options. Maybe it's some problem with my qgis software. – Bruno Rodrigues Oct 19 '18 at 12:19
  • The GDAL command line apps have nothing to do with the QGIS software. Most probably you have a typo in your bat file. – AndreJ Oct 19 '18 at 19:00
  • Ok, Andre. I meant at the time of the installation of the gdal – Bruno Rodrigues Oct 19 '18 at 20:00
  • I was able to solve the problem with something very similar to the one answered by AndreJ. Is the command to redesign the image was this (remembering that the path should be changed): gdal_translate -gcp 0 0 179.875 -66.875 -gcp 535 0 179.875 66.875 -gcp 0 1439 -179.875 -66.875 -gcp 535 1439 -179.875 66.875 -of GTiff -a_srs EPSG:4326 NETCDF:"/home/brunorodrigues/Documentos/fev_gpm_global/3A-DAY.GPM.DPR.V2-20170410.20180228-S000000-E235959.059.V05A.HDF5.nc":precipRateNearSurfMean /home/brunorodrigues/Documentos/precipRateNearSurfMean_28022018.tif – Bruno Rodrigues Oct 25 '18 at 14:40