I agree with your analysis.
the code
final NormalizedGeodeticPoint entry = ellipsoid.transform(entryP, ellipsoid.getBodyFrame(), null,
tile.getMinimumLongitude());
return tile.cellIntersection(entry, ellipsoid.convertLos(entryP, exitP),
tile.getFloorLatitudeIndex(closeGuess.getLatitude()),
tile.getFloorLongitudeIndex(closeGuess.getLongitude()));
which “entry” point is NormalizedGeodeticPoint, this Class longitude "/** Geodetic point whose longitude can be selected with respect to the 2π boundary.
"
and override the
public double getLongitude() {
return normalizedLongitude;
}
that’s why inside the
public NormalizedGeodeticPoint cellIntersection(final GeodeticPoint p_input, final Vector3D los, final int latitudeIndex,
final int longitudeIndex)
we can get a longitude greater than PI.
In my opinion, It’s the mismatch between the rugged’s core algorithm and my Tile implement causes the problem.
I think there are two way to fix this
- make it clear in the document that the Tile(and the TileUpdate) must support that NormalizedGeodeticPoint as the input in method “cellIntersection”
and maybe consider change the Interface Tile.cellIntersection to specify the param “p”
/** Find the intersection of a line-of-sight and a Digital Elevation Model cell.
* @param p point on the line, must be NormalizedGeodeticPoint,which with longitude 0~2PI
* @param los line-of-sight, in the topocentric frame (East, North, Zenith) of the point,
* scaled to match radians in the horizontal plane and meters along the vertical axis
* @param latitudeIndex latitude index of the Digital Elevation Model cell
* @param longitudeIndex longitude index of the Digital Elevation Model cell
* @return point corresponding to line-of-sight crossing the Digital Elevation Model surface
* if it lies within the cell, null otherwise
*/
NormalizedGeodeticPoint cellIntersection(NormalizedGeodeticPoint p, Vector3D los,
int latitudeIndex, int longitudeIndex);
- maybe change API is not a good chose , the other way is change the code before call “tile.cellIntersection”
i think most public DEM data like SRTM and ASTER uses -Pi to Pi to define Tiles, which is the same as GeodeticPoint 's definition.
at last, i would love to share my implement of tileUpdater about Noaa’s GLOBE DEM.
how to do that? I can try to make a fork and make a MR.I’m not sure the quality of my codes can meet the project requirements or not. Or just post my codes here.
anyway,I hope the discussion is useful, it’s my pleasure to help others to make use of rugged more easily.
thanks