Skip to content
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

Merged
merged 25 commits into from
Jan 11, 2022
Merged

To/#163 adapt geo utils #175

merged 25 commits into from
Jan 11, 2022

Conversation

t-ober
Copy link
Contributor

@t-ober t-ober commented Dec 9, 2021

Resolves #163
Resolves #161
Partly adresses #81 (by moving some functionality to the RichGeometries)

@t-ober t-ober requested a review from a team December 9, 2021 13:44
Copy link
Member

@sebastian-peter sebastian-peter left a 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 = {
Copy link
Member

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

Copy link
Member

@sebastian-peter sebastian-peter Dec 10, 2021

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

Copy link
Member

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.

Copy link
Contributor Author

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 {
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please!!!

Copy link
Contributor Author

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

CHANGELOG.md Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/util/geo/CoordinateDistance.scala Outdated Show resolved Hide resolved
import scala.math.pow
import scala.util.{Failure, Success, Try}

object GeoUtils {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please!!!

src/main/scala/edu/ie3/util/geo/RichGeometries.scala Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/util/geo/RichGeometries.scala Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/util/geo/RichGeometries.scala Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/util/osm/OsmUtils.scala Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/util/osm/OsmUtils.scala Outdated Show resolved Hide resolved
@ckittl
Copy link
Member

ckittl commented Jan 4, 2022

Does it fully address #81 or only partially?

@ckittl
Copy link
Member

ckittl commented Jan 4, 2022

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:

https://github.com/ie3-institute/OSMoGrid/blob/9ab12398b792060b0371eec62e8d07fa5d13dc54/src/main/scala/edu/ie3/osmogrid/model/WayUtils.scala#L62-L71

@ckittl ckittl mentioned this pull request Jan 6, 2022
@sonarqubegithubprchecks

This comment has been minimized.

@t-ober
Copy link
Contributor Author

t-ober commented Jan 7, 2022

Does it fully address #81 or only partially?

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 CoordinateUtils, LineUtils and AreaUtils so I will keep the issue open

@t-ober t-ober added this to the Version 2.0 milestone Jan 7, 2022
@t-ober t-ober added the enhancement New feature or request label Jan 7, 2022
# Conflicts:
#	CHANGELOG.md
#	src/main/java/edu/ie3/util/geo/GeoUtils.java
#	src/test/groovy/edu/ie3/util/geo/GeoUtilsTest.groovy
@sonarqubegithubprchecks

This comment has been minimized.

@t-ober
Copy link
Contributor Author

t-ober commented Jan 10, 2022

!test

@t-ober t-ober closed this Jan 10, 2022
@t-ober t-ober reopened this Jan 10, 2022
@t-ober
Copy link
Contributor Author

t-ober commented Jan 10, 2022

!test

@sonarqubegithubprchecks

This comment has been minimized.

@t-ober
Copy link
Contributor Author

t-ober commented Jan 10, 2022

!test

@sonarqubegithubprchecks

This comment has been minimized.

@sonarqubegithubprchecks
Copy link

Passed

Analysis Details

0 Issues

  • Bug0 Bugs
  • Vulnerability0 Vulnerabilities
  • Code Smell0 Code Smells

Coverage and Duplications

  • No coverage informationNo coverage information (52.80% Estimated after merge)
  • 3 percent duplication0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: edu.ie3:utils

View in SonarQube

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #175 (df62d17) into master (02a345c) will increase coverage by 14.46%.
The diff coverage is n/a.

Impacted file tree graph

@@              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     
Impacted Files Coverage Δ
...ls/src/main/java/edu/ie3/util/EmpiricalRandom.java 75.86% <0.00%> (ø)
...utils/src/main/java/edu/ie3/util/geo/GeoUtils.java
...main/java/edu/ie3/util/geo/CoordinateDistance.java

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5cce3b...df62d17. Read the comment docs.

@t-ober t-ober requested a review from ckittl January 10, 2022 08:11
@ckittl ckittl merged commit 40aaa02 into master Jan 11, 2022
@ckittl ckittl deleted the to/#163-adapt-geo-utils branch January 11, 2022 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants