fix: ж/д — фильтр коротких сегментов <300 м (нарезка стрелок станции шумит карту)

This commit is contained in:
2026-09-09 13:22:12 +03:00
parent a15b1f42e9
commit 4531ac50b9
+4
View File
@@ -197,6 +197,10 @@ def _railway_geoms(elements: list[dict]) -> list[dict]:
if len(geometry) < 2: if len(geometry) < 2:
continue continue
length, lat, lon = _way_length_mid(geometry) length, lat, lon = _way_length_mid(geometry)
# Короткие обрезки путей (<300 м, нарезка по стрелкам внутри станции)
# шумны и не дают штабу полезной информации — пропускаем.
if length < 300:
continue
line = {'type': 'LineString', 'coordinates': [[p['lon'], p['lat']] for p in geometry]} line = {'type': 'LineString', 'coordinates': [[p['lon'], p['lat']] for p in geometry]}
out.append({'layer': 'railway', 'name': tags.get('name'), 'geom': line, out.append({'layer': 'railway', 'name': tags.get('name'), 'geom': line,
'length_m': length, 'lat': lat, 'lon': lon}) 'length_m': length, 'lat': lat, 'lon': lon})