Package org.geotools.coverage.io.hdf4

Examples of org.geotools.coverage.io.hdf4.CRSUtilities


                fields = (LinkedHashMap<String, HDF4ProductFieldType>) fieldsMap.get(coverageName);

                String elementName = band.getName();
                if (!fields.containsKey(elementName)) {

                    Product product = HDF4ProductFieldType.getProduct(elementName);
                    Unit unit = Unit.ONE;
                    if (product != null) {
                        unit = product.getUoM();
                    } else {
                        String uOm = band.getUoM();
                        if(uOm == null)
                           unit = Unit.ONE.alternate(uOm);
                        else
                          try {
                            unit = Unit.valueOf(uOm);
                          } catch (IllegalArgumentException iae) {
                              try {
                                  unit = Unit.ONE.alternate(uOm);
                              } catch (IllegalArgumentException iae2) {
                                  if (LOGGER.isLoggable(Level.FINE)) {
                                      LOGGER.log(Level.FINE, "Unable to parse the provided unit " + uOm, iae2);
                                  }
                              } catch (UnsupportedOperationException uoe) {
                                  if (LOGGER.isLoggable(Level.FINE)) {
                                      LOGGER.log(Level.FINE,
                                              "Unable to parse the provided unit "
                                                      + uOm, uoe);
                                  }
                              }
                          }
                    }
                    final Name nameImpl = new NameImpl(coverageName.getLocalPart(), elementName);
                    final InternationalString description = new SimpleInternationalString(product!=null?product.getDescription():elementName);

                    // setting bands names.
                    final GridSampleDimension gridBand = Utilities.buildBands(band, elementName, unit);
                    final HDF4ProductFieldType fd = new HDF4ProductFieldType(nameImpl, description, gridBand);
                    fields.put(elementName, fd);
View Full Code Here

TOP

Related Classes of org.geotools.coverage.io.hdf4.CRSUtilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.