diff --git a/map_machine/osm/osm_getter.py b/map_machine/osm/osm_getter.py index 86e5192..a970314 100644 --- a/map_machine/osm/osm_getter.py +++ b/map_machine/osm/osm_getter.py @@ -22,7 +22,7 @@ class NetworkError(Exception): def get_osm( - boundary_box: BoundaryBox, cache_file_path: Path, to_update: bool = False + boundary_box: BoundaryBox, cache_file_path: Path, to_update: bool = False, proxy = None ) -> str: """ Download OSM data from the web or get if from the cache. @@ -30,6 +30,7 @@ def get_osm( :param boundary_box: borders of the map part to download :param cache_file_path: cache file to store downloaded OSM data :param to_update: update cache files + :param proxy: specify proxy used while downloading """ if not to_update and cache_file_path.is_file(): with cache_file_path.open(encoding="utf-8") as output_file: diff --git a/map_machine/slippy/tile.py b/map_machine/slippy/tile.py index 454fcb1..77c4bf9 100644 --- a/map_machine/slippy/tile.py +++ b/map_machine/slippy/tile.py @@ -104,7 +104,7 @@ def load_osm_data(self, cache_path: Path) -> OSMData: cache_file_path: Path = ( cache_path / f"{self.get_extended_boundary_box().get_format()}.osm" ) - get_osm(self.get_extended_boundary_box(), cache_file_path) + get_osm(self.get_extended_boundary_box(), cache_file_path, proxy=proxy) osm_data: OSMData = OSMData() osm_data.parse_osm_file(cache_file_path) @@ -256,7 +256,7 @@ def load_osm_data(self, cache_path: Path) -> OSMData: cache_file_path: Path = ( cache_path / f"{self.boundary_box.get_format()}.osm" ) - get_osm(self.boundary_box, cache_file_path) + get_osm(self.boundary_box, cache_file_path, proxy=proxy) osm_data: OSMData = OSMData() osm_data.parse_osm_file(cache_file_path)