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
5403bbdb
Commit
5403bbdb
authored
10 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Dump min and max cells.
parent
db712d48
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
src/main/java/org/orekit/rugged/raster/SimpleTile.java
+36
-10
36 additions, 10 deletions
src/main/java/org/orekit/rugged/raster/SimpleTile.java
with
36 additions
and
10 deletions
src/main/java/org/orekit/rugged/raster/SimpleTile.java
+
36
−
10
View file @
5403bbdb
...
@@ -56,9 +56,21 @@ public class SimpleTile implements Tile {
...
@@ -56,9 +56,21 @@ public class SimpleTile implements Tile {
/** Minimum elevation. */
/** Minimum elevation. */
private
double
minElevation
;
private
double
minElevation
;
/** Latitude index of min elevation. */
private
int
minElevationLatitudeIndex
;
/** Longitude index of min elevation. */
private
int
minElevationLongitudeIndex
;
/** Maximum elevation. */
/** Maximum elevation. */
private
double
maxElevation
;
private
double
maxElevation
;
/** Latitude index of max elevation. */
private
int
maxElevationLatitudeIndex
;
/** Longitude index of max elevation. */
private
int
maxElevationLongitudeIndex
;
/** Elevation array. */
/** Elevation array. */
private
double
[]
elevations
;
private
double
[]
elevations
;
...
@@ -76,14 +88,18 @@ public class SimpleTile implements Tile {
...
@@ -76,14 +88,18 @@ public class SimpleTile implements Tile {
final
double
newLatitudeStep
,
final
double
newLongitudeStep
,
final
double
newLatitudeStep
,
final
double
newLongitudeStep
,
final
int
newLatitudeRows
,
final
int
newLongitudeColumns
)
final
int
newLatitudeRows
,
final
int
newLongitudeColumns
)
throws
RuggedException
{
throws
RuggedException
{
this
.
minLatitude
=
newMinLatitude
;
this
.
minLatitude
=
newMinLatitude
;
this
.
minLongitude
=
newMinLongitude
;
this
.
minLongitude
=
newMinLongitude
;
this
.
latitudeStep
=
newLatitudeStep
;
this
.
latitudeStep
=
newLatitudeStep
;
this
.
longitudeStep
=
newLongitudeStep
;
this
.
longitudeStep
=
newLongitudeStep
;
this
.
latitudeRows
=
newLatitudeRows
;
this
.
latitudeRows
=
newLatitudeRows
;
this
.
longitudeColumns
=
newLongitudeColumns
;
this
.
longitudeColumns
=
newLongitudeColumns
;
this
.
minElevation
=
Double
.
POSITIVE_INFINITY
;
this
.
minElevation
=
Double
.
POSITIVE_INFINITY
;
this
.
maxElevation
=
Double
.
NEGATIVE_INFINITY
;
this
.
minElevationLatitudeIndex
=
-
1
;
this
.
minElevationLongitudeIndex
=
-
1
;
this
.
maxElevation
=
Double
.
NEGATIVE_INFINITY
;
this
.
maxElevationLatitudeIndex
=
-
1
;
this
.
maxElevationLongitudeIndex
=
-
1
;
if
(
newLatitudeRows
<
1
||
newLongitudeColumns
<
1
)
{
if
(
newLatitudeRows
<
1
||
newLongitudeColumns
<
1
)
{
throw
new
RuggedException
(
RuggedMessages
.
EMPTY_TILE
,
newLatitudeRows
,
newLongitudeColumns
);
throw
new
RuggedException
(
RuggedMessages
.
EMPTY_TILE
,
newLatitudeRows
,
newLongitudeColumns
);
...
@@ -173,12 +189,14 @@ public class SimpleTile implements Tile {
...
@@ -173,12 +189,14 @@ public class SimpleTile implements Tile {
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
double
getMinElevation
()
{
public
double
getMinElevation
()
{
DumpManager
.
dumpTileCell
(
this
,
minElevationLatitudeIndex
,
minElevationLongitudeIndex
,
minElevation
);
return
minElevation
;
return
minElevation
;
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
double
getMaxElevation
()
{
public
double
getMaxElevation
()
{
DumpManager
.
dumpTileCell
(
this
,
maxElevationLatitudeIndex
,
maxElevationLongitudeIndex
,
maxElevation
);
return
maxElevation
;
return
maxElevation
;
}
}
...
@@ -192,8 +210,16 @@ public class SimpleTile implements Tile {
...
@@ -192,8 +210,16 @@ public class SimpleTile implements Tile {
latitudeIndex
,
longitudeIndex
,
latitudeIndex
,
longitudeIndex
,
latitudeRows
-
1
,
longitudeColumns
-
1
);
latitudeRows
-
1
,
longitudeColumns
-
1
);
}
}
minElevation
=
FastMath
.
min
(
minElevation
,
elevation
);
if
(
elevation
<
minElevation
)
{
maxElevation
=
FastMath
.
max
(
maxElevation
,
elevation
);
minElevation
=
elevation
;
minElevationLatitudeIndex
=
latitudeIndex
;
minElevationLongitudeIndex
=
longitudeIndex
;
}
if
(
elevation
>
maxElevation
)
{
maxElevation
=
elevation
;
maxElevationLatitudeIndex
=
latitudeIndex
;
maxElevationLongitudeIndex
=
longitudeIndex
;
}
elevations
[
latitudeIndex
*
getLongitudeColumns
()
+
longitudeIndex
]
=
elevation
;
elevations
[
latitudeIndex
*
getLongitudeColumns
()
+
longitudeIndex
]
=
elevation
;
}
}
...
...
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