0

I am using QGIS 3.10.

I have a dataset with coordinates of many households. Separately I have coordinates of a number of sites. For each of these households, I need to calculate:

  1. Which is their closest site by car
  2. What is the distance to their closest site by car

Essentially I need to an equivalent of 'Distance to nearest hub' Vector Analysis, but not as the crow flies. I need car distances.

I tried plugin ORS Tools. I got the API key, but I cannot get it to work. There is an error everytime:

Traceback (most recent call last):
File "/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ORStools/proc/directions_points_layers_proc.py", line 248, in processAlgorithm
destination_field
File "Application Support/QGIS/QGIS3/profiles/default/python/plugins/ORStools/proc/directions_points_layers_proc.py", line 327, in _get_route_dict
geometries=[xformer_destination.transform(feat.geometry().asPoint()) for feat in destination_feats],
File "Application Support/QGIS/QGIS3/profiles/default/python/plugins/ORStools/proc/directions_points_layers_proc.py", line 327, in <listcomp>
geometries=[xformer_destination.transform(feat.geometry().asPoint()) for feat in destination_feats],
ValueError: Null geometry cannot be converted to a point.

Execution failed after 0.23 seconds

I don't have to stick with ORS Tools. Is there any solution to do this calculation over many houses?

3
  • Please check geometries of your layers with for example Geometry Checker Plugin. Does it evoke some insufficiencies?
    – Taras
    Nov 19, 2020 at 18:01
  • Thank you! Just checked. It provides me with the following: Execution completed in 0.26 seconds Results: {'ERROR_COUNT': 0, 'ERROR_OUTPUT': 'Error_output_907ffd3d_725c_4f33_bae7_73d3fd4030c6', 'INVALID_COUNT': 0, 'INVALID_OUTPUT': 'Invalid_output_74294d3a_6dbe_401f_b7b3_d8f92cff1b2b', 'VALID_COUNT': 1925, 'VALID_OUTPUT': 'Valid_output_84e43123_bd7e_4fc2_ac0b_d839ed299418'} Loading resulting layers Algorithm 'Check validity' finished I guess this means there's nothing wrong with my layers?
    – Jade
    Nov 19, 2020 at 18:11
  • I think there is a way to do this using the Google Maps / Routing API... there are academic 'consultants' for DPS that perform bus stop matrix routing problems. Otherwise, we use postgresql/postgis to do this with students and schools. Nov 20, 2020 at 0:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.