Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented limit of 10 isochrone ranges (KeyError: 10) #264

Open
Erudition opened this issue May 31, 2024 · 2 comments · May be fixed by #265
Open

Undocumented limit of 10 isochrone ranges (KeyError: 10) #264

Erudition opened this issue May 31, 2024 · 2 comments · May be fixed by #265

Comments

@Erudition
Copy link

Erudition commented May 31, 2024

Example: Generating an isochrone heatmap for driving distance from Compressed Natural Gas stations in North America. Ideally I want 10,20,30...150 mile increments.

Here's what I did

QGIS version: 3.30.1-'s-Hertogenbosch
Qt version: 5.15.10
Python version: 3.10.7
GDAL version: 3.6.1
GEOS version: 3.12.1-CAPI-1.18.1
PROJ version: Rel. 9.3.1, December 1st, 2023
Algorithm started at: 2024-05-30T23:49:27
Algorithm 'Isochrones from Point-Layer' starting…
Input parameters:
{ 'INPUT_AVOID_BORDERS' : None, 'INPUT_AVOID_COUNTRIES' : '', 'INPUT_AVOID_FEATURES' : [], 'INPUT_AVOID_POLYGONS' : None, 'INPUT_FIELD' : 'ID', 'INPUT_METRIC' : 1, 'INPUT_POINT_LAYER' : QgsProcessingFeatureSourceDefinition('file:///home/adroit/Downloads/alt_fuel_stations%20(May%2030%202024).csv?type=csv&maxFields=10000&detectTypes=yes&xField=Longitude&yField=Latitude&crs=EPSG:4326&spatialIndex=no&subsetIndex=no&watchFile=no', selectedFeaturesOnly=True, featureLimit=-1, flags=QgsProcessingFeatureSourceDefinition.FlagOverrideDefaultGeometryCheck | QgsProcessingFeatureSourceDefinition.FlagCreateIndividualOutputPerInputFeature, geometryCheck=QgsFeatureRequest.GeometrySkipInvalid), 'INPUT_PROFILE' : 0, 'INPUT_PROVIDER' : 0, 'INPUT_RANGES' : '16093,\n32187,\n48280,\n64374,\n80467,\n96561, 112654,\n128748,\n144841,\n160934, 177028', 'INPUT_SMOOTHING' : 0, 'LOCATION_TYPE' : 1, 'OUTPUT' : '/media/adroit/Extreme SSD/Mapping/station-isochrones-bottom-only-allmiles.gpkg' }

Executing iteration 1/166…

Here's what I got

Traceback (most recent call last):
File "/home/adroit/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/proc/isochrones_layer_proc.py", line 218, in postProcessAlgorithm
self.isochrones.stylePoly(processed_layer)
File "/home/adroit/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/common/isochrones_core.py", line 208, in stylePoly
color=colors[cid], strokeColor=QColor("#000000")
KeyError: 10

This appears on every iteration, so long as there is more than 10 ranges in the range field. It does not occur when there is less than 10.


Here's what I was expecting

The isochrones to be generated for 11+ ranges the same way it works fine for 10 or less.


Here's what I think could be improved

  • Okay: add this limitation to the documentation
  • Good: improve the error message, say exactly what went wrong
  • Better: Enforce the limit in the UI, don't let more than 10 ranges be entered in the textbox
  • Best: Remove the limitation, which seems to have something to do with code trying to pick default colors for the 11th (index 10) isochrone and up
@merydian
Copy link
Collaborator

Hi, the interval limitation is documented under: https://openrouteservice.org/restrictions/ . Yet, as you imply, the error logging can be improved and there seems to be an inconsistency with the naming for ranges/intervals. So thanks for posting about this. We'll look into it.

@Erudition
Copy link
Author

Thanks! I'm running ORS locally, since my project doesn't fit within those restrictions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants