Christiane, replying to keep this thread alive and ensure that your text below goes to the list. Thank you for the sample file; I think your email was held by the list server because of the large attachment (I like to send links).
Kind regards, Ben. On 14/11/16 15:14, c...@habmalnefrage.de wrote: > Hi Ben / Daniele, > thanks for your answers. > My version of GeoTools is 17-snapshot. The problem with the wrong coordinates > still exists. Attached you'll find a sample file with longitude values from > 335 > to 405 degrees. Panoply is able to read it correctly, so I don't think it's an > exceptional file. > I took a look at the parameters parsing code > https://github.com/geotools/geotools/blob/master/modules/plugin/coverage-multidim/netcdf/src/main/java/org/geotools/coverage/io/netcdf/NetCDFReader.java#L525 > If I understand aright: the GeneralParameterValue, e.g. in "public > GridCoverage2D read(GeneralParameterValue[] parameters)" can be of > READ_GRIDGEOMETRY2D, TIME, ELEVATION,...? It seems to me, these are only the > dimensions and that there is no possibility to get the attributes like units > etc. of each variable in file? Do the "hints" (used in constructor of > NetCDFReader) have anything to do with it and what kind of values can "hints" > be of? > kind regards, > Christiane > *Gesendet:* Donnerstag, 10. November 2016 um 18:01 Uhr > *Von:* "Daniele Romagnoli" <daniele.romagn...@geo-solutions.it> > *An:* "Ben Caradoc-Davies" <b...@transient.nz> > *Cc:* c...@habmalnefrage.de, "geotools mailing list" > <geotools-gt2-users@lists.sourceforge.net> > *Betreff:* Re: [Geotools-gt2-users] Retrieving attributes and longitude values > with central meridian at 360 degrees from NETCDF > Hi Christiane, > On Wed, Nov 9, 2016 at 10:19 PM, Ben Caradoc-Davies <b...@transient.nz > <mailto:b...@transient.nz>> wrote: > > On 03/11/16 11:18, c...@habmalnefrage.de <mailto:c...@habmalnefrage.de> > wrote: > > Hi list, > I've worked through the NetCDFReaderTest and lots of other files > lately > but I'm > still struggling with the NetCDF reader: > 1.) I've managed to read the coverages from the files and the > corresponding > points as simple features using the RasterAsPointCollectionProcess. > But I > couldn't figure out how to retrieve the attributes of a coverage (e.g. > long_name, units, _FillValue etc.)? Using the test files (e.g. > "O3-NO2.nc", > "wind.nc <http://wind.nc>") I tried feature.getProperties(), > feature.getAttributes() - both > provide only geometry and value - and coverage.getProperties() which > is > empty... > Is there a way? > > > The coverage API is an abstraction over the raw NetCDF layer. I do not > know > if these internal implementation details are accessible. Perhaps Daniele > can > confirm? > > As far as I remember, the underlying attributes aren't exposed as properties > of > the coverage. > > 2.) I have files containing longitude values from 335° to 404° (with > CENTRAL_MERIDIAN at 360°) instead of -25° to 44° (in WGS84). There is > no > coordinate system information in the files. The NetCDF reader seams to > convert > all values greater than 360° but leaves the others unchanged. Hence, > the > resulting coverage has values from 44° to 335° which certainly isn't > correct. > Maybe I have to use the NetCDFProjection class but I couldn't find an > example > how to use it. What's the way to get the proper values? > > > I do not think you should have to use a NetCDFProjection. What version of > GeoTools are you using? There were some recent changes in the NetCDF-Java > library affecting longitude handling but I think only in GRIB2 files. > Excessive or inconsistent tampering with longitudes might be a bug in > GeoTools. Do you have a sample file that you can share? > > 3.) How do I know all the values which I can or I have to use for > GeneralParameterValue (despite the ones used in the test units)? > Thank you in advance. > Christiane > > > Good question. Daniele? > > Do you mean the parameters supported by the reader? > The supported (and exposed parameters) are listed by the related format class > as . > https://github.com/geotools/geotools/blob/master/modules/plugin/coverage-multidim/netcdf/src/main/java/org/geotools/coverage/io/netcdf/NetCDFFormat.java#L67 > To double check, you may also take a look to the parameters parsing code: > https://github.com/geotools/geotools/blob/master/modules/plugin/coverage-multidim/netcdf/src/main/java/org/geotools/coverage/io/netcdf/NetCDFReader.java#L525 > Does it helps? > Cheers, > Daniele > > > Kind regards, > > -- > Ben Caradoc-Davies <b...@transient.nz <mailto:b...@transient.nz>> > Director > Transient Software Limited <http://transient.nz/> > New Zealand > > -- > == > GeoServer Professional Services from the experts! Visit > http://goo.gl/it488V for more information. > == > > Ing. Daniele Romagnoli > Senior Software Engineer > > GeoSolutions S.A.S. > Via di Montramito 3/A > 55054 Massarosa (LU) > Italy > phone: +39 0584 962313 > fax: +39 0584 1660272 > > http://www.geo-solutions.it > http://twitter.com/geosolutions_it > > ------------------------------------------------------- > > *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003* > > Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i > file/s allegato/i sono da considerarsi strettamente riservate. Il loro > utilizzo > è consentito esclusivamente al destinatario del messaggio, per le finalità > indicate nel messaggio stesso. Qualora riceviate questo messaggio senza > esserne > il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di > procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro > sistema. Conservare il messaggio stesso, divulgarlo anche in parte, > distribuirlo > ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce > comportamento contrario ai principi dettati dal D.Lgs. 196/2003. > > The information in this message and/or attachments, is intended solely for the > attention and use of the named addressee(s) and may be confidential or > proprietary in nature or covered by the provisions of privacy act (Legislative > Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not > in > accord with its purpose, any disclosure, reproduction, copying, distribution, > or > either dissemination, either whole or partial, is strictly forbidden except > previous formal approval of the named addressee(s). If you are not the > intended > recipient, please contact immediately the sender by telephone, fax or e-mail > and > delete the information in this message that has been received in error. The > sender does not give any warranty or accept liability as the content, accuracy > or completeness of sent messages and accepts no responsibility for changes > made > after they were sent or for other risks which arise as a result of e-mail > transmission, viruses, etc. > -- Ben Caradoc-Davies <b...@transient.nz> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users