Skip to content

Commit

Permalink
Remove time-restricted paths (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMatthes authored May 22, 2024
1 parent 64d9e4e commit 3aacc59
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions converter/drn_transform.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import datetime
import re

import logging
import re
import subprocess
from collections import defaultdict
from typing import List, Set, Tuple

from epsg_converter import Converter
from lxml import etree
from lxml.etree import Element

from epsg_converter import Converter
from mapping import *
from utils import get_bool_variable, haversine

Expand Down Expand Up @@ -193,6 +191,19 @@ def parse_element(self, feature: Element):

self._parse_geometry(way, feature)

# Check if we need to skip this feature first.
for element in feature:
if "zeitbeschraenkung" in element.tag:
# If the element contains a time restriction, we need to throw it away.
# GraphHopper supports time restrictions through the oneway:conditional tag,
# but only for date ranges, not for time ranges. Furthermore, it may take
# the user some time to arrive at this way, meaning that the time restriction
# is much more complex and would need a lot of additional work to be implemented.
# Due to this reason, we decide to throw away the element.
# See https://github.com/priobike/priobike-graphhopper-drn/issues/17
logger.warning(f"Discarding time-restricted way: {way.attrib['id']}")
return

for element in feature:
if "status" in element.tag:
pass
Expand Down Expand Up @@ -241,10 +252,6 @@ def parse_element(self, feature: Element):
elif "benutzungspflicht" == element.tag:
# todo detect traffic sign from it
pass
elif "zeitbeschraenkung" == element.tag:
# could check if in combination with time restricted fußgängerzone - would require standardized
# time-format to be feasible
pass

# the following remaining attributes are redundant and/or don't add new relevant information
# mofa_frei: is not relevant
Expand Down

0 comments on commit 3aacc59

Please sign in to comment.