Skip to content
Snippets Groups Projects
Commit e7ac25a6 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

More complete cell dump.

parent 5c41af7f
No related branches found
No related tags found
No related merge requests found
......@@ -59,21 +59,14 @@ class Dump {
/** Dump some context data.
* @param tile tile to which the cell belongs
* @param latitudeIndex latitude index of the South neighbors of the cell
* @param longitudeIndex longitude index of the West neighbors of the cell
* @param e00 elevation of the South-West neighbor of the cell
* @param e10 elevation of the South-East neighbor of the cell
* @param e01 elevation of the North-West neighbor of the cell
* @param e11 elevation of the North-East neighbor of the cell
* @param latitudeIndex latitude index of the cell
* @param longitudeIndex longitude index of the cell
* @param elevation elevation of the cell
*/
public void dumpTileCell(final Tile tile,
final int latitudeIndex, final int longitudeIndex,
final double e00, final double e10, final double e01, final double e11) {
final DumpedTileData dumpedTileData = getTileData(tile);
dumpedTileData.setElevation(latitudeIndex, longitudeIndex, e00);
dumpedTileData.setElevation(latitudeIndex, longitudeIndex + 1, e10);
dumpedTileData.setElevation(latitudeIndex + 1, longitudeIndex, e01);
dumpedTileData.setElevation(latitudeIndex + 1, longitudeIndex + 1, e11);
final double elevation) {
getTileData(tile).setElevation(latitudeIndex, longitudeIndex, elevation);
}
/** Get tile data.
......
......@@ -81,20 +81,17 @@ public class DumpManager {
return DUMP.get() != null;
}
/** Dump some context data.
/** Dump DEM cell data.
* @param tile tile to which the cell belongs
* @param latitudeIndex latitude index of the South neighbors of the cell
* @param longitudeIndex longitude index of the West neighbors of the cell
* @param e00 elevation of the South-West neighbor of the cell
* @param e10 elevation of the South-East neighbor of the cell
* @param e01 elevation of the North-West neighbor of the cell
* @param e11 elevation of the North-East neighbor of the cell
* @param latitudeIndex latitude index of the cell
* @param longitudeIndex longitude index of the cell
* @param elevation elevation of the cell
*/
public static void dumpTileCell(final Tile tile,
final int latitudeIndex, final int longitudeIndex,
final double e00, final double e10, final double e01, final double e11) {
final double elevation) {
if (isActive()) {
DUMP.get().dumpTileCell(tile, latitudeIndex, longitudeIndex, e00, e10, e01, e11);
DUMP.get().dumpTileCell(tile, latitudeIndex, longitudeIndex, elevation);
}
}
......
......@@ -200,7 +200,9 @@ public class SimpleTile implements Tile {
/** {@inheritDoc} */
@Override
public double getElevationAtIndices(final int latitudeIndex, final int longitudeIndex) {
return elevations[latitudeIndex * getLongitudeColumns() + longitudeIndex];
final double elevation = elevations[latitudeIndex * getLongitudeColumns() + longitudeIndex];
DumpManager.dumpTileCell(this, latitudeIndex, longitudeIndex, elevation);
return elevation;
}
/** {@inheritDoc}
......@@ -241,8 +243,6 @@ public class SimpleTile implements Tile {
final double e01 = getElevationAtIndices(latitudeIndex + 1, longitudeIndex);
final double e11 = getElevationAtIndices(latitudeIndex + 1, longitudeIndex + 1);
DumpManager.dumpTileCell(this, latitudeIndex, longitudeIndex, e00, e10, e01, e11);
return (e00 * (1.0 - dLon) + dLon * e10) * (1.0 - dLat) +
(e01 * (1.0 - dLon) + dLon * e11) * dLat;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment