-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To/#163 adapt geo utils #175
Conversation
# Conflicts: # src/main/scala/edu/ie3/util/osm/OsmModel.scala # src/main/scala/edu/ie3/util/osm/TagUtils.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a partial review, I think someone who has deeper knowledge of the former GeoUtils should look into this
* @return | ||
* a [[LineString]] between the provided points | ||
*/ | ||
def buildSafeLineStringBetweenPoints(p1: Point, p2: Point): LineString = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, points are expected as arguments and then their underlying coordinates are extracted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it might still make sense to use points here, since a point is a geometry consisting of one coordinate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to foster this aspect. You could easily forward to buildSafeLineStringBetweenCoordinates
and would avoid double logic. You might as well check, if then buildSafePoint
still is needed at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! I just copied the old code in that case and didn't notice!
import scala.math.pow | ||
import scala.util.{Failure, Success, Try} | ||
|
||
object GeoUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to re-introduce function signatures that are used in the old java classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed since we get rid of osmonauts data structures and we would have to reimplement the java code in scala we chose in that case to just get rid of it
import scala.math.pow | ||
import scala.util.{Failure, Success, Try} | ||
|
||
object GeoUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please!!!
Does it fully address #81 or only partially? |
Additionally: Would you mind adding a method to calculate the center of a way (doesn't have to be closed). For an example please refer to: |
Co-authored-by: Chris Kittl <[email protected]>
Co-authored-by: Chris Kittl <[email protected]>
# Conflicts: # CHANGELOG.md
This comment has been minimized.
This comment has been minimized.
I think the GeoUtils now are quite manageable in terms of size and content. Nevertheless one could argue to separate them further into something like |
# Conflicts: # CHANGELOG.md # src/main/java/edu/ie3/util/geo/GeoUtils.java # src/test/groovy/edu/ie3/util/geo/GeoUtilsTest.groovy
This comment has been minimized.
This comment has been minimized.
!test |
!test |
This comment has been minimized.
This comment has been minimized.
!test |
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
=============================================
+ Coverage 44.66% 59.13% +14.46%
+ Complexity 223 195 -28
=============================================
Files 27 25 -2
Lines 1350 876 -474
Branches 177 107 -70
=============================================
- Hits 603 518 -85
+ Misses 717 334 -383
+ Partials 30 24 -6 Continue to review full report at Codecov.
|
Resolves #163
Resolves #161
Partly adresses #81 (by moving some functionality to the RichGeometries)