Add OSM Track Harvesting Policy and demo database initialization script
- Updated documentation to include OSM Track Harvesting Policy with details on railway types, service filters, usage filters, and geometry guardrails. - Introduced a new script `init_demo_db.py` to automate the database setup process, including environment checks, running migrations, and loading OSM fixtures for demo data.
This commit is contained in:
@@ -67,3 +67,44 @@ def test_normalize_track_elements_marks_oneway_and_status() -> None:
|
||||
track = tracks[0]
|
||||
assert track["status"] == "disused"
|
||||
assert track["isBidirectional"] is False
|
||||
|
||||
|
||||
def test_normalize_track_elements_skips_service_tracks() -> None:
|
||||
elements = [
|
||||
{
|
||||
"type": "way",
|
||||
"id": 77,
|
||||
"geometry": [
|
||||
{"lat": 52.5000, "lon": 13.4000},
|
||||
{"lat": 52.5010, "lon": 13.4010},
|
||||
],
|
||||
"tags": {
|
||||
"railway": "rail",
|
||||
"service": "yard",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
tracks = tracks_import.normalize_track_elements(elements)
|
||||
|
||||
assert tracks == []
|
||||
|
||||
|
||||
def test_normalize_track_elements_skips_short_tracks() -> None:
|
||||
elements = [
|
||||
{
|
||||
"type": "way",
|
||||
"id": 81,
|
||||
"geometry": [
|
||||
{"lat": 52.500000, "lon": 13.400000},
|
||||
{"lat": 52.500100, "lon": 13.400050},
|
||||
],
|
||||
"tags": {
|
||||
"railway": "rail",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
tracks = tracks_import.normalize_track_elements(elements)
|
||||
|
||||
assert tracks == []
|
||||
|
||||
Reference in New Issue
Block a user