Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged-MOD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
youngcle
Rugged-MOD
Commits
5cdd4055
Commit
5cdd4055
authored
11 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Delegate final pixel intersection to Tile.
parent
d823d636
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java
+6
-43
6 additions, 43 deletions
.../org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java
with
6 additions
and
43 deletions
rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java
+
6
−
43
View file @
5cdd4055
...
...
@@ -31,7 +31,7 @@ import org.orekit.rugged.core.raster.IntersectionAlgorithm;
import
org.orekit.rugged.core.raster.Tile
;
import
org.orekit.rugged.core.raster.TilesCache
;
/** Digital Elevation Model intersection using Duvenhage's algorithm.
/** Digital Elevation Model intersection using
Bernardt
Duvenhage's algorithm.
* <p>
* The algorithm is described in the 2009 paper:
* <a href="http://researchspace.csir.co.za/dspace/bitstream/10204/3041/1/Duvenhage_2009.pdf">Using
...
...
@@ -55,8 +55,7 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
/** {@inheritDoc} */
@Override
public
void
setUpTilesManagement
(
final
TileUpdater
updater
,
final
int
maxCachedTiles
)
{
cache
=
new
TilesCache
<
MinMaxTreeTile
>(
new
MinMaxTreeTileFactory
(),
updater
,
maxCachedTiles
);
cache
=
new
TilesCache
<
MinMaxTreeTile
>(
new
MinMaxTreeTileFactory
(),
updater
,
maxCachedTiles
);
}
/** {@inheritDoc} */
...
...
@@ -96,7 +95,7 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
while
(
true
)
{
int
currentLatIndex
=
tile
.
getLatitudeIndex
(
current
.
getLatitude
());
int
currentLonIndex
=
tile
.
getLon
t
itudeIndex
(
current
.
getLongitude
());
int
currentLonIndex
=
tile
.
getLon
g
itudeIndex
(
current
.
getLongitude
());
// find where line-of-sight exit tile
final
LimitPoint
exit
=
findExit
(
tile
,
ellipsoid
,
position
,
los
);
...
...
@@ -107,13 +106,13 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
final
GeodeticPoint
next
=
lineOfSightQueue
.
remove
(
lineOfSightQueue
.
size
()
-
1
);
final
int
nextLatIndex
=
tile
.
getLatitudeIndex
(
next
.
getLatitude
());
final
int
nextLonIndex
=
tile
.
getLon
t
itudeIndex
(
next
.
getLongitude
());
final
int
nextLonIndex
=
tile
.
getLon
g
itudeIndex
(
next
.
getLongitude
());
if
(
FastMath
.
abs
(
currentLatIndex
-
nextLatIndex
)
<=
1
&&
FastMath
.
abs
(
currentLonIndex
-
nextLonIndex
)
<=
1
)
{
// we have narrowed the search down to a single Digital Elevation Model pixel
final
GeodeticPoint
intersection
=
pixelIntersection
(
ellipsoid
,
current
,
next
,
tile
,
nextLatIndex
,
nextLonIndex
);
final
GeodeticPoint
intersection
=
tile
.
pixelIntersection
(
ellipsoid
,
current
,
next
,
nextLatIndex
,
nextLonIndex
);
if
(
intersection
!=
null
)
{
return
intersection
;
}
else
{
...
...
@@ -237,42 +236,6 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
}
/** Find the intersection of a line-of-sight and a Digital Elevation Model pixel.
* @param ellipsoid reference ellipsoid
* @param pA first point on the line (close to the pixel)
* @param pB second point on the line (close to the pixel)
* @param tile Digital Elevation Model tile
* @param latitudeIndex latitude index of the Digital Elevation Model pixel
* @param longitudeIndex longitude index of the Digital Elevation Model pixel
* @return point corresponding to line-of-sight crossing the Digital Elevation Model surface
* if it lies within the pixel, null otherwise
* @exception RuggedException if intersection point cannot be computed
* @exception OrekitException if intersection point cannot be converted to geodetic coordinates
*/
private
GeodeticPoint
pixelIntersection
(
final
ExtendedEllipsoid
ellipsoid
,
final
GeodeticPoint
pA
,
final
GeodeticPoint
pB
,
final
MinMaxTreeTile
tile
,
final
int
latitudeIndex
,
final
int
longitudeIndex
)
throws
RuggedException
,
OrekitException
{
// Digital Elevation Mode coordinates at pixel vertices
final
double
x00
=
tile
.
getLongitudeAtIndex
(
longitudeIndex
);
final
double
y00
=
tile
.
getLatitudeAtIndex
(
latitudeIndex
);
final
double
z00
=
tile
.
getElevationAtIndices
(
latitudeIndex
,
longitudeIndex
);
final
double
z01
=
tile
.
getElevationAtIndices
(
latitudeIndex
+
1
,
longitudeIndex
);
final
double
z10
=
tile
.
getElevationAtIndices
(
latitudeIndex
,
longitudeIndex
+
1
);
final
double
z11
=
tile
.
getElevationAtIndices
(
latitudeIndex
+
1
,
longitudeIndex
+
1
);
// line-of-sight coordinates at close points
final
double
dxA
=
(
pA
.
getLongitude
()
-
x00
)
/
tile
.
getLongitudeStep
();
final
double
dyA
=
(
pA
.
getLatitude
()
-
y00
)
/
tile
.
getLatitudeStep
();
final
double
dzA
=
pA
.
getAltitude
();
final
double
dxB
=
(
pB
.
getLongitude
()
-
x00
)
/
tile
.
getLongitudeStep
();
final
double
dyB
=
(
pB
.
getLatitude
()
-
y00
)
/
tile
.
getLatitudeStep
();
final
double
dzB
=
pB
.
getAltitude
();
// TODO: compute intersection
return
null
;
}
/** Compute a line-of-sight exit point from a tile.
* @param tile tile to consider
* @param ellipsoid reference ellipsoid
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment