mad-science@ricepo
This package can compute isodistance polygons based on driving distance.
$ git clone git@github.com:ricepo/isodist.git
$ cd isodist
$ npm install
In order to run isodist
, you will need to download an *.osm
file corresponding to the region
where you want to do your computation. Geofabrik is a good source of these files.
You need to place your OSM files into the isodist/osrm
directory (create one if it does not exist).
Then run the following command to generate .osrm
files:
$ npm run prepare
Finally, you are good to go! In order to generate the graph above, you will need indiana.osrm
and
run the following:
$ isodist --lon=-86.893386 --lat=40.417202 -s 2 -s 5 -s 7 -r 0.1 -h 0.5 -m indiana
You can specify all the parameters in an input file that is piped into standard input:
/* input.json */
{
"origin": {
"type": "Point",
"coordinates": [ -86.893386, 40.417202 ]
},
"map": "indiana",
"steps": [{
"distance": 2
}, {
"distance": 5
}, {
"distance": 7
}]
}
$ isodist < input.json
Please note that CLI arguments always override values specified in the input file.
$ isodist --map il < input.json
# The above command will use `osrm/il.osrm`
Required.
Latitude of the origin point.
Required.
Longitude of the origin point.
Required.
Distance at which to compute isodistance polygons.
For example, to compute isodistance polygons at 1, 2, 5 and 10 miles, use
--step 1 --step 2 --step 5 --step 10
Required.
Name of the .osrm
file you wish to use for routing.
Optional, default: 0.2
Sampling resolution of the underlying point grid. Larger values will result in less precise results but much faster processing. Smaller values will produce more precise results, but will require exponentially more processing time and memory.
Having a very small resolution value may result in kinks (i.e. self-intersections) of isodistance polygons, which cause hex-fitting to fail. You can choose to ignore them by disabling hex-fitting, but note that presence of kinks usually indicates incorrect parameter choice.
Optional, default: 0.5
Size of hex grid cells that isodistances are fitted onto. Passing a 0 value will disable hex grid fitting.
Optional, default: none
This flag instructs isodist
not to remove isolated "islands" from isodistance geometries.