I've figured out how to do what I wanted using the netcdf-java library directly:
https://docs.unidata.ucar.edu/netcdf-java

Best wishes,

Andy
________________________________
From: Andy Turner <a.g.d.tur...@leeds.ac.uk>
Sent: 07 July 2021 18:11
To: geotools-gt2-users@lists.sourceforge.net 
<geotools-gt2-users@lists.sourceforge.net>
Subject: [Geotools-gt2-users] NetCDF multiband data reading

Hello,

I am processing multiband NetCDF data.

I can access values in the 1st band, but have not found a way to access values 
in other bands. I have tested with GeoTools 25.1 and 26-SNAPSHOT and used this 
documentation:
https://docs.geotools.org/stable/userguide/library/coverage/multidim.html#netcdf

I tried added the following to the Indexer XML file that gets written in the 
directory with the other files:

  <multipleBandsDimensions>
     <multipleBandsDimension>
       <name>data</name>
       <bandsNames>Band 1,Band 2</bandsNames>
     </multipleBandsDimension>
   </multipleBandsDimensions>

I've tried adding this in the section with the coverage and at levels outside 
and moving this file alongside the NetCDF file I am trying to read, but had no 
success so far...

There is a WARNING in the output:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.geotools.image.ImageWorker 
(file:/C:/Users/agdtu/.m2/repository/org/geotools/gt-coverage/26-SNAPSHOT/gt-coverage-26-SNAPSHOT.jar)
 to constructor com.sun.imageio.plugins.jpeg.JPEGImageWriterSpi()
WARNING: Please consider reporting this to the maintainers of 
org.geotools.image.ImageWorker
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
Jul 07, 2021 5:56:49 PM org.geotools.image.ImageWorker <clinit>

Does anyone have any advice?

Thanks,

Andy



_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to