Skip to content

Add entrances to parking lots that are unconnected in OSM - #4666

Merged
leonardehrenfried merged 8 commits into
opentripplanner:dev-2.xfrom
mfdz:link-parking
Dec 15, 2022
Merged

leonardehrenfried merged 8 commits into
opentripplanner:dev-2.xfrom
mfdz:link-parking

Conversation

@leonardehrenfried

@leonardehrenfried leonardehrenfried commented Dec 9, 2022 •

Copy link
Copy Markdown
Member

Summary

Right now if a parking area is not linked to the street network OTP discards it. However, it's a pretty common occurrence that no entrance ways are mapped.

This PR adds an artificial entrance vertex if none exists in OSM and then lets the street linker do the link to the centroid of the parking facility.

If it turns out that this is an unwanted default I can add a build config parameter.

Issue

Closes #1562

Unit tests

Added.

@leonardehrenfried
leonardehrenfried requested a review from a team as a code owner December 9, 2022 11:53
@leonardehrenfried leonardehrenfried added the !Improvement A functional improvement or micro feature label Dec 9, 2022
@leonardehrenfried leonardehrenfried changed the title Add entrances to parking lot that are unconnected in OSM Add entrances to parking lots that are unconnected in OSM Dec 9, 2022
@leonardehrenfried leonardehrenfried added the X Bbnavi ~ Not in use any more ~ label Dec 9, 2022
@leonardehrenfried

Copy link
Copy Markdown
Member Author

cc @hbruch

@optionsome optionsome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At least for me, this feels like a generic improvement so I don't think this needs to be put behind a configuration parameter

@codecov-commenter

codecov-commenter commented Dec 9, 2022 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 60.87%. Comparing base (0dddb0e) to head (53c2ae9).
Report is 7238 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...ripplanner/graph_builder/module/osm/AreaGroup.java 33.33% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4666      +/-   ##
=============================================
- Coverage      60.89%   60.87%   -0.03%     
- Complexity     12327    12337      +10     
=============================================
  Files           1594     1594              
  Lines          63761    63828      +67     
  Branches        6998     6999       +1     
=============================================
+ Hits           38827    38855      +28     
- Misses         22753    22795      +42     
+ Partials        2181     2178       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t2gran t2gran added this to the 2.3 milestone Dec 13, 2022
hannesj
hannesj previously approved these changes Dec 14, 2022
Co-authored-by: Hannes Junnila <hannes.junnila@gmail.com>
OSMWithTags entity,
boolean isCarPark
) {
var geoms = group.areas.stream().map(a -> a.jtsMultiPolygon).toArray(Geometry[]::new);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could store u as geometry or something similar for the AreaGroup here, and not need to recompute it again.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't AreaGroups end up in the graph so this would increase memory, wouldn't it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, AreaGroups is not part of the graph

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

They are used only for the input parameter for ParkingProcessor and in buildWalkableAreas.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've implemented it. Did you want to store the multipolygon or the union of it?

@leonardehrenfried
leonardehrenfried merged commit 119c3e7 into opentripplanner:dev-2.x Dec 15, 2022
t2gran pushed a commit that referenced this pull request Dec 15, 2022
@leonardehrenfried
leonardehrenfried deleted the link-parking branch February 21, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Improvement A functional improvement or micro feature X Bbnavi ~ Not in use any more ~

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete support for parking cars (P+R)

5 participants