Geographic Information Systems Asked by Saša Vranić on November 9, 2021
I have a problem with adding a new NetCDF store. I use NetCDF plugin for GeoServer. The error is displayed below:
Message text is like (same problem on a different system):
Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:coverages/Nstor/nstor-cf.nc and hints Hints: EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@6d656d0c[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] REPOSITORY = org.geoserver.catalog.CatalogRepository@2db8b90e System defaults: COMPARISON_TOLERANCE = 1.0E-8 GRID_COVERAGE_FACTORY = GridCoverageFactory TILE_ENCODING = null FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@54728f47 LENIENT_DATUM_SHIFT = true FORCE_LONGITUDE_FIRST_AXIS_ORDER = true STYLE_FACTORY = StyleFactoryImpl FILTER_FACTORY = FilterFactoryImpl FORCE_AXIS_ORDER_HONORING = http
From the error I can conclude that there is a problem with coordinate system or coordinate order. But at the same time I can open the same file in QGIS. QGIS reads coordinate system correctly (see figure below):
I don’t have enough experience to inspect NetCDF file structure in detail with Python and cannot provide more details about the file structure.
Could someone explain how to correct this error?
GeoServer log:
2020-05-08 10:13:46,461 WARN [io.netcdf] - Unable to connect
org.geotools.data.DataSourceException: Unable to connect
at org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:161)
at org.geotools.coverage.io.netcdf.NetCDFFormat.getReader(NetCDFFormat.java:94)
at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1556)
at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1502)
at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Caused by: org.geotools.data.DataSourceException: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
at org.geotools.coverage.io.netcdf.NetCDFAccess.<init>(NetCDFAccess.java:139)
at org.geotools.coverage.io.netcdf.NetCDFDriver.connect(NetCDFDriver.java:92)
at org.geotools.coverage.io.impl.DefaultFileDriver.process(DefaultFileDriver.java:228)
at org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:158)
... 156 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
at org.geotools.imageio.netcdf.NetCDFImageReader.setInput(NetCDFImageReader.java:287)
at javax.imageio.ImageReader.setInput(ImageReader.java:380)
at org.geotools.coverage.io.netcdf.NetCDFAccess.<init>(NetCDFAccess.java:128)
... 159 more
Caused by: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'
at org.geotools.imageio.netcdf.cv.TimeCoordinateVariable.<init>(TimeCoordinateVariable.java:71)
at org.geotools.imageio.netcdf.cv.CoordinateVariable.create(CoordinateVariable.java:264)
at org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.initCoordinates(NetCDFGeoreferenceManager.java:616)
at org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.<init>(NetCDFGeoreferenceManager.java:575)
at org.geotools.imageio.netcdf.NetCDFImageReader.init(NetCDFImageReader.java:506)
at org.geotools.imageio.netcdf.NetCDFImageReader.setInput(NetCDFImageReader.java:285)
... 161 more
2020-05-08 10:13:46,471 INFO [geoserver.web] - Getting list of coverages for saved store file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc
java.lang.RuntimeException: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc and hints Hints:
EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4b14e299[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
REPOSITORY = org.geoserver.catalog.CatalogRepository@1f2746ae
System defaults:
FILTER_FACTORY = FilterFactoryImpl
FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@67ffd911
FORCE_LONGITUDE_FIRST_AXIS_ORDER = true
FORCE_AXIS_ORDER_HONORING = http
STYLE_FACTORY = StyleFactoryImpl
GRID_COVERAGE_FACTORY = GridCoverageFactory
TILE_ENCODING = null
LENIENT_DATUM_SHIFT = true
COMPARISON_TOLERANCE = 1.0E-8
at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:170)
at org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:47)
...
Caused by: java.io.IOException: Failed to create reader from file:workspaces/geoikp/climate_projections_HZG/hotdays_eur11_rcp85_p10_abschg_2036_2065_i.nc and hints Hints:
EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4b14e299[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
REPOSITORY = org.geoserver.catalog.CatalogRepository@1f2746ae
System defaults:
FILTER_FACTORY = FilterFactoryImpl
FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@67ffd911
FORCE_LONGITUDE_FIRST_AXIS_ORDER = true
FORCE_AXIS_ORDER_HONORING = http
STYLE_FACTORY = StyleFactoryImpl
GRID_COVERAGE_FACTORY = GridCoverageFactory
TILE_ENCODING = null
LENIENT_DATUM_SHIFT = true
COMPARISON_TOLERANCE = 1.0E-8
at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1558)
at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1502)
at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:127)
at com.sun.proxy.$Proxy28.getGridCoverageReader(Unknown Source)
at org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:86)
... 145 more
The file time unit cannot be parsed, the file is probably not CF compliant. See the error message:
"Caused by: java.lang.IllegalArgumentException: Couldn't determine time units from unit string 'day as %Y%m%d.%f'"
I'm guessing QGIS is ignoring the time, instead of trying to parse it.
Answered by Andrea Aime on November 9, 2021
The error message in the log makes this clear
Couldn't determine time units from unit string 'day as %Y%m%d.%f'
Your time units are in the wrong format. May be you can use some other tool to convert or fix your file.
Answered by Ian Turton on November 9, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP