[gdal-dev] Convert NetCDF to GeoTIFF WGS 84

Javier Garcia tirengarfio at gmail.com
Tue Feb 14 10:11:40 PST 2023


Hi,

I would like to convert the next NetCDF file to a GeoTIFF WGS 84.

NetCDF file `gdalinfo` output:

Driver: netCDF/Network Common Data Format
Files: /home/me/netcdf_file.nc
Size is 512, 512
Metadata:
  NC_GLOBAL#altimetry=altiCERSAT
  NC_GLOBAL#altitude_resolution=n/a
  NC_GLOBAL#area=Ireland 2 min wave grid
  NC_GLOBAL#BETAMAX=1.52
  NC_GLOBAL#CICE0=0.25
  NC_GLOBAL#CICEN=0.75
  NC_GLOBAL#comment=
  NC_GLOBAL#contact=waves at mycompany.com
  NC_GLOBAL#Conventions=CF-1.5
  NC_GLOBAL#creation_date=2017-07-27T12:20:30Z
  NC_GLOBAL#data_type=SWASH straight grid
  NC_GLOBAL#easternmost_longitude=-1.0333328
  NC_GLOBAL#easting=longitude
  NC_GLOBAL#field_type=hourly
  NC_GLOBAL#FLAGTR=4
  NC_GLOBAL#forcing_ice=iceCFSR
  NC_GLOBAL#forcing_wind=wndCFSR
  NC_GLOBAL#forecast_range=analysis
  NC_GLOBAL#forecast_type=hindcast
  NC_GLOBAL#grid=irluk-2m
  NC_GLOBAL#grid_projection=n/a
  NC_GLOBAL#history=2017-07-27T12:20:30Z : Creation
  NC_GLOBAL#institution=My Company
  NC_GLOBAL#institution_references=http://www.mycompany.com/
  NC_GLOBAL#latitude_resolution=   0.0333333
  NC_GLOBAL#longitude_resolution=   0.0333333
  NC_GLOBAL#maximum_altitude=9000 m
  NC_GLOBAL#minimum_altitude=-12000 m
  NC_GLOBAL#netcdf_version=netCDF 4.3.0
  NC_GLOBAL#northernmost_latitude=59.5000000
  NC_GLOBAL#northing=latitude
  NC_GLOBAL#product_name=ww3.irluk-2m.199501_hs.nc
  NC_GLOBAL#product_version=1.0
  NC_GLOBAL#REFCOAST=0.05
  NC_GLOBAL#references=http://www.mycompany.com/waves/
  NC_GLOBAL#REFICEBERG=0.3
  NC_GLOBAL#REFSUBGRID=0.05
  NC_GLOBAL#run_time=2017-07-27T12:20:30Z
  NC_GLOBAL#SDS4 namelist parameter WHITECAPWIDTH=0.30000001
  NC_GLOBAL#source=TWM WAVEWATCH III (R) v4.18
  NC_GLOBAL#southernmost_latitude=49.5000000
  NC_GLOBAL#start_date=1995-01-01T00:00:00Z
  NC_GLOBAL#stop_date=1995-01-31T23:00:00Z
  NC_GLOBAL#title=TWM SWASH HINDCAST
  NC_GLOBAL#WAVEWATCH_III_switches=F90 NOGRB NOPA LRB4 SHRD PR3 UQ FLX0 LN1
ST4 STAB0 NL1 BT4 DB1 MLIM TR0 BS0 IC0 REF1 XX0 WNT1 WNX1 CRT1 CRX1 O0 O1
O2 O3 O4 O5 O6 O7 011 NC4 TRKNC IS0
  NC_GLOBAL#WAVEWATCH_III_version_number=4.18b
  NC_GLOBAL#westernmost_longitude=-12.0000000
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"/home/me/netcdf_file.nc":MAPSTA
  SUBDATASET_1_DESC=[301x330] status map (16-bit integer)
  SUBDATASET_2_NAME=NETCDF:"/home/me/netcdf_file.nc":hs
  SUBDATASET_2_DESC=[744x301x330] sea_surface_wave_significant_height
(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)


I'm expecting as output a file with WGS 84 projection like this:

`gdalinfo` output:


Driver: GTiff/GeoTIFF
Files: tiff_file.tif
Size is 4000, 4000
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["Popular Visualisation Pseudo-Mercator",
        METHOD["Popular Visualisation Pseudo Mercator",
            ID["EPSG",1024]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["False easting",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["unknown"],
        AREA["World - 85°S to 85°N"],
        BBOX[-85.06,-180,85.06,180]],
    ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (-1160000.000000000000000,7799999.999999998137355)
Pixel Size = (300.000000000000000,-300.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-1160000.000, 7800000.000) ( 10d25'13.65"W, 57d11'40.60"N)
Lower Left  (-1160000.000, 6600000.000) ( 10d25'13.65"W, 50d52'46.07"N)
Upper Right (   40000.000, 7800000.000) (  0d21'33.57"E, 57d11'40.60"N)
Lower Right (   40000.000, 6600000.000) (  0d21'33.57"E, 50d52'46.07"N)
Center      ( -560000.000, 7200000.000) (  5d 1'50.04"W, 54d 9'26.21"N)
Band 1 Block=4000x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=4000x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=4000x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=4000x1 Type=Byte, ColorInterp=Alpha


Any help will be appreciated.

Javier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230214/ecc90301/attachment-0001.htm>


More information about the gdal-dev mailing list