Skip to content

A simple OCaml app for calculating great-circle distance between two coordinates.

Notifications You must be signed in to change notification settings

bobbypriam/haversiner

Repository files navigation

Haversiner

A simple OCaml app for calculating great-circle distance between two coordinates using the Haversine formula, powered by Opium.

Development

Clone this repo, then:

$ opam pin add -yn haversiner .
$ opam install --deps-only haversiner
$ make run

The server will then run on http://localhost:3000. Try it with:

$ curl -XPOST http://localhost:3000 -d @test/payload.json
{"distance":2886.444442837984}

See test/payload.json for example payload.

Testing

$ opam install alcotest
$ make test

Building and running with Docker

$ docker build -t haversiner .
$ docker run -p 3000:3000 -d --name haversiner haversiner

About

A simple OCaml app for calculating great-circle distance between two coordinates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published