Add LIFECYCLE filtering, street exceptions UI, address matching improvements, map viewer fixes

This commit is contained in:
zyphlar
2026-04-09 09:36:14 -07:00
parent 449a182fa4
commit e8267b1eee
10 changed files with 544 additions and 33 deletions
+15 -6
View File
@@ -13,15 +13,9 @@ TODO:
- ignore points outside of lines
- put properties properly on removed roads, so they're visible in JOSM
- handle polygons properly (on previous geojson step?) for circular roads
- ignore roads that aren't LIFECYCLE ACTV or Active
- include OneWay=Y
- handle C 44a -> County Road 44A
- handle Tpke -> Turnpike
- handle Trce -> Trace/Terrace?
- handle Cor -> Corner
- handle Obrien -> O'Brien
- handle Oday -> O'Day
- Ohara -> O'Hara
"""
import json
@@ -461,6 +455,21 @@ class RoadComparator:
# Filter unnamed features from file1 (OSM data) if exclude_unnamed is set
gdf1 = self.load_geojson(file1_path, filter_unnamed=self.exclude_unnamed)
gdf2 = self.load_geojson(file2_path)
# Filter county data (gdf2) to active/current roads only.
# Sumter uses LIFECYCLE='ACTV'. Lake has no lifecycle field — skip silently.
LIFECYCLE_FIELD = 'LIFECYCLE'
ACTIVE_VALUES = {'ACTV', 'Active', 'ACTIVE', 'Current', 'CURRENT'}
if LIFECYCLE_FIELD in gdf2.columns:
before = len(gdf2)
gdf2 = gdf2[gdf2[LIFECYCLE_FIELD].isin(ACTIVE_VALUES)].copy().reset_index(drop=True)
filtered = before - len(gdf2)
if filtered:
print(f"Filtered out {filtered} non-active county roads (LIFECYCLE not in {ACTIVE_VALUES})")
else:
print(f"All {len(gdf2)} county roads are active (LIFECYCLE={gdf2[LIFECYCLE_FIELD].iloc[0] if len(gdf2) else 'n/a'})")
else:
print(f"Note: county data has no {LIFECYCLE_FIELD!r} field — no lifecycle filtering applied")
# Ensure both are in the same CRS
if gdf1.crs != gdf2.crs: