From c0a282db0ba148edfb83535cdb335847ac5c5960 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Mon, 20 Oct 2014 12:42:27 +0200 Subject: [PATCH] Further clarifications. --- .../org/orekit/rugged/raster/TileUpdater.java | 26 +++++++++---------- .../orekit/rugged/raster/UpdatableTile.java | 10 +++++++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/org/orekit/rugged/raster/TileUpdater.java b/core/src/main/java/org/orekit/rugged/raster/TileUpdater.java index 86310a44..ea81174e 100644 --- a/core/src/main/java/org/orekit/rugged/raster/TileUpdater.java +++ b/core/src/main/java/org/orekit/rugged/raster/TileUpdater.java @@ -53,23 +53,23 @@ public interface TileUpdater { * </li> * <li> * As elevations are interpolated within Digital Elevation Model - * pixels using four pixels at indices (i, j), (i+1, j), (i, j+1) - * (i+1, j+1). A point in the northernmost row (resp. easternmost - * column) miss neighboring points at row j+1 (resp. neighboring - * points at column i+1) and therefore cannot be interpolated. - * The method should therefore select the northernmost tile if the - * specified latitude is in the overlapping row between two tiles, - * and it should select the easternmost tile if the specified longitude - * is in the overlapping column between two tiles. Failing to do so will - * trigger an error at caller level mentioning the missing required - * neighbors. + * pixels using four pixels at indices (kLat, kLon), (kLat+1, kLon), + * (kLat, kLon+1), (kLat+1, kLon+1). A point in the northernmost row + * (resp. easternmost column) miss neighboring points at row kLat+1 + * (resp. neighboring points at column kLon+1) and therefore cannot + * be interpolated. The method should therefore select the northernmost + * tile if the specified latitude is in the overlapping row between two + * tiles, and it should select the easternmost tile if the specified + * longitude is in the overlapping column between two tiles. Failing + * to do so will trigger an error at caller level mentioning the missing + * required neighbors. * </li> * <li> * The elevation at grid point as set when calling {@link - * UpdatableTile#setElevation(int, int, double) tile.setElevation(i, j, + * UpdatableTile#setElevation(int, int, double) tile.setElevation(kLat, kLon, * elevation)} must be the elevation corresponding to the latitude - * {@code minLatitude + i * latitudeStep} and longitude {@code - * minLongitude + j * longitudeStep}, where {@code minLatitude}, + * {@code minLatitude + kLat * latitudeStep} and longitude {@code + * minLongitude + kLon * longitudeStep}, where {@code minLatitude}, * {@code latitudeStep}, {@code minLongitude} and {@code longitudeStep} * correspond to the parameter of the {@link UpdatableTile#setGeometry(double, * double, double, double, int, int) tile.setGeometry(minLatitude, minLongitude, diff --git a/core/src/main/java/org/orekit/rugged/raster/UpdatableTile.java b/core/src/main/java/org/orekit/rugged/raster/UpdatableTile.java index e296930d..51fb1141 100644 --- a/core/src/main/java/org/orekit/rugged/raster/UpdatableTile.java +++ b/core/src/main/java/org/orekit/rugged/raster/UpdatableTile.java @@ -38,6 +38,16 @@ public interface UpdatableTile { throws RuggedException; /** Set the elevation for one raster element. + * <p> + * BEWARE! The order of the indices follows geodetic conventions, i.e. + * the latitude is given first and longitude afterwards, so the first + * index specifies a <em>row</em> index with zero at South and max value + * at North, and the second index specifies a <em>column</em> index + * with zero at West and max value at East. This is <em>not</em> the + * same as some raster conventions (as our row index increases from South + * to North) and this is also not the same as Cartesian coordinates as + * our ordinate index appears before our abscissa index). + * </p> * @param latitudeIndex index of latitude (row index) * @param longitudeIndex index of longitude (column index) * @param elevation elevation (m) -- GitLab