Hi,
On Wed, Nov 16, 2016 at 3:46 AM, Ben Caradoc-Davies <b...@transient.nz> wrote: > Christiane, > > it is worth noting that upstream the Unidata maintainers of NetCDF-Java > recently removed longitude normalisation for GRIB2 files, so at the least > the behaviour you report is inconsistent with that for GRIB2. > > Daniele, does gt-netcdf normalise longitudes or just follow the behaviour > of NetCDF-Java? > Checking the data with ToolsUI (4.6, based on NetCDF-Java) I see the longitude values are like this (I have applied a striding of 10 to avoid reporting all the values): NCDump Variable data: longitude(0:699:10) float longitude(longitude=700); :long_name = "longitudes"; :units = "degrees east"; data: {335.05, 336.05, 337.05, 338.05, 339.05, 340.05, 341.05, 342.05, 343.05, 344.05, 345.05, 346.05, 347.05, 348.05, 349.05, 350.05, 351.05, 352.05, 353.05, 354.05, 355.05, 356.05, 357.05, 358.05, 359.05, 0.049988165, 1.0499882, 2.0499883, 3.0499883, 4.0499883, 5.0499883, 6.0499883, 7.0499883, 8.049989, 9.049989, 10.049989, 11.049989, 12.049989, 13.049989, 14.049989, 15.049989, 16.049988, 17.049988, 18.049988, 19.049988, 20.049988, 21.049988, 22.049988, 23.049988, 24.049988, 25.049988, 26.049988, 27.049988, 28.049988, 29.049988, 30.049988, 31.049988, 32.049988, 33.049988, 34.049988, 35.049988, 36.049988, 37.049988, 38.049988, 39.049988, 40.049988, 41.049988, 42.049988, 43.049988, 44.049988} As you can see the coordinates go from 335.05 to 44.04988. The CoordSys tab of ToolsUI also reports Longitude axis type as a not regular axis. So I think the problem is in how the coordinates are reported back by NetCDF-Java. As far as I remember, in the past we dealt with coordinates in the range [180, 540] but they were increasing (monotone). These ones aren't monotone, instead. Wondering if the problem is due to that. I will double check. Cheers, Daniele > > Kind regards, > Ben. > > > On 16/11/16 10:54, Ben Caradoc-Davies wrote: > >> 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/plu >>> gin/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/plu >>> gin/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/plu >>> gin/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 > -- == 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.
------------------------------------------------------------------------------
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users