Skip to content

Commit

Permalink
Merge pull request #4215 from hove-io/fix_poi2asgard_when_poi_are_mis…
Browse files Browse the repository at this point in the history
…sing

fix when poi are missing and install aws
  • Loading branch information
xlqian authored Feb 12, 2024
2 parents f779528 + f90d891 commit 69282c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docker/debian10/Dockerfile-tyr-worker
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ RUN apt-get update \
./mimirsbrunn7_buster-*.deb ./cosmogony2cities*.deb



RUN apt install -y --force-yes unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install

# install tyr requirements
RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt

Expand Down
6 changes: 6 additions & 0 deletions docker/debian8/Dockerfile-tyr-worker
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ RUN rm navitia-common_*deb \
# install tyr requirements
RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt

RUN apt install -y --force-yes unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install


EXPOSE 5000


Expand Down
11 changes: 8 additions & 3 deletions source/tyr/tyr/poi_to_excluded_zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


def poi_to_excluded_zones(poi_file, output_dir, instance_name):
logger = logging.getLogger(__name__)

tmp_path = "tmp/poi_{}".format(instance_name)
import zipfile

Expand All @@ -31,9 +33,9 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name):
excluded_geometries_ids[row[0]] = row[7]

if excluded_geometries_ids.keys() != excluded_zones.keys():
logger.error("not all excluded zone's pois are found in poi.txt")
logger.error("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys()))
logger.error("excluded_zones: {}".format(excluded_zones.keys()))
logger.warning("not all excluded zone's pois are found in poi.txt")
logger.warning("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys()))
logger.warning("excluded_zones: {}".format(excluded_zones.keys()))

# read geometries
geometries_shapes = {}
Expand All @@ -46,9 +48,12 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name):
geometry_id = excluded_geometries_ids.get(poi_id)
if not geometry_id:
logger.error("{} could not be found in poi.txt".format(row[0]))
continue

shape = geometries_shapes.get(geometry_id)
if not shape:
logger.error("{} could not be found in geometries.txt".format(geometry_id))
continue

for i, zone in enumerate(zones):
output_id = "{}_{}_{}".format(poi_id, i, instance_name)
Expand Down

0 comments on commit 69282c6

Please sign in to comment.