Skip to content
Snippets Groups Projects
Commit de9daade authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Better management of dumped data in TilesCache when updating the tile

In the updateTile method (to be developed by the user according to the
kind of raster to be read), it happens that some useless data are
dumped. For instance, when reading some SRTM data, one needs to read
also some Geoid data. When reading the Geoid data, the elevations may be
dumped (if using the SimpleTile.interpolateElevation method).
parent 93d14e4a
No related branches found
No related tags found
No related merge requests found
......@@ -726,7 +726,7 @@ public class Rugged {
// set up the starting point of the fixed point method
final double pixel0 = sp0.getPixelNumber();
final double line0 = sp0.getLineNumber();
// Needed data for the dump
// Needed data for the dump
sensor.dumpRate(line0);
// Apply fixed point method until convergence in pixel and line
......
......@@ -108,9 +108,9 @@ public class DumpManager {
isSuspended = false;
}
}
/** In case dump is suspended and an exception is thrown,
* allow the dump to end nicely.
/** In case dump is suspended and an exception is thrown,
* allows the dump to end nicely.
*/
public static void endNicely() {
isSuspended = false;
......
......@@ -183,8 +183,8 @@ public class LineSensor {
public Vector3D getPosition() {
return position;
}
/** Dump the rate for the current line number
/** Dump the rate for the current line number.
* @param lineNumber line number
*/
public void dumpRate(final double lineNumber) {
......
......@@ -19,6 +19,7 @@ package org.orekit.rugged.raster;
import org.hipparchus.util.FastMath;
import java.lang.reflect.Array;
import org.orekit.rugged.errors.DumpManager;
import org.orekit.rugged.errors.RuggedException;
import org.orekit.rugged.errors.RuggedMessages;
......@@ -86,7 +87,16 @@ public class TilesCache<T extends Tile> {
// create the tile and retrieve its data
final T tile = factory.createTile();
// In case dump is asked for, suspend the dump manager as we don't need to dump anything here
// For instance for SRTM DEM, the user needs to read Geoid data that are not useful in the dump
final Boolean wasSuspended = DumpManager.suspend();
updater.updateTile(latitude, longitude, tile);
// Resume the dump manager if necessary
DumpManager.resume(wasSuspended);
tile.tileUpdateCompleted();
if (tile.getLocation(latitude, longitude) != Tile.Location.HAS_INTERPOLATION_NEIGHBORS) {
......
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