Open Source Routing Machine for OpenStreetMap API Lib and App for Nim
MIT License
Open Source Routing Machine for OpenStreetMap API Lib and App.
nimble install osrm
import osrm, asyncdispatch, json
let ## Demo Data.
foo: OSRMCoords = (lat: 13.388860.float32, lon: 52.517037.float32)
bar: OSRMCoords = (lat: 13.397634.float32, lon: 52.529407.float32)
## Sync client.
let osrmc = OSRM(timeout: 99.byte, proxy: nil)
echo osrmc.nearest(number=42.byte, profile=OSRMBike, coordinates= @[foo]).pretty
echo osrmc.route(profile=OSRMBike, coordinates= @[foo, bar]).pretty
echo osrmc.table(profile=OSRMBike, coordinates= @[foo, bar], sources= @[0.byte, 1.byte], destinations= @[0.byte, 1.byte]).pretty
echo osrmc.match(profile=OSRMCar, coordinates= @[foo, bar]).pretty
echo osrmc.trip(profile=OSRMCar, coordinates= @[foo, bar]).pretty
## Async client.
proc async_osrm() {.async.} =
let
async_osrmc = AsyncOSRM(timeout: 99.byte)
async_response = await async_osrmc.nearest(number=42.byte, profile=OSRMBike, coordinates= @[foo])
echo async_response.pretty
wait_for async_osrm()
# Check the Docs for more API Calls...
Finds the best fastest Route between 2 Coordinates (lat,lon) in supplied order using the Open Source Routing Machine for OpenStreetMap API online services.
--ugly
(does not reduce bandwith usage).Use:
./osrm --color --lower --alternatives --steps --straight --overview --hints --timeout=9 --profile=bike --format=geojson --from_lat=42.666 --from_lon=10.55 --to_lat=15.42 --to_lon=12.75 "hint,hint,hint"
Uso (Spanish):
./osrm --color --minusculas --alternativas --pasos --derecho --resumen --sugerencias --timeout=9 --perfil=bici --formato=geojson --desde_lat=42.666 --desde_lon=10.55 --hasta_lat=15.42 --hasta_lon=12.75 "hint,hint,hint"
1.0
from Year 2018
.JsonNode
type.GET
.float32
.timeout
argument is on Seconds.proxy
of Proxy
type.nim doc osrm.nim
for more Documentation.Para hacer Apps del estilo "Como llego", para hacer Open Data, Data Science, cosas de OpenStreetMap, GeoCosos.
La aplicacion de linea de comandos soporta Espanol.
Yes.
Yes.
Yes.
Yes.
No.
No.
Yes. You MUST give Credit to OpenStreetMap Contributors!.
--ugly
--lower
--alternatives
--steps
--straight
--overviews
--hints
--timeout=99
--format=geojson
--from_lat=42.666 --from_lon=10.55
--to_lat=15.42 --to_lon=12.75
--color
--profile=bike
, --profile=car
, etc
--help