Compute bearings from OMF transportation and refactor of serialization process#81
Merged
yamilbknsu merged 8 commits intomainfrom Jan 30, 2026
Merged
Compute bearings from OMF transportation and refactor of serialization process#81yamilbknsu merged 8 commits intomainfrom
yamilbknsu merged 8 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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_geometriesfunction to compute bearings from the last two points in LineString geometries - Refactored serialization code by extracting common patterns into reusable
serialize_into_csvandserialize_into_enumerated_txtfunctions in theutil/fsmodule - Added bearings field to
OmfEdgeListstruct 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>
robfitzgerald
approved these changes
Jan 30, 2026
Collaborator
robfitzgerald
left a comment
There was a problem hiding this comment.
let's just roll this one in. thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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