Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
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
Container Registry
Model registry
Operate
Environments
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
Orekit
Rugged
Commits
f7db30da
Commit
f7db30da
authored
11 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Work In Progress on Duvenhage algorithm.
parent
1ccd1ef7
No related branches found
No related tags found
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
+43
-7
43 additions, 7 deletions
.../org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java
with
43 additions
and
7 deletions
rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java
+
43
−
7
View file @
f7db30da
...
...
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
;
import
org.apache.commons.math3.util.FastMath
;
import
org.orekit.bodies.GeodeticPoint
;
import
org.orekit.errors.OrekitException
;
import
org.orekit.rugged.api.RuggedException
;
...
...
@@ -107,15 +108,14 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
final
GeodeticPoint
next
=
lineOfSightQueue
.
remove
(
lineOfSightQueue
.
size
()
-
1
);
final
int
nextLatIndex
=
tile
.
getLatitudeIndex
(
next
.
getLatitude
());
final
int
nextLonIndex
=
tile
.
getLontitudeIndex
(
next
.
getLongitude
());
if
(
currentLatIndex
==
nextLatIndex
&&
currentLonIndex
==
nextLonIndex
)
{
if
(
FastMath
.
abs
(
currentLatIndex
-
nextLatIndex
)
<=
1
&&
FastMath
.
abs
(
currentLonIndex
-
nextLonIndex
)
<=
1
)
{
// we have narrowed the search down to a single Digital Elevation Model pixel
if
(
next
.
getAltitude
()
<=
tile
.
getElevationAtIndices
(
nextLatIndex
,
nextLonIndex
)
||
next
.
getAltitude
()
<=
tile
.
getElevationAtIndices
(
nextLatIndex
,
nextLonIndex
+
1
)
||
next
.
getAltitude
()
<=
tile
.
getElevationAtIndices
(
nextLatIndex
+
1
,
nextLonIndex
)
||
next
.
getAltitude
()
<=
tile
.
getElevationAtIndices
(
nextLatIndex
+
1
,
nextLonIndex
+
1
))
{
// TODO: compute intersection
throw
RuggedException
.
createInternalError
(
null
);
final
GeodeticPoint
intersection
=
pixelIntersection
(
ellipsoid
,
current
,
next
,
tile
,
nextLatIndex
,
nextLonIndex
);
if
(
intersection
!=
null
)
{
return
intersection
;
}
else
{
// no intersection on this pixel, we can proceed to next part of the line-of-sight
current
=
next
;
...
...
@@ -237,6 +237,42 @@ 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