[gdal-dev] I fail to load NetCDF data by ogr2ogr

Thiemo Kellner thiemo at gelassene-pferde.biz
Tue Jun 23 22:59:50 PDT 2020


Hi

(me again) Now that I have been able to load Swedish climate data into  
my database I wanted to load Norwegian to another.

I have the data from
https://thredds.met.no/thredds/catalog/senorge/seNorge2/archive/TEMP1m/catalog.html?dataset=senorge/seNorge2/archive/TEMP1m/seNorge_v2_0_TEMP1m_grid_1957_2015.nc
and
https://thredds.met.no/thredds/catalog/senorge/seNorge2/archive/PREC1m/catalog.html?dataset=senorge/seNorge2/archive/PREC1m/seNorge_v2_0_PREC1m_grid_1957_2015.nc

So I issue

thiemo @ thiemos-toshi /mnt/norwegen % ls se*
seNorge_v2_0_PREC1m_grid_1957_2015.nc  seNorge_v2_0_TEMP1m_grid_1957_2015.nc
thiemo @ thiemos-toshi /mnt/norwegen % raster2pgsql -G | grep -i netcdf
   GMT NetCDF Grid Format
thiemo @ thiemos-toshi /mnt/norwegen % ogr2ogr -f "PostgreSQL"  
-overwrite -progress --config PG_USE_COPY YES  
PG:"host='/var/run/postgresql' port='6543' dbname='norge_nc'  
user='norge'" seNorge_v2_0_PREC1m_grid_1957_2015.nc
Warning 1: The dataset has several variables that could be identified  
as vector fields, but not all share the same primary dimension.  
Consequently they will be ignored.
FAILURE:
Unable to open datasource `seNorge_v2_0_PREC1m_grid_1957_2015.nc' with  
the following drivers.
   -> `PCIDSK'
   -> `netCDF'
...

But ogrinfo appears to be able to handle the file

thiemo @ thiemos-toshi /mnt/norwegen :-( % ogrinfo  
seNorge_v2_0_PREC1m_grid_1957_2015.nc
Warning 1: The dataset has several variables that could be identified  
as vector fields, but not all share the same primary dimension.  
Consequently they will be ignored.
Warning 1: The dataset has several variables that could be identified  
as vector fields, but not all share the same primary dimension.  
Consequently they will be ignored.
INFO: Open of `seNorge_v2_0_PREC1m_grid_1957_2015.nc'
       using driver `netCDF' successful.
Metadata:
   NC_GLOBAL#Conventions=CF-1.4
   NC_GLOBAL#history=Fri Sep 30 20:03:58 2016: ncra -O -y ttl  
/lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151101_20151101.nc  
/lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/2015...ge2/PREC1m/gridded_dataset/2015/seNorge_v2_0_PREC1m_grid_201511_tmp.nc
   NC_GLOBAL#institution=Norwegian Meteorological Institute, met.no
   NC_GLOBAL#nco_openmp_thread_number=1
   NC_GLOBAL#References=
   NC_GLOBAL#source=daily precipitation from station data

even though there are some warnings. GDAL gives

thiemo @ thiemos-toshi /mnt/norwegen % gdalinfo  
seNorge_v2_0_PREC1m_grid_1957_2015.nc

Driver: netCDF/Network Common Data Format
Files: seNorge_v2_0_PREC1m_grid_1957_2015.nc
Size is 1195, 1550
Coordinate System is:
PROJCRS["unnamed",
     BASEGEOGCRS["unknown",
         DATUM["unnamed",
             ELLIPSOID["Spheroid",6378137,298.257222101,
                 LENGTHUNIT["metre",1,
                     ID["EPSG",9001]]]],
         PRIMEM["Greenwich",0,
             ANGLEUNIT["degree",0.0174532925199433,
                 ID["EPSG",9122]]]],
     CONVERSION["unnamed",
         METHOD["Transverse Mercator",
             ID["EPSG",9807]],
         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["Scale factor at natural origin",1,
             SCALEUNIT["unity",1],
             ID["EPSG",8805]],
         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",east,
             ORDER[1],
             LENGTHUNIT["metre",1,
                 ID["EPSG",9001]]],
         AXIS["northing",north,
             ORDER[2],
             LENGTHUNIT["metre",1,
                 ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
Origin = (-75000.000000000000000,8000000.000000000000000)
Pixel Size = (1000.000000000000000,-1000.000000000000000)
Metadata:
   dummy#units=
   NC_GLOBAL#Conventions=CF-1.4
   NC_GLOBAL#history=Fri Sep 30 20:03:58 2016: ncra -O -y ttl  
/lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151101_20151101.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151102_20151102.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151103_20151103.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151104_20151104.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151105_20151105.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151106_20151106.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151107_20151107.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151108_20151108.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151109_20151109.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151110_20151110.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151111_20151111.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151112_20151112.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151113_20151113.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151114_20151114.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151115_20151115.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151116_20151116.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151117_20151117.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151118_20151118.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151119_20151119.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151120_20151120.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151121_20151121.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151122_20151122.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151123_20151123.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151124_20151124.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151125_20151125.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151126_20151126.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151127_20151127.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151128_20151128.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151129_20151129.nc /lustre/storeB/project/metkl/senorge2/seNorge2/PREC1d/gridded_dataset/201511/seNorge_v2_0_PREC1d_grid_20151130_20151130.nc  
/lustre/storeB/project/metkl/senorge2/seNorge2/PREC1m/gridded_dataset/2015/seNorge_v2_0_PREC1m_grid_201511_tmp.nc
   NC_GLOBAL#institution=Norwegian Meteorological Institute, met.no
   NC_GLOBAL#nco_openmp_thread_number=1
   NC_GLOBAL#References=
   NC_GLOBAL#source=daily precipitation from station data
   NETCDF_DIM_EXTRA={time}
   NETCDF_DIM_time_DEF={708,6}
    
NETCDF_DIM_time_VALUES={20834,20863.5,20893,20923.5,20954,20984.5,21015,21046,21076.5,21107,21137.5,21168,21199,21228.5,21258,21288.5,21319,21349.5,21380,21411,21441.5,21472,21502.5,21533,21564,21593.5,21623,21653.5,21684,21714.5,21745,21776,21806.5,21837,21867.5,21898,21929,21959,21989,22019.5,22050,22080.5,22111,22142,22172.5,22203,22233.5,22264,22295,22324.5,22354,22384.5,22415,22445.5,22476,22507,22537.5,22568,22598.5,22629,22660,22689.5,22719,22749.5,22780,22810.5,22841,22872,22902.5,22933,22963.5,22994,23025,23054.5,23084,23114.5,23145,23175.5,23206,23237,23267.5,23298,23328.5,23359,23390,23420,23450,23480.5,23511,23541.5,23572,23603,23633.5,23664,23694.5,23725,23756,23785.5,23815,23845.5,23876,23906.5,23937,23968,23998.5,24029,24059.5,24090,24121,24150.5,24180,24210.5,24241,24271.5,24302,24333,24363.5,24394,24424.5,24455,24486,24515.5,24545,24575.5,24606,24636.5,24667,24698,24728.5,24759,24789.5,24820,24851,24881,24911,24941.5,24972,25002.5,25033,25064,25094.5,25125,25155.5,25
186,25217,25246.5,25276,25306.5,25337,25367.5,25398,25429,25459.5,25490,25520.5,25551,25582,25611.5,25641,25671.5,25702,25732.5,25763,25794,25824.5,25855,25885.5,25916,25947,25976.5,26006,26036.5,26067,26097.5,26128,26159,26189.5,26220,26250.5,26281,26312,26342,26372,26402.5,26433,26463.5,26494,26525,26555.5,26586,26616.5,26647,26678,26707.5,26737,26767.5,26798,26828.5,26859,26890,26920.5,26951,26981.5,27012,27043,27072.5,27102,27132.5,27163,27193.5,27224,27255,27285.5,27316,27346.5,27377,27408,27437.5,27467,27497.5,27528,27558.5,27589,27620,27650.5,27681,27711.5,27742,27773,27803,27833,27863.5,27894,27924.5,27955,27986,28016.5,28047,28077.5,28108,28139,28168.5,28198,28228.5,28259,28289.5,28320,28351,28381.5,28412,28442.5,28473,28504,28533.5,28563,28593.5,28624,28654.5,28685,28716,28746.5,28777,28807.5,28838,28869,28898.5,28928,28958.5,28989,29019.5,29050,29081,29111.5,29142,29172.5,29203,29234,29264,29294,29324.5,29355,29385.5,29416,29447,29477.5,29508,29538.5,29569,29600,29629.5,29
659,29689.5,29720,29750.5,29781,29812,29842.5,29873,29903.5,29934,29965,29994.5,30024,30054.5,30085,30115.5,30146,30177,30207.5,30238,30268.5,30299,30330,30359.5,30389,30419.5,30450,30480.5,30511,30542,30572.5,30603,30633.5,30664,30695,30725,30755,30785.5,30816,30846.5,30877,30908,30938.5,30969,30999.5,31030,31061,31090.5,31120,31150.5,31181,31211.5,31242,31273,31303.5,31334,31364.5,31395,31426,31455.5,31485,31515.5,31546,31576.5,31607,31638,31668.5,31699,31729.5,31760,31791,31820.5,31850,31880.5,31911,31941.5,31972,32003,32033.5,32064,32094.5,32125,32156,32186,32216,32246.5,32277,32307.5,32338,32369,32399.5,32430,32460.5,32491,32522,32551.5,32581,32611.5,32642,32672.5,32703,32734,32764.5,32795,32825.5,32856,32887,32916.5,32946,32976.5,33007,33037.5,33068,33099,33129.5,33160,33190.5,33221,33252,33281.5,33311,33341.5,33372,33402.5,33433,33464,33494.5,33525,33555.5,33586,33617,33647,33677,33707.5,33738,33768.5,33799,33830,33860.5,33891,33921.5,33952,33983,34012.5,34042,34072.5,34103,34
133.5,34164,34195,34225.5,34256,34286.5,34317,34348,34377.5,34407,34437.5,34468,34498.5,34529,34560,34590.5,34621,34651.5,34682,34713,34742.5,34772,34802.5,34833,34863.5,34894,34925,34955.5,34986,35016.5,35047,35078,35108,35138,35168.5,35199,35229.5,35260,35291,35321.5,35352,35382.5,35413,35444,35473.5,35503,35533.5,35564,35594.5,35625,35656,35686.5,35717,35747.5,35778,35809,35838.5,35868,35898.5,35929,35959.5,35990,36021,36051.5,36082,36112.5,36143,36174,36203.5,36233,36263.5,36294,36324.5,36355,36386,36416.5,36447,36477.5,36508,36539,36569,36599,36629.5,36660,36690.5,36721,36752,36782.5,36813,36843.5,36874,36905,36934.5,36964,36994.5,37025,37055.5,37086,37117,37147.5,37178,37208.5,37239,37270,37299.5,37329,37359.5,37390,37420.5,37451,37482,37512.5,37543,37573.5,37604,37635,37664.5,37694,37724.5,37755,37785.5,37816,37847,37877.5,37908,37938.5,37969,38000,38030,38060,38090.5,38121,38151.5,38182,38213,38243.5,38274,38304.5,38335,38366,38395.5,38425,38455.5,38486,38516.5,38547,38578,38
608.5,38639,38669.5,38700,38731,38760.5,38790,38820.5,38851,38881.5,38912,38943,38973.5,39004,39034.5,39065,39096,39125.5,39155,39185.5,39216,39246.5,39277,39308,39338.5,39369,39399.5,39430,39461,39491,39521,39551.5,39582,39612.5,39643,39674,39704.5,39735,39765.5,39796,39827,39856.5,39886,39916.5,39947,39977.5,40008,40039,40069.5,40100,40130.5,40161,40192,40221.5,40251,40281.5,40312,40342.5,40373,40404,40434.5,40465,40495.5,40526,40557,40586.5,40616,40646.5,40677,40707.5,40738,40769,40799.5,40830,40860.5,40891,40922,40952,40982,41012.5,41043,41073.5,41104,41135,41165.5,41196,41226.5,41257,41288,41317.5,41347,41377.5,41408,41438.5,41469,41500,41530.5,41561,41591.5,41622,41653,41682.5,41712,41742.5,41773,41803.5,41834,41865,41895.5,41926,41956.5,41987,42018,42047.5,42077,42107.5,42138,42168.5,42199,42230,42260.5,42291,42321.5,42352}
   precipitation_amount#cell_methods=time: sum
   precipitation_amount#grid_mapping=UTM_Zone_33
   precipitation_amount#long_name=daily precipitation sum
   precipitation_amount#missing_value=-999.98999
   precipitation_amount#prod_date=2015-11-25
   precipitation_amount#units=millimeter
   precipitation_amount#version=1.0
   precipitation_amount#_FillValue=-999.98999
   time#axis=T
   time#calendar=standard
   time#cell_methods=time: mean
   time#long_name=time
   time#units=days since 1900-01-01 00:00:00
   UTM_Zone_33#grid_mapping_name=transverse_mercator
   UTM_Zone_33#inverse_flattening=298.257222101
   UTM_Zone_33#missing_value=-1
   UTM_Zone_33#proj4=+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs  
+ellps=WGS84 +towgs84=0,0,0
   UTM_Zone_33#semi_major_axis=6378137
   UTM_Zone_33#units=
   UTM_Zone_33#utm_zone_number=33
   UTM_Zone_33#_CoordinateAxisType=GeoX GeoY
   UTM_Zone_33#_CoordinateTransformType=Projection
   X#long_name=x coordinate of projection
   X#standard_name=projection_x_coordinate
   X#units=meters
   Y#long_name=y coordinate of projection
   Y#standard_name=projection_y_coordinate
   Y#units=meters
Corner Coordinates:
Upper Left  (  -75000.000, 8000000.000) (  2d10'51.26"W, 72d 3'30.10"N)
Lower Left  (  -75000.000, 6450000.000) (  1d16'26.85"W, 58d 9'42.08"N)
Upper Right ( 1120000.000, 8000000.000) ( 29d45' 6.80"E, 69d33'30.01"N)
Lower Right ( 1120000.000, 6450000.000) ( 18d27'37.56"E, 56d47'36.47"N)
Center      (  522500.000, 7225000.000) ( 11d 0' 6.39"E, 64d42'50.33"N)
Band 1 Block=1195x1550 Type=Float32, ColorInterp=Undefined
   NoData Value=-999.989990234375
   Unit Type: millimeter
   Metadata:
     cell_methods=time: sum
     grid_mapping=UTM_Zone_33
     long_name=daily precipitation sum
     missing_value=-999.98999
     NETCDF_DIM_time=20834
     NETCDF_VARNAME=precipitation_amount
     prod_date=2015-11-25
     units=millimeter
...
Band 708 Block=1195x1550 Type=Float32, ColorInterp=Undefined
   NoData Value=-999.989990234375
   Unit Type: millimeter
   Metadata:
     cell_methods=time: sum
     grid_mapping=UTM_Zone_33
     long_name=daily precipitation sum
     missing_value=-999.98999
     NETCDF_DIM_time=42352
     NETCDF_VARNAME=precipitation_amount
     prod_date=2015-11-25
     units=millimeter
     version=1.0
     _FillValue=-999.98999


I doublechecked that my dashes are dashes, but cannot figure as to why  
ogr2ogr fails.

If I wanted to write each band into a separate table/layer, I need to  
get the name of it but I do not know where to find it.

I would appreciate if you shared your thoughts.

Kind regards

Thiemo

-- 
S/MIME Public Key: https://oc.gelassene-pferde.biz/index.php/s/eJuAUFONag6ofnH
Signal (Safer than WhatsApp): +49 1578 7723737
Handys: +41 78 947 36 21 | +49 1578 772 37 37
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4001 bytes
Desc: S/MIME Signature
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200624/d664c972/attachment-0001.bin>


More information about the gdal-dev mailing list