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

JTS geometries in Place #50

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

tobsesHub
Copy link
Contributor

@tobsesHub tobsesHub commented Jun 20, 2024

JTS geometries in Place

context

On the LegGeometry we added methods, to get JTS LineStrings. To be consistent, it's good to add such methods in places(JTS Point, Geometry).

Description

  • This PR adds methods to get coordinates or points as JTS models from a Place object.
  • also added tests for transit legs properties, which do not depend on the JTS changes.

@tobsesHub tobsesHub changed the title Jts geometry JTS geometries in Place Jun 20, 2024
@tobsesHub
Copy link
Contributor Author

tobsesHub commented Jun 20, 2024

I can also change the Place record as an abstract class. I'm not sure, if that would have any advantages in this case.

@leonardehrenfried
Copy link
Member

leonardehrenfried commented Jun 21, 2024

This is PR is fine.

If you want to invest the time it would be great if you could refactor the place to be a sealed interface with several implementations. Are you interested in doing that? You'd probably have to write a bit of logic into the parser to figure out what type it is.

@leonardehrenfried
Copy link
Member

You could also do that in a separate PR.

@tobsesHub
Copy link
Contributor Author

This is PR is fine.

If you want to invest the time it would be great if you could refactor the place to be a sealed interface with several implementations. Are you interested in doing that? You'd probably have to write a bit of logic into the parser to figure out what type it is.

That's a nice idea. Yes, I can do that. I would prefer, to do this in a separate PR.

@leonardehrenfried leonardehrenfried merged commit 7caabbc into opentripplanner:main Jun 24, 2024
1 check passed
@tobsesHub tobsesHub deleted the jts-geometry branch June 24, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants