Skip to content
Snippets Groups Projects
Commit 0db9c4d7 authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

revert location precision

parent 16b83b72
No related branches found
No related tags found
1 merge request!139Lib work
......@@ -468,8 +468,20 @@ public final class Locations {
}
/*
* Helper assumes supplied values in radians and kilometers. Returned location
* is rounded to 6 decimal places, sub-meter scale precision.
* Helper assumes supplied values in radians and kilometers.
*
* TODO revisit. Introduced rounding of result in refactoring for JSON. This
* changes hazard, most significantly when creating pseudo-sources for grid
* source optimization tables. I think it would be nice to have locations be
* lower precision when resampling traces or splitting location lists.
* Consider introducing a rounding flag.
*
* Interestingly the Locations tests did not fail when the formatting was
* removed
*
* Location.create( Maths.round(lon2 * Maths.TO_DEGREES, 5), Maths.round(lat2
* * Maths.TO_DEGREES, 5), Maths.round(depth + Δv, 5));
*
*/
private static Location location(
double lon,
......@@ -486,10 +498,7 @@ public final class Locations {
double cosD = cos(ad);
double lat2 = asin(sinLat1 * cosD + cosLat1 * sinD * cos(az));
double lon2 = lon + atan2(sin(az) * sinD * cosLat1, cosD - sinLat1 * sin(lat2));
return Location.create(
Maths.round(lon2 * Maths.TO_DEGREES, 5),
Maths.round(lat2 * Maths.TO_DEGREES, 5),
Maths.round(depth + Δv, 5));
return Location.create(lon2 * Maths.TO_DEGREES, lat2 * Maths.TO_DEGREES, depth + Δv);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment