FW: [gdal-dev] how to convert netCDF image

Gong, Shawn (Contractor) Shawn.Gong at drdc-rddc.gc.ca
Tue Jan 13 15:32:23 EST 2009


hi list,

I use gdal 1.6.0 to ingest netCDF images that are in lat/lon. But they are flipped upside down, and longitude is displayed as around +300E (should be -60E Cdn East shoreline)

I have followed the ticket #2654 and checked the last night's SVN but it was not updated.  So I made changes the netcdfdataset.cpp and netcdfdataset.h according to the patch.

My question is: where do I make another change so that 
if longitude>180 {
  longitude-=360
} ?

thanks,
Shawn

============================================================
gdalinfo owsofa.nc
Driver: netCDF/Network Common Data Format
Files: owsofa.nc
Size is 512, 512
Coordinate System is `'
Metadata:
  NC_GLOBAL#Title=OWS gridded fields
  NC_GLOBAL#Conventions=CF-1.3
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"owsofa.nc":SST
  SUBDATASET_1_DESC=[105x189] SST (32-bit floating-point)
  SUBDATASET_2_NAME=NETCDF:"owsofa.nc":SST1
  SUBDATASET_2_DESC=[105x189] SST1 (32-bit floating-point)
  SUBDATASET_3_NAME=NETCDF:"owsofa.nc":T150
  SUBDATASET_3_DESC=[105x189] T150 (32-bit floating-point)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)
gdalinfo NETCDF:"owsofa.nc":SST
Driver: netCDF/Network Common Data Format
Files: none associated
Size is 189, 105
Coordinate System is `'
Origin = (284.875000000000000,60.125000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)
Metadata:
  NC_GLOBAL#Title=OWS gridded fields
  NC_GLOBAL#Conventions=CF-1.3
  SST#units=degree_C
  SST#long_name=SST
  SST#start_time=2008-DEC-02 0936
  SST#end_time=2008-DEC-05 0936
  SST#grid_mapping=crs
  SST#_FillValue=1.000000e+35
  lon#units=degrees_east
  lon#long_name=longitude
  lon#standard_name=longitude
  lat#units=degrees_north
  lat#long_name=latitude
  lat#standard_name=latitude
  crs#grid_mapping_name=latitude_longitude
  crs#longitude_of_prime_meridian=0
  crs#semi_major_axis=6.37814e+06
  crs#inverse_flattening=298.257
Corner Coordinates:
Upper Left  (     284.875,      60.125)
Lower Left  (     284.875,      33.875)
Upper Right (     332.125,      60.125)
Lower Right (     332.125,      33.875)
Center      (     308.500,      47.000)
Band 1 Block=189x1 Type=Float32, ColorInterp=Undefined
  NoData Value=1.00000004091847876e+35
  Metadata:
    NETCDF_VARNAME=SST


More information about the gdal-dev mailing list