Skip to content

Conversation

@yamilbknsu
Copy link
Collaborator

This PR implements the functionality of computing edge bearings using the last line in the LineString geometry and refactors the serialization into csv/txt code to be a little cleaner.

This would be last remaining attribute in #57 , however, I noticed the speed by class mapping now returns speed for only 3 classes, which may be an indication that at some point we are filtering too much? I'll take a look to see if I find some bug.

closes #57

Copy link
Contributor

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 implements edge bearing computation from LineString geometries and refactors the serialization process for compass datasets. The bearing computation addresses the "headings" requirement mentioned in issue #57.

Changes:

  • Added bearing_deg_from_geometries function to compute bearings from the last two points in LineString geometries
  • Refactored serialization code by extracting common patterns into reusable serialize_into_csv and serialize_into_enumerated_txt functions in the util/fs module
  • Added bearings field to OmfEdgeList struct and corresponding serialization output

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
rust/bambam-omf/src/util/fs.rs Added generic serialization functions for CSV and enumerated text files with progress bars
rust/bambam-omf/src/graph/serialize_ops.rs Added bearing computation function using geo library's Haversine bearing calculation
rust/bambam-omf/src/graph/omf_graph.rs Integrated bearing computation into graph generation, refactored serialization to use new utility functions, and added filename constants

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Overture transportation import - edge attributes

2 participants