Summary
The shortestPath function returns different results depending on the unit used to specify the resolution. For example, {resolution: 0.0001, units: 'kilometers'} leads to a different result than {resolution: 10, units: 'centimeters'}. The reason for this is the created point grid for the A* algorithm. In addition, the spacing between the points in the grid differs from the specified resolution.
Example
Example 1:
- For
{resolution: 0.0001, units: 'kilometers'}
GeoJSON file: grid_10cm_in_km.json
Example 2:
- For
{resolution: 10, units: 'centimeters'}
GeoJSON file: grid_10cm_in_cm.json
Version
I tested this with @turf/shortest-path version 7.2.0
Note
I’d be happy to provide a pull request for this.
Summary
The
shortestPathfunction returns different results depending on the unit used to specify the resolution. For example,{resolution: 0.0001, units: 'kilometers'}leads to a different result than{resolution: 10, units: 'centimeters'}. The reason for this is the created point grid for the A* algorithm. In addition, the spacing between the points in the grid differs from the specified resolution.Example
Example 1:
{resolution: 0.0001, units: 'kilometers'}GeoJSON file: grid_10cm_in_km.json
Example 2:
{resolution: 10, units: 'centimeters'}GeoJSON file: grid_10cm_in_cm.json
Version
I tested this with
@turf/shortest-pathversion7.2.0Note
I’d be happy to provide a pull request for this.