// Path: src/main/java/org/openstreetmap/osmaxil/model/ElevationImport.java
// public class ElevationImport extends AbstractImport {
// 
// 	// private Coordinates coordinates;
// 
// 	public float x, y, z;
// 
// 	public ElevationImport(float x, float y, float z) {
// 		this.x = x;
// 		this.y = y;
// 		this.z = z;
// 		this.setId(Math.round(z));
// 	}
// 
// 	@Override
// 	public String getValueByTagName(String tagName) {
// 		return "Sorry, there is no tag for that type of import";
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Elevation import with x=" + x + " y=" + y + " z=" + z;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import org.gdal.gdal.Band;
import org.gdal.gdal.Dataset;
import org.gdal.gdal.gdal;
import org.gdal.gdalconst.gdalconstConstants;
import org.openstreetmap.osmaxil.model.ElevationImport;


	public ElevationRasterFile(String source, int srid) {
		this.init(source, srid);
	}

	@Override
	public void init(String source, int srid) {
		this.filePath = source;
		this.srid = srid;
		gdal.AllRegister();
		LOGGER.info("Opening " + this.filePath);
		this.dataset = gdal.Open(this.filePath, gdalconstConstants.GA_ReadOnly);
		int numBands = dataset.getRasterCount();
		bands = new ArrayList<>();
		LOGGER.info("Number of bands is: " + numBands);
		for (int i = 1; i <= numBands; i++) {
			this.bands.add(dataset.GetRasterBand(i));
		}
		// Store the coordinates of the lower left point
		double[] geotransform = dataset.GetGeoTransform();
		this.xUpperLeft = geotransform[0];
		this.yUpperLeft = geotransform[3];
		LOGGER.info("Upper left coordinates are: " + this.xUpperLeft + " " + this.yUpperLeft);
		// Store the pixel sizes
		this.xPixelSize = geotransform[1];
		this.yPixelSize = Math.abs(geotransform[5]);
		LOGGER.info("Pixel sizes are: " + this.xPixelSize + " " + this.yPixelSize);
	}

	@Override

// Path: src/main/java/org/openstreetmap/osmaxil/model/ElevationImport.java
// public class ElevationImport extends AbstractImport {
// 
// 	// private Coordinates coordinates;
// 
// 	public float x, y, z;
// 
// 	public ElevationImport(float x, float y, float z) {
// 		this.x = x;
// 		this.y = y;
// 		this.z = z;
// 		this.setId(Math.round(z));
// 	}
// 
// 	@Override
// 	public String getValueByTagName(String tagName) {
// 		return "Sorry, there is no tag for that type of import";
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Elevation import with x=" + x + " y=" + y + " z=" + z;
// 	}
// 
// }


// Path: src/main/java/org/openstreetmap/osmaxil/dao/ElevationRasterFile.java
import java.util.ArrayList;
import java.util.List;
import org.gdal.gdal.Band;
import org.gdal.gdal.Dataset;
import org.gdal.gdal.gdal;
import org.gdal.gdalconst.gdalconstConstants;
import org.openstreetmap.osmaxil.model.ElevationImport;


	public ElevationRasterFile(String source, int srid) {
		this.init(source, srid);
	}

	@Override
	public void init(String source, int srid) {
		this.filePath = source;
		this.srid = srid;
		gdal.AllRegister();
		LOGGER.info("Opening " + this.filePath);
		this.dataset = gdal.Open(this.filePath, gdalconstConstants.GA_ReadOnly);
		int numBands = dataset.getRasterCount();
		bands = new ArrayList<>();
		LOGGER.info("Number of bands is: " + numBands);
		for (int i = 1; i <= numBands; i++) {
			this.bands.add(dataset.GetRasterBand(i));
		}
		// Store the coordinates of the lower left point
		double[] geotransform = dataset.GetGeoTransform();
		this.xUpperLeft = geotransform[0];
		this.yUpperLeft = geotransform[3];
		LOGGER.info("Upper left coordinates are: " + this.xUpperLeft + " " + this.yUpperLeft);
		// Store the pixel sizes
		this.xPixelSize = geotransform[1];
		this.yPixelSize = Math.abs(geotransform[5]);
		LOGGER.info("Pixel sizes are: " + this.xPixelSize + " " + this.yPixelSize);
	}

	@Override

	public ElevationImport findElevationByCoordinates(float x, float y, float valueScale, int srid) {
