diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/raster/SimpleTile.java b/rugged-core/src/main/java/org/orekit/rugged/core/raster/SimpleTile.java index 066b3fb88d27dee4c940af9dd87dbb219eb2b966..2e6190572eaf681a5694c521d990ec45efcd8ec4 100644 --- a/rugged-core/src/main/java/org/orekit/rugged/core/raster/SimpleTile.java +++ b/rugged-core/src/main/java/org/orekit/rugged/core/raster/SimpleTile.java @@ -108,25 +108,37 @@ public class SimpleTile implements Tile { /** {@inheritDoc} */ @Override public double getMinimumLatitude() { - return minLatitude; + return getLatitudeAtIndex(0); + } + + /** {@inheritDoc} */ + @Override + public double getLatitudeAtIndex(final int latitudeIndex) { + return minLatitude + latitudeStep * latitudeIndex; } /** {@inheritDoc} */ @Override public double getMaximumLatitude() { - return minLatitude + latitudeStep * (latitudeRows - 1); + return getLatitudeAtIndex(latitudeRows - 1); } /** {@inheritDoc} */ @Override public double getMinimumLongitude() { - return minLongitude; + return getLongitudeAtIndex(0); + } + + /** {@inheritDoc} */ + @Override + public double getLongitudeAtIndex(final int longitudeIndex) { + return minLongitude + longitudeStep * longitudeIndex; } /** {@inheritDoc} */ @Override public double getMaximumLongitude() { - return minLongitude + longitudeStep * (longitudeColumns - 1); + return getLongitudeAtIndex(longitudeColumns - 1); } /** {@inheritDoc} */ @@ -242,7 +254,7 @@ public class SimpleTile implements Tile { /** Get the latitude index of a point. * @param latitude geodetic latitude - * @return latirute index (it may lie outside of the tile!) + * @return latitute index (it may lie outside of the tile!) */ private double getDoubleLatitudeIndex(double latitude) { return (latitude - minLatitude) / latitudeStep; diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/raster/Tile.java b/rugged-core/src/main/java/org/orekit/rugged/core/raster/Tile.java index a2c9d60d7b112eb227f24ad7e447c146c56d14b3..199acf48b41dc191db63b9aeda4c6294a6de1607 100644 --- a/rugged-core/src/main/java/org/orekit/rugged/core/raster/Tile.java +++ b/rugged-core/src/main/java/org/orekit/rugged/core/raster/Tile.java @@ -48,6 +48,12 @@ public interface Tile extends UpdatableTile { */ double getMinimumLatitude(); + /** Get the latitude at some index. + * @param latitudeIndex latitude index + * @return latitude at the specified index + */ + double getLatitudeAtIndex(int latitudeIndex); + /** Get maximum latitude. * @return maximum latitude */ @@ -58,6 +64,12 @@ public interface Tile extends UpdatableTile { */ double getMinimumLongitude(); + /** Get the longitude at some index. + * @param longitudeIndex longitude index + * @return longitude at the specified index + */ + double getLongitudeAtIndex(int longitudeIndex); + /** Get maximum longitude. * @return maximum longitude */