1

I recently started working with Geoserver especially with Netcdf.

gdalinfo of the file gives following informations:

Driver: netCDF/Network Common Data Format
Files: 20211111133119222_BGIForestAgeMPIBGC1.0.0.nc
Size is 512, 512
Metadata:
  NC_GLOBAL#contact=Simon Besnard ([email protected]) or Nuno Carvalhais ([email protected])
  NC_GLOBAL#created_by=Simon Besnard
  NC_GLOBAL#creation_date=11-11-2021 11:29
  NC_GLOBAL#data_id=-9999
  NC_GLOBAL#frequency=static - circa 2010
  NC_GLOBAL#history=Output from original paper
  NC_GLOBAL#institute_id=MPI-BGC
  NC_GLOBAL#institution=Max-Planck-Institut fuer Biogeochemie
  NC_GLOBAL#references=Mapping global forest age from forest inventories, biomass and climate data, Simon Besnard, Sujan Koirala, Maurizio Santoro, Ulrich Weber, Jacob Nelson, Jonas Gütter, Bruno Herault, Justin Kassi, Anny N'Guessan, Christopher Neigh, Benjamin Poulter, Tao Zhang, Nuno Carvalhais, Earth System Science Data (ESSD), https://doi.org/10.5194/essd-13-4881-2021
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":ForestAge_TC000
  SUBDATASET_1_DESC=[21600x43200] ForestAge_TC000 (32-bit floating-point)
  SUBDATASET_2_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":ForestAge_TC010
  SUBDATASET_2_DESC=[21600x43200] ForestAge_TC010 (32-bit floating-point)
  SUBDATASET_3_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":ForestAge_TC020
  SUBDATASET_3_DESC=[21600x43200] ForestAge_TC020 (32-bit floating-point)
  SUBDATASET_4_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":ForestAge_TC030
  SUBDATASET_4_DESC=[21600x43200] ForestAge_TC030 (32-bit floating-point)
  SUBDATASET_5_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":TCloss_intensity
  SUBDATASET_5_DESC=[21600x43200] TCloss_intensity (32-bit floating-point)
  SUBDATASET_6_NAME=NETCDF:"20211111133119222_BGIForestAgeMPIBGC1.0.0.nc":LastTimeTCloss_std
  SUBDATASET_6_DESC=[21600x43200] LastTimeTCloss_std (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)

Following are the header information:

netcdf \20211111133119222_BGIForestAgeMPIBGC1.0.0 {
dimensions:
        latitude = 21600 ;
        longitude = 43200 ;
variables:
        float ForestAge_TC000(latitude, longitude) ;
                ForestAge_TC000:_FillValue = NaNf ;
                ForestAge_TC000:long_name = "Forest age estimates without tree cover correction" ;
                ForestAge_TC000:units = "years" ;
        double latitude(latitude) ;
                latitude:_FillValue = NaN ;
        double longitude(longitude) ;
                longitude:_FillValue = NaN ;
        float ForestAge_TC010(latitude, longitude) ;
                ForestAge_TC010:_FillValue = NaNf ;
                ForestAge_TC010:long_name = "Forest age estimates with a 10% tree cover correction" ;
                ForestAge_TC010:units = "years" ;
        float ForestAge_TC020(latitude, longitude) ;
                ForestAge_TC020:_FillValue = NaNf ;
                ForestAge_TC020:long_name = "Forest age estimates with a 20% tree cover correction" ;
                ForestAge_TC020:units = "years" ;
        float ForestAge_TC030(latitude, longitude) ;
                ForestAge_TC030:_FillValue = NaNf ;
                ForestAge_TC030:long_name = "Forest age estimates with a 30% tree cover correction" ;
                ForestAge_TC030:units = "years" ;
        float TCloss_intensity(latitude, longitude) ;
                TCloss_intensity:_FillValue = NaNf ;
                TCloss_intensity:long_name = "Tree cover loss intensity within 1km pixel size" ;
                TCloss_intensity:units = "admimensional" ;
        float LastTimeTCloss_std(latitude, longitude) ;
                LastTimeTCloss_std:_FillValue = NaNf ;
                LastTimeTCloss_std:long_name = "Standard deviation of the last time tree cover loss occurred within 1km" ;
                LastTimeTCloss_std:units = "years" ;

// global attributes:
                :institution = "Max-Planck-Institut fuer Biogeochemie" ;
                :institute_id = "MPI-BGC" ;
                :data_id = "-9999" ;
                :created_by = "Simon Besnard" ;
                :contact = "Simon Besnard ([email protected]) or Nuno Carvalhais ([email protected])" ;
                :history = "Output from original paper" ;
                string :references = "Mapping global forest age from forest inventories, biomass and climate data, Simon Besnard, Sujan Koirala, Maurizio Santoro, Ulrich Weber, Jacob Nelson, Jonas Gütter, Bruno Herault, Justin Kassi, Anny N\'Guessan, Christopher Neigh, Benjamin Poulter, Tao Zhang, Nuno Carvalhais, Earth System Science Data (ESSD), https://doi.org/10.5194/essd-13-4881-2021" ;
                :frequency = "static - circa 2010" ;
                :creation_date = "11-11-2021 11:29" ;
}

The netcdf file to of 1.5 GB. I managed to add it to geoserver. I am currently previewing the map using OpenLayers. The wms server serving image for this dataset is too slow. It usually takes 20 seconds to load one image. I tried configuring embedded GeoWebCache but did not succeed.

I assume I am into wrong path. What would be the best way to make it faster?

1 Answer 1

2

NetCDF is not well suited to such large images, as it does not have overviews (reduced resolution versions of the image). It works fine for small grids with a deep time variable, but poorly for images with large height/widths.

Best way to make it faster is to extract each variable into its own separate GeoTIFF file, maybe using GDAL's gdal_translate and the COG output format, which will create the overviews for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.