feature/9528-extend-sections-and-tracks-with-optional-geo-coordinates#831
Merged
schubsen merged 109 commits intoMay 26, 2026
Merged
Conversation
Covers Detection interface, parser layer, Polars DataFrame segment propagation, linear geo interpolation at intersections, Event fields, and event list CSV export. Section geo coordinates are deferred.
…olumns present Add START_GEO_X, START_GEO_Y, END_GEO_X, END_GEO_Y constants to track_dataset.py and conditionally include them in the create_track_segments output when both GEO_X and GEO_Y columns are present in the input DataFrame.
Adds GEO_X/GEO_Y constants to event_list.py and updates EventListDataFrameBuilder to append geo coordinate columns to the exported DataFrame only when events carry numeric geo values. Also guards _round() against non-numeric (all-None) columns.
…track files When multiple ottrk files are loaded, add_all's .select(COLUMNS) dropped geo_x/geo_y because they were absent from the COLUMNS constant. This caused geometry datasets created for a changed section offset to be built from a DataFrame without geo columns, so geo coordinate interpolation was silently skipped. The original offset's geometry (cached before the second file load) still worked, making the bug appear only on offset changes. Fix: collect geo columns that exist in both DataFrames and include them in the select, so merging two geo-tagged files preserves geo data end-to-end.
…acks Fusion ottrk files (e.g. OTFusion outputs) have w=0, h=0 for all detections. The RelativeOffsetCoordinate formula multiplies by w/h, so the offset evaluates to zero — intentional, as a relative offset is undefined for point detections with no bounding box.
…adata is available
Log at DEBUG level whether events are being created with geo coordinates (OTFusion fusion tracks) or image coordinates (standard tracks).
Propagate geo_x/geo_y through segment creation so that get_first_segments() and get_last_segments() carry start_geo_x/start_geo_y and end_geo_x/end_geo_y when the underlying dataset has geo columns present.
…s field-storing override
…aset.with_georeference_metadata
…, revert_cuts_for, remove_by_original_ids, cut_with_section, and _subset_by_ids
…ath in lifecycle tests
…atch construction consistency
randy-seng
commented
May 18, 2026
…me_empty_input_preserves_georeference_metadata
…ropping them Previously, merging datasets where only some had geo coordinates silently discarded geo data from the files that did have it. Now both merge_all and add_all preserve geo columns by null-padding whichever side lacks them. The use_geo gate in wrap_intersection_points is updated to require null-free geo columns (not just column presence), so null-padded datasets correctly fall back to image-space intersection. A new dataset_has_complete_geo_values helper captures this completeness check for use by callers.
…rve null-geo segments drop_nulls() without a subset dropped every row where any column was null, including segments from null-padded tracks (geo columns present but null). This caused tracks without geo data in a mixed dataset to have zero segments in the geometry store, making them invisible to intersection detection. Restrict the drop to the non-geo shifted columns whose nulls exclusively mark the first (incomplete) detection row of each track.
…reation Adds debug/info log messages indicating whether geo or image coordinates are selected when detecting intersections and when creating section events.
… adapters Introduce TrackDatasetCsvWriter protocol with Polars, Pandas, and domain fallback implementations behind a ResolvingTrackDatasetCsvWriter. CsvTrackExport now delegates CSV writing entirely to the injected writer instead of branching on dataset implementation types.
…port Adds start_geo_x/y and end_geo_x/y from section events to the road user assignment export. Columns are omitted when all values are null to avoid cluttering output for datasets without geo data.
…-optional-geo-coordinates
schubsen
approved these changes
May 26, 2026
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.
PR Description
Summary
Extends track, section, and event processing to support optional geo coordinates while preserving existing image-coordinate behavior for datasets without complete geo data.
Changes
PolarsTrackDataset.merge_allfor efficient bulk dataset concatenation.Notes
OP#9528
OP#9529
OP#9530