[gdal-dev] unable to read geotransfmrm and projection information from a netcdf file (stereo graphic polar projection)

Even Rouault even.rouault at spatialys.com
Wed Oct 22 01:19:46 PDT 2014


Le mercredi 22 octobre 2014 09:02:25, epi a écrit :
> Hi,
> 
> I’m tring to read a netcdf file into OSSIM, but unfortunately my file
> doesn’t have proper georeferenced metadata, the results of ncdump shows
> the following info :
> 
> 
> 	int grid_mapping ;
> 		grid_mapping:grid_mapping_name = "polar_stereographic" ;
> 		grid_mapping:long_name = "grid mapping" ;
> 		grid_mapping:scale_factor_at_projection_origin = 0.933012701892219 ;
> 		grid_mapping:straight_vertical_longitude_from_pole = 58. ;
> 		grid_mapping:standard_parallel = 60. ;
> 		grid_mapping:latitude_of_projection_origin = 90. ;
> 		grid_mapping:false_easting = 2548000. ;
> 		grid_mapping:false_northing = 3988000. ;
> 		grid_mapping:semi_major_axis = 6371000. ;
> 		grid_mapping:semi_minor_axis = 6371000. ;
> 		grid_mapping:earth_radius = 6371000. ;
> 		grid_mapping:ellipsoid = "sphere" ;
> 		grid_mapping:dx = 4000. ;
> 		grid_mapping:proj4string = "+proj=stere +R=6371000.0 +a=6371000
> +b=6371000 +lat_0=90 +lat_ts=60 +lon_0=58 +x_0=3988000 +y_0=2548000" ;
> 
> 
> Can you help me in creating a proper geotiff file from this netcdf file ?
> I tried goal_transform without success on it
> 
> attached at this link [ 1 ] there is the original netcdf
> 
> [ 1 ]  http://epinux.com/shared/Mean_2009_2011.nc
> <http://epinux.com/shared/Mean_2009_2011.nc>

epifanio,

That netcdf file uses a GEOLOCATION array mechanism that requires some 
processing.

I managed to get a rectified geotiff with gdalwarp:

gdalwarp -t_srs "+proj=stere +R=6371000.0 +a=6371000 +b=6371000 +lat_0=90 
+lat_ts=60 +lon_0=58 +x_0=3988000 +y_0=2548000"  
NETCDF:"Mean_2009_2011.nc":temperature temperature.tif -overwrite -srcnodata 
-9725.85 -dstnodata -9725.85

and similarly for other variables in the netCDF.

I've determined that the nodata value was -9725.85 by looking at the 
statistics reported by :

gdalinfo NETCDF:"Mean_2009_2011.nc":temperature -stats

I *think* (but haven't verified) that in that instance the geolocation must be 
a regular grid once projected from long/lat to polar stereographic, so 
probably the netCDF driver could be enhanced to expose a regular geotransform 
that could save the gdalwarp step.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list