public double[] GetGeoTransform() { double adfGeoTransform[] = new double[6]; GetGeoTransform(adfGeoTransform); return adfGeoTransform; }
public double[] GetGeoTransform() { final double adfGeoTransform[] = new double[6]; GetGeoTransform(adfGeoTransform); return adfGeoTransform; }
/** * Fetches metadata from the given GDAL dataset. */ GridGeometry(final Dataset ds) throws IOException { if (ds == null) { throw new IOException("DataSet is closed."); } xSize = ds.getRasterXSize(); ySize = ds.getRasterYSize(); numBands = ds.getRasterCount(); final double[] gt = ds.GetGeoTransform(); gridToCRS = new AffineTransform(gt[1], gt[4], gt[2], gt[5], gt[0], gt[3]); crs = CRS.create(ds.GetProjection()); }
private static GeoCoding buildGeoCoding(Dataset gdalProduct) { String wellKnownText = gdalProduct.GetProjectionRef(); if (!StringUtils.isNullOrEmpty(wellKnownText)) { int imageWidth = gdalProduct.getRasterXSize(); int imageHeight = gdalProduct.getRasterYSize(); double[] adfGeoTransform = new double[6]; gdalProduct.GetGeoTransform(adfGeoTransform); double originX = adfGeoTransform[0]; double originY = adfGeoTransform[3]; double pixelSizeX = adfGeoTransform[1]; double pixelSizeY = (adfGeoTransform[5] > 0) ? adfGeoTransform[5] : -adfGeoTransform[5]; try { CoordinateReferenceSystem crs = CRS.parseWKT(wellKnownText); return new CrsGeoCoding(crs, imageWidth, imageHeight, originX, originY, pixelSizeX, pixelSizeY); } catch (Exception ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); } } return null; }
Bounds bounds(Dataset dataset) { Dimension size = size(dataset); double[] tx = dataset.GetGeoTransform(); return new Bounds(tx[0], tx[0] + size.width() * tx[1], tx[3], tx[3] + size.width()*tx[4] + size.height()*tx[5]); }
private Envelope readEnvelope() throws UnknownCRSException, IOException { double[] geoTransform = dataset.GetGeoTransform(); int rasterXSize = dataset.getRasterXSize(); int rasterYSize = dataset.getRasterYSize(); double pixelResX = geoTransform[1]; double pixelResY = geoTransform[5]; double minX = geoTransform[0]; double maxX = minX + pixelResX * rasterXSize; double minY = geoTransform[3]; double maxY = minY + pixelResY * rasterYSize; if ( minX > maxX ) { double tmp = maxX; maxX = minX; minX = tmp; } if ( minY > maxY ) { double tmp = maxY; maxY = minY; minY = tmp; } Point min = new DefaultPoint( null, crs, null, new double[] { minX, minY } ); Point max = new DefaultPoint( null, crs, null, new double[] { maxX, maxY } ); return new DefaultEnvelope( null, crs, null, min, max ); }
/** * Set georeferencing information from an input <code>Dataset</code> * * @param dataset * a <code>Dataset</code> from where to retrieve all * georeferencing information available */ private void setGeoreferencingInfo(final Dataset dataset) { // Setting CRS's related information final double[] geoT = new double[6]; dataset.GetGeoTransform(geoT); setGeoTransformation(geoT); setProjection(dataset.GetProjection()); setGcpProjection(dataset.GetGCPProjection()); setGcpNumber(dataset.GetGCPCount()); }
/** * Set georeferencing information from an input <code>Dataset</code> * * @param dataset * a <code>Dataset</code> from where to retrieve all * georeferencing information available */ private void setGeoreferencingInfo(final Dataset dataset) { // Setting CRS's related information final double[] geoT = new double[6]; dataset.GetGeoTransform(geoT); setGeoTransformation(geoT); setProjection(dataset.GetProjection()); setGcpProjection(dataset.GetGCPProjection()); setGcpNumber(dataset.GetGCPCount()); }
gdalProduct.GetGeoTransform(adfGeoTransform); double originX = adfGeoTransform[0]; double originY = adfGeoTransform[3];
crs = CRSManager.lookup( configuredCrs ); double[] geoTransform = gdalDataset.GetGeoTransform(); int rasterXSize = gdalDataset.getRasterXSize(); int rasterYSize = gdalDataset.getRasterYSize();
final double[] geoTransform = dataset.GetGeoTransform(); if (projection != null) { final CoordinateSystem esriCoordinateSystem = EsriCoordinateSystems.getCoordinateSystem(projection);