Skip to content


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?


Failed to load latest commit information.
Latest commit message
Commit time
June 21, 2022 10:48
March 16, 2023 18:12
December 23, 2021 17:17
March 16, 2023 15:49
March 16, 2023 15:49
April 23, 2020 16:37
June 16, 2016 10:00
March 17, 2022 16:16
March 17, 2022 11:30

travis GitHub license GitHub tag Quality Gate Status


Mimirsbrunn (also called Mimir) is an independent geocoding and reverse-geocoding system written in Rust, and built upon Elasticsearch. It can handle addresses, streets, points-of-interest (POI), administrative regions and public transport stops.

What's a Geocoder ?

Usually geocoding refers to "the process of transforming a physical address description to a location on the Earth's surface". However Mimir is more a geoparser than a geocoder since it can resolve any ambiguous toponym to its correct location.

In other words, a geocoder reads a description (possibly incomplete) of a location, and returns a list of candidate locations (latitude / longitude) matching the input.

Geocoding is traditionally used for autocompleting search fields used in geographic applications. For example, here is a screenshot of Qwant Maps, where the user enters a search string 20 rue hec mal, and mimir returns possible candidates in a dropdown box.

qwant maps

Getting Started

For an introduction to the project, you can have a look at the Introduction to Mimirsbrunn.

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on deploying the project on a live system.


Mimirsbrunn is a rust project, so you need to have a rust development environment. Instructions on how to do that are found on the rust website.

Additionally, mimirsbrunn relies on cosmogony to create so called cosmogony files which are used for indexing administrative regions.

For running end to end or unit tests, you need the docker engine available.



You can install Mimirsbrunn from debian packages available as build artifacts on the repository homepage. [FIXME Where are .deb ?]


You can also fetch official images from DockerHub here:

If you want to get the commit ref used to build the latest image you can run the following command:

docker inspect --format='{{index .Config.Labels "org.label-schema.vcs-ref"}}' navitia/mimirsbrunn:latest


You can build Mimirsbrunn manually, as the following instructions explain.

You need to retrieve the project and build it using the rust compiler:

git clone
cd mimirsbrunn
cargo build --release


Having built the project, you can now perform a sanity check. This will serve as a test that the program works, and as a basic example of the two main functionalities: indexing and querying.

So we'll index administrative regions into Elasticsearch, and then search for some of them. We'll focus on one country, lets say... Denmark!

  1. Download OSM file.

First we download the OSM file for Denmark, from the geofabrik server, and store the file locally.

  1. Generate cosmogony file.

If you haven't installed cosmogony yet, you need to do so now, by following the instructions here. You can then transform the original OSM PBF file for Denmark (The following command must be typed in the directory of the cosmogony project)

cargo run --release -- \
  generate \
  --input /path/to/denmark-latest.osm.pbf \
  --output denmark.jsonl.gz
  1. Start an Elasticsearch docker container.

We'll start an Elasticsearch version 7.13, available on ports 9200 and 9300.

docker run --name mimirsbrunn-test \
  -p 9200:9200 -p 9300:9300 \
  -e "discovery.type=single-node" \

You can check that Elasticsearch has correctly started (maybe wait for about 10/20s for Elasticsearch to be available):

curl 'http://localhost:9200'
  "name": "...",
  "cluster_name": "docker-cluster",
k  "tagline": "You Know, for Search"
  1. Prepare Elasticsearch

We use templates, such that if you create an index that starts with a certain prefix, if a templates is configured for that prefix, it will create the index with the values found in that template. So, before creating any index, you need to import all the templates in Elasticsearch.

cargo run --bin ctlmimir -- \
  --setting "elasticsearch.url='http://localhost:9200'" \
  --config-dir ./config \
  --run-mode testing \

You should see all the index templates by querying your Elasticsearch. For example, the template for administrative regions:

curl 'http://localhost:9200/_index_template/mimir-admin*'
  "index_templates": [
      "name": "mimir-admin",
      "index_template": {
        "index_patterns": [
        "composed_of": [
        "priority": 10,
        "version": 3
  1. Index cosmogony into Elasticsearch

The result of building the mimirsbrunn project includes several binaries located in /target/releases, one of which is used to index cosmogony files:

cosmogony2mimir uses several configuration files found in the source code, and they work fine by default. In the following command, we use a setting to make sure that cosmogony2mimir will target the Elasticsearch container we just started: (See here for more details about using cosmogony2mimir)

cargo run --bin cosmogony2mimir -- \
  --config-dir ./config \
  --run-mode testing \
  --setting "elasticsearch.url='http://localhost:9200'" \
  --setting langs=['en', 'da'] \
  --input <path/to/denmark.jsonl.gz> \

You can follow in the mimirsbrunn/logs directory.

  1. Check Elasticsearch

The previous step created an index for administrative regions, and so you should be able to query your Elasticsearch like so.

curl 'http://localhost:9200/_cat/indices'
health status index                                    uuid                   pri rep docs.count docs.deleted store.size
yellow open   munin_admin_fr_20211104_152535_346903898 FrWbs7PiRi26w-cbsIXjbg   1   4       1841            0     16.3mb         16.3mb
  1. Start Bragi

Now you can start bragi.

cargo run --bin bragi -- \
  --config-dir ./config \
  --setting "elasticsearch.url='http://localhost:9200'" \
  --run-mode testing \
  1. Query Bragi

You can now query bragi for a city that contains 'hay' (like 'L'Haÿ-les-Roses' for example).

http "localhost:5000/api/v1/autocomplete?q=hay&type[]=city"


Since this is a rust project, we are well instrumented to run all sorts of tests:

  • style
  • lint
  • unit tests
  • end to end / integration.
  • benchmark

You can run them all at once, and this in the way it is carried out in the CI pipeline, with

make check

See this page for a more in depth introduction to testing this project.

Where to Go from There

Maybe you find that some the results you get are not ranked correctly, and want to adjust the way Elasticsearch is configured. So you may want to learn how Elasticsearch templates are configured and how to get there.

You want to know more about indexing data into Elasticsearch.

You want to know more about bragi and how to query Elasticsearch via mimir, start here.


You can find more developer oriented documentation here


Please read for details on our code of conduct, and the process for submitting pull requests to us.


We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.


Mimirsbrunn is a project initially started by Guillaume Pinot and Antoine Desbordes for Navitia.

See also the list of contributors who participated in this project.



Who Uses It ?

If you use it too, feel free to open a pull request, we'll be happy to add your project here!


TODO: add a bit more detail on all the projects

All those projects use quite the same APIs, and you can compare their results using geocoder-tester.

For a more visual comparison, you can also use a comparator.



This project is licensed under the AGPLv3 GNU Affero General Public License - see the file for details


  • Billie Thompson - Provided README Template - PurpleBooth