Skip to content

Geoportail-Luxembourg/distance

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

distance

webservice to calculate official distances according to https://data.public.lu/en/datasets/matrice-des-distances-sur-routes-nationales-et-cr/

Usage

Docker

a regular docker build ./ would produce the docker image with the default name distance. Then running the service can be done by issuing a docker run command, specifying the exposed ports.

docker build ./ -t distance
docker run -p "80:80" distance

Docker compose

The docker-compose.yaml can be used to automatically create and start the service in a single operation:

docker-compose app

If you want the service to be exposed on another port and use docker-compose change the port in the .env file or run the docker-compose command overrriding the port (env PORT=8080 docker-compose up if the image has already been created)

Example queries

Using the web browser

Once you have a running service, you can visually create a query by navigating to http://localhost/) If you modified the exposed port by changing the PORT variable in the .env file, change the URL accordingly.

Using the API

To get the distance between multiple points, you can access the webservice for example like:

http://localhost/webservice/Luxembourg:Esch-sur-Alzette

This would return a json result like:

{"calculated": 18.8, "from": "luxembourg", "straight": 16.8, "to": "esch-sur-alzette"}

About

webservice to calculate official distances according to https://data.public.lu/en/datasets/matrice-des-distances-sur-routes-nationales-et-cr/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages