Skip to content

reworked find isolated connection; fixed computation error on geometry#24

Merged
sventarika merged 1 commit intomainfrom
fix-map-segment-computation-error
Mar 20, 2026
Merged

reworked find isolated connection; fixed computation error on geometry#24
sventarika merged 1 commit intomainfrom
fix-map-segment-computation-error

Conversation

@sventarika
Copy link
Copy Markdown
Collaborator

Reworked find_isolated_connections
Changed how _compute_segment_polygon combines the lanes for improved performance.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Omega-Prime’s map segmentation logic by reworking how isolated lane connections are detected/merged into intersections and by changing how segment polygons are computed for improved performance and corrected geometry behavior.

Changes:

  • Bump project version to 0.3.0.
  • Update _compute_segment_polygon to buffer the combined lane centerlines directly and simplify the result before hull computation.
  • Rework find_isolated_connections and adjust init_intersections ordering so components that border exactly one intersection can be absorbed into it.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Version bump to 0.3.0.
omega_prime/mapsegment.py Simplifies segment polygon computation by buffering a MultiLineString and simplifying prior to hull.
omega_prime/maposicenterlinesegmentation.py Reorders intersection initialization and reworks isolated-connection classification/absorption logic.
docs/notebooks/tutorial_projections.ipynb Minor notebook source formatting change (newline removal).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 648 to +651
G = self.create_non_intersecting_lane_graph()
isolated_connections = []
new_connections = []
segment_name_type = type(next(iter(self.lane_segment_dict.values())))

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

segment_name_type = type(next(iter(self.lane_segment_dict.values()))) will raise StopIteration when lane_segment_dict is empty (e.g., recordings/maps with zero lanes). Consider deriving the SegmentName type without iterating values (e.g., define it once at class/init level and reuse), or guard with an early return when self.lane_segment_dict is empty.

Copilot uses AI. Check for mistakes.
@sventarika sventarika merged commit 240d8d6 into main Mar 20, 2026
14 checks passed
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