Skip to content

Commit 10a2538

Browse files
author
stoecker
committed
add missing Javadoc, fix #24238
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19389 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 533b670 commit 10a2538

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

+62
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ static List<List<List<WayPoint>>> loadTracks(Collection<IGpxTrack> tracks) {
200200
return trks;
201201
}
202202

203+
/**
204+
* Gets the elevation value from a WayPoint's attributes.
205+
* @param wp the WayPoint
206+
* @return the WayPoint's elevation (in meters)
207+
*/
203208
static Double getElevation(WayPoint wp) {
204209
if (wp != null) {
205210
String value = wp.getString(GpxConstants.PT_ELE);
@@ -214,6 +219,12 @@ static Double getElevation(WayPoint wp) {
214219
return null;
215220
}
216221

222+
/**
223+
* Gets the horizontal positioning estimated error value from a WayPoint's attributes.
224+
* @param wp the WayPoint
225+
* @return the WayPoint's horizontal positioning error (in meters)
226+
* @since 19387
227+
*/
217228
static Double getHPosErr(WayPoint wp) {
218229
if (wp != null) {
219230
if (wp.attr.get(GpxConstants.PT_STD_HDEV) instanceof Float) {
@@ -231,6 +242,14 @@ static Double getHPosErr(WayPoint wp) {
231242
return null;
232243
}
233244

245+
/**
246+
* Retrieves GPS Dilution of Precision (DOP) from a WayPoint's attributes.
247+
* Checks for Position DOP (PDOP) first, then falls back to Horizontal DOP (HDOP) if PDOP isn't available.
248+
* Converts Float values to Double for consistent return type.
249+
* @param wp the WayPoint
250+
* @return the WayPoint's DOP value as Double (PDOP preferred, HDOP fallback)
251+
* @since 19387
252+
*/
234253
static Double getGpsDop(WayPoint wp) {
235254
if (wp != null) {
236255
if (wp.attr.get(GpxConstants.PT_PDOP) != null) {
@@ -252,6 +271,13 @@ static Double getGpsDop(WayPoint wp) {
252271
return null;
253272
}
254273

274+
/**
275+
* Gets the track direction angle value from a waypoint in a GNSS track.
276+
* This angle is the GNSS receiver movement direction.
277+
* @param wp the waypoint
278+
* @return the waypoint direction (in degrees)
279+
* @since 19387
280+
*/
255281
static Double getGpsTrack(WayPoint wp) {
256282
if (wp != null) {
257283
String trackvalue = wp.getString(GpxConstants.PT_COURSE);
@@ -267,6 +293,19 @@ static Double getGpsTrack(WayPoint wp) {
267293
return null;
268294
}
269295

296+
/**
297+
* Determines the GPS processing method based on previous and current GNSS fix modes.
298+
* This method compares the positioning modes of the previous and current GNSS fixes,
299+
* selects the most basic processing method (lowest index in positioningModes list),
300+
* and formats the output string according to predefined conventions.
301+
* Because the returned processing method depends on a time correlation between an image
302+
* and a waypoint timestamp, the term 'CORRELATION' is added.
303+
* @param prevGpsFixMode the previous GNSS fix mode (e.g., "SINGLE", "DGNSS", "RTK_FIX")
304+
* @param curGpsFixMode the current GNSS fix mode
305+
* @param positioningModes list of positioning modes ordered by accuracy
306+
* @return formatted processing method string
307+
* @since 19387
308+
*/
270309
static String getGpsProcMethod(String prevGpsFixMode, final String curGpsFixMode,
271310
final List<String> positioningModes) {
272311
String gpsProcMethod = null;
@@ -291,6 +330,17 @@ static String getGpsProcMethod(String prevGpsFixMode, final String curGpsFixMode
291330
return gpsProcMethod;
292331
}
293332

333+
/**
334+
* Determines if the GNSS mode is 2d or 3d, based on previous and current GNSS fix modes.
335+
* This method compares the positioning modes of the previous and current GNSS fixes,
336+
* selects the most basic processing method (lowest index in positioningModes list),
337+
* and return the lowest value between 2d or 3d mode, or null if it's not a gnss mode (e.g. estimated, manual).
338+
* @param prevGpsFixMode the previous GNSS mode
339+
* @param curGpsFixMode the current GNSS mode
340+
* @param positioningModes list of positioning modes ordered by accuracy
341+
* @return 2 for 2d, 3 for 3d, or null
342+
* @since 19387
343+
*/
294344
static Integer getGps2d3dMode(String prevGpsFixMode, final String curGpsFixMode,
295345
final List<String> positioningModes) {
296346
Integer lowestMode = null;
@@ -512,10 +562,22 @@ private static int matchPoints(List<? extends GpxImageEntry>
512562
}
513563
// CHECKSTYLE.ON: ParameterNumber
514564

565+
/**
566+
* Computes an adjusted direction by applying an angular offset and normalizing the result between 0° and 360°.
567+
* @param direction initial direction angle (in radians)
568+
* @param angleOffset angular offset to apply (in degrees)
569+
* @return resulting direction normalized to the range [0, 360) degrees
570+
*/
515571
private static double computeDirection(double direction, double angleOffset) {
516572
return (Utils.toDegrees(direction) + angleOffset) % 360d;
517573
}
518574

575+
/**
576+
* Finds the last image in the sorted image list which is before the given time
577+
* @param images list of images
578+
* @param searchTime time to search
579+
* @return index of last image before given time
580+
*/
519581
private static int getLastIndexOfListBefore(List<? extends GpxImageEntry> images, long searchedTime) {
520582
int lstSize = images.size();
521583

0 commit comments

Comments
 (0)