r2gg 2.2.4__py3-none-any.whl → 2.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
r2gg/__about__.py CHANGED
@@ -34,7 +34,7 @@ __uri_repository__ = "https://github.com/IGNF/route-graph-generator/"
34
34
  __uri_tracker__ = f"{__uri_repository__}issues/"
35
35
  __uri__ = __uri_repository__
36
36
 
37
- __version__ = "2.2.4"
37
+ __version__ = "2.2.5"
38
38
  __version_info__ = tuple(
39
39
  [
40
40
  int(num) if num.isdigit() else num
r2gg/_main.py CHANGED
@@ -407,16 +407,20 @@ def valhalla_convert(config, resource, logger, build_lua_from_cost_config = True
407
407
  start_command = time.time()
408
408
  valhalla_build_config_args = ["valhalla_build_config",
409
409
  "--mjolnir-tile-dir", source["storage"]["dir"],
410
- "--mjolnir-tile-extract", source["storage"]["tar"]]
410
+ "--mjolnir-tile-extract", source["storage"]["tar"],
411
+ # Modification des limites par défaut du service : 10h pour isochrone et 1000km pour iso distance
412
+ # contre 2h et 200km par défaut
413
+ "--service-limits-isochrone-max-time-contour", "600",
414
+ "--service-limits-isochrone-max-distance-contour", "1000",
415
+ # Ajout de l'autorisation à exclure les ponts/tunnels/péages
416
+ "--service-limits-allow-hard-exclusions", "True"]
411
417
  subprocess_execution(valhalla_build_config_args, logger, outfile = source["storage"]["config"])
412
418
  # Nécessaire le temps que le fichier s'écrive...
413
419
  time.sleep(1)
414
- # Ajout du graph custom dans la config valhalla
420
+ # Ajout du graph custom dans la config valhalla (impossible via les paramètres du build_config)
415
421
  with open(source["storage"]["config"], "r") as valhalla_config:
416
422
  config_dict = json.load(valhalla_config)
417
423
  config_dict["mjolnir"]["graph_lua_name"] = source["costs"][0]["compute"]["storage"]["file"]
418
- # Ajout de l'autorisation à exclure les ponts/tunnels/péages
419
- config_dict["service_limits"]["allow_hard_exclusions"] = True
420
424
 
421
425
  with open(source["storage"]["config"], "w") as valhalla_config:
422
426
  valhalla_config.write(json.dumps(config_dict))
@@ -14,7 +14,8 @@ def subprocess_execution(args, logger, outfile = None):
14
14
  """
15
15
  try:
16
16
  str_args = [str(arg) for arg in args]
17
- logger.info('Subprocess: \"' + " ".join(str_args) + '\"')
17
+ subprocess_arg = " ".join(str_args)
18
+ logger.info('Subprocess: \"' + subprocess_arg + '\"')
18
19
  if outfile is not None:
19
20
  with open(outfile, "w") as out:
20
21
  process = subprocess.Popen(
@@ -32,6 +33,12 @@ def subprocess_execution(args, logger, outfile = None):
32
33
  process_output, _ = process.communicate()
33
34
  logger.info(process_output.decode("utf-8"))
34
35
 
36
+ returncode = process.returncode
37
+ if process.returncode != 0:
38
+ error_msg = f"Invalid returncode {returncode} for subprocess '{subprocess_arg}'"
39
+ logger.error(error_msg)
40
+ raise RuntimeError(error_msg)
41
+
35
42
 
36
43
  except (OSError, subprocess.CalledProcessError) as exception:
37
44
  logger.info('Exception occured: ' + str(exception))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: r2gg
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Route Graph Generator (r2gg) est un script Python qui permet la génération de graphes pour des moteurs de calcul d'itinéraire
5
5
  Home-page: https://github.com/IGNF/route-graph-generator/
6
6
  Author: IGNF
@@ -1,9 +1,9 @@
1
- r2gg/__about__.py,sha256=IOi0KlcCPM3ro_qhu9tIT517bTch6l7hzdj_3mokP-k,1343
1
+ r2gg/__about__.py,sha256=Ite9kzvRtV8_PUbjmNiaJAw9qbF-UTbrnuJdaZbF3T4,1343
2
2
  r2gg/__init__.py,sha256=zERkbHrNMbNZleuOxsfA7afQExXxpP7-IWVP1IFzNNs,88
3
3
  r2gg/_configure.py,sha256=5kNElkBGKR2vmSBNTJtaLPuLNDIiNOsTIGnoA80qzKg,3914
4
4
  r2gg/_file_copier.py,sha256=NzDd6ZqxQsQ_EulXg6jZxECUMjlJ0VBtr40-c1Rde-w,578
5
5
  r2gg/_lua_builder.py,sha256=NnTDppU-RFsG9ztcICbPVydGE1KciSyvpvOu-GPQmJQ,10249
6
- r2gg/_main.py,sha256=_xmZalO9ZFAUcM8UbSx46at-7r4jjd4x2yjI9nLt_lw,21592
6
+ r2gg/_main.py,sha256=r2wOXvZLOp8VR6XF4rS37PVOGZ5MvFyYH0j0VytuI4g,21922
7
7
  r2gg/_osm_building.py,sha256=MFFY3EYOVO4rPsYk90Oda70KH1DKW2rlRj8XT4Vx_4U,4227
8
8
  r2gg/_osm_to_pbf.py,sha256=ZCGaqao4r2xkwIvKjQSOBd7TVXzO_KDAT2PptnCuAoY,1088
9
9
  r2gg/_output_costs_from_costs_config.py,sha256=g7Qy4tlUIOA7DJcwXW9ZxhcOJ5Srq1c8hufylI2e0m8,6208
@@ -12,12 +12,12 @@ r2gg/_pivot_to_osm.py,sha256=sE9q29-C_E5rgZsV7CmQIlG67tEMZRgt4yqUC9FeTGo,8202
12
12
  r2gg/_pivot_to_pgr.py,sha256=CWTWnzIWXUMFSneMa_qiEkhc1Bx2s_RxL7l-CWBR6GM,17226
13
13
  r2gg/_read_config.py,sha256=VQ6d6Oi1aKHwwURA3KrbpWHK0zP18aJ98XQJiHZb8oI,721
14
14
  r2gg/_sql_building.py,sha256=DefYIerZ0k_yltgJFaSzTXAZPSSUH7WAxN3d5FceoWw,840
15
- r2gg/_subprocess_execution.py,sha256=tNTqEEjG-zmf8TZwa35V6BNcyKXaZfjHjMQmgh8DTns,1245
15
+ r2gg/_subprocess_execution.py,sha256=NcH3wTwaeOIWA4huSunhnp0qqCkpU6wbHV1w_xqj3C8,1533
16
16
  r2gg/_valhalla_lua_builder.py,sha256=vNUnsu4yYQflnNv49-ElxrfIqa4b30vJP740ab7M7rY,13816
17
17
  r2gg/cli.py,sha256=2QM7pzvh-iz0kqNsPFtnDiCVAwn63o4GEQK4QwCcgSc,2894
18
- r2gg-2.2.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
- r2gg-2.2.4.dist-info/METADATA,sha256=7iByoVlOjV5i2jiNGgha85BAFxxSc4ChIsVO_TwLMH0,5013
20
- r2gg-2.2.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
21
- r2gg-2.2.4.dist-info/entry_points.txt,sha256=Km7XbbcVI9jy1TQI0raQfRyKdNGAUIwVkkBG5YeQP4k,275
22
- r2gg-2.2.4.dist-info/top_level.txt,sha256=fj9IaWXORCdMRcnWWZ7LmvOG4W_sVH8J4BUWf1pM37c,5
23
- r2gg-2.2.4.dist-info/RECORD,,
18
+ r2gg-2.2.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
19
+ r2gg-2.2.5.dist-info/METADATA,sha256=_QAvaf9Q46IrVy9mFX7pEqcXg4jDAtlNsem5vi_PHZg,5013
20
+ r2gg-2.2.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
21
+ r2gg-2.2.5.dist-info/entry_points.txt,sha256=Km7XbbcVI9jy1TQI0raQfRyKdNGAUIwVkkBG5YeQP4k,275
22
+ r2gg-2.2.5.dist-info/top_level.txt,sha256=fj9IaWXORCdMRcnWWZ7LmvOG4W_sVH8J4BUWf1pM37c,5
23
+ r2gg-2.2.5.dist-info/RECORD,,
File without changes
File without changes