Currently only calculates intersection over union of two bounding boxes.
-
Python 3.7+
-
pip
-
git
-
setuptools (optional)
First, clone this repository.
$ git clone git@github.com:citizen4371/geocalc.git
$ cd geocalc
Service can be started as a python module:
$ python -m geocalc
You can check that it's working it by visiting http://localhost:8000/
Dockerfile is provided as well, you can build docker image:
$ docker build -t geocalc .
Then start the container:
$ docker run -d --name geocalc -p 8000:8000 geocalc
When the service is running, swagger api documentation is available at /docs
endpoint.
The only calculation endpoint currently available is /calculations/iou
which performs intersection over union.
Coordinates of the two boxes should be passed to it as query params (2 lists of 4 float values):
?box1=[top-left x]&box1=[top-left y]&box1=[bottom-right x]&box1=[bottom-right y]&box2=[top-left x]&box2=[top-left y]&box2=[bottom-right x]&box2=[bottom-right y]
Convention for positive x-axis direction is left to right, y-axis - bottom to top.