@Override public GridCoverage2D getGridCoverage() { try { // There is a serious standardization failure around the axis order of WGS84. See issue #1930. // GeoTools assumes strict EPSG axis order of (latitude, longitude) unless told otherwise. // Both NED and SRTM data use the longitude-first axis order, so OTP makes grid coverages // for unprojected DEMs assuming coordinates are in (longitude, latitude) order. Hints forceLongLat = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); GeoTiffFormat format = new GeoTiffFormat(); GeoTiffReader reader = format.getReader(path, forceLongLat); coverage = reader.read(null); LOG.info("Elevation model CRS is: {}", coverage.getCoordinateReferenceSystem2D()); } catch (IOException e) { throw new RuntimeException("Error getting coverage automatically. ", e); } return coverage; }
/** * If <CODE>source</CODE> is a file, this will return a reader object. This file does not use * hints in the construction of the geotiff reader. * * @param source must be a GeoTiff File * @return a GeoTiffReader object initialized to the specified File. */ @Override public GeoTiffReader getReader(Object source) { return getReader(source, null); }
/** * If <CODE>source</CODE> is a file, this will return a reader object. * This file does not use hints in the construction of the geotiff reader. * * @param source * must be a GeoTiff File * * @return a GeoTiffReader object initialized to the specified File. */ @Override public GeoTiffReader getReader(Object source) { return getReader(source, null); }
AbstractGridCoverage2DReader reader = format.getReader(getBinaryInputStream(response));
GridCoverage2DReader reader = format.getReader(getBinaryInputStream(response));
GridCoverage2D gc = format.getReader(tiffFile).read(null); GridCoverage original = getCatalog().getCoverageByName(getLayerId(MockData.TASMANIA_DEM)) .getGridCoverage(null, null);