Repository navigation
updated computeResolution in IterativeCostDistance to match Iterative Viewshed - #3106
Conversation
|
There are two tests that failed https://github.com/locationtech/geotrellis/blob/master/spark/src/test/scala/geotrellis/spark/costdistance/IterativeCostDistanceSpec.scala#L100 and https://github.com/locationtech/geotrellis/blob/master/spark/src/test/scala/geotrellis/spark/costdistance/IterativeCostDistanceSpec.scala#L110 The two previous tests that are very similar passed It looks like a floating point rounding error at first glance but I am not sure how precise the results should be. @echeipesh any suggestions on fixing this? |
|
hey @jmtaysom you can fix these tests by writing smth like |
|
Anyway, even without this code shuffling, I will 👍 the PR once travis is happy. GZ with your first contribution! |
|
@pomadchin All the tests are passing now |
…Viewshed The compute resolution method in Iterative Cost Distance was calcultating the cell size based on the length of a degree at the equator without scaling for the current latitude. This introduces an error as you move away from the equator. The same method in Iterative Viewshed compensates for this and maintains greater spatial accuracy. See issue 3103 locationtech#3103 Signed-off-by: jmtaysom <[email protected]>
Signed-off-by: jmtaysom <[email protected]>
23ab5bc to
0fed8a9
Compare
| /** | ||
| * Compute the resolution (in meters per pixel) of a layer. | ||
| */ | ||
| private [spark] def computeResolution[K: (* => SpatialKey), V: (* => Tile)]( |
There was a problem hiding this comment.
I decided to move this function into the CostDistance object to avoid code duplication (we had two versions of the same function implemented in two different places).
pomadchin
left a comment
There was a problem hiding this comment.
LGTM! Merging once travis is happy.
Signed-off-by: Grigory Pomadchin <[email protected]>
The compute resolution method in Iterative Cost Distance was calcultating the
cell size based on the length of a degree at the equator without scaling for
the current latitude. This introduces an error as you move away from the
equator. The same method in Iterative Viewshed compensates for this and
maintains greater spatial accuracy.
See issue #3103
Signed-off-by: jmtaysom [email protected]
Overview
The compute resolution method in Iterative Cost Distance was calcultating the
cell size based on the length of a degree at the equator without scaling for
the current latitude. This introduces an error as you move away from the
equator. The same method in Iterative Viewshed compensates for this and
maintains greater spatial accuracy.
Checklist
docs/CHANGELOG.rstupdated, if necessaryCloses #3103