Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Headway currently supports fully automatic builds for the following cities:
Aachen, Aarhus, Adelaide, Albuquerque, Alexandria, Amsterdam, Antwerpen, Arnhem, Auckland, Augsburg, Austin, Baghdad, Baku, Balaton, Bamberg, Bangkok, Barcelona, Basel, Beijing, Beirut, Berkeley, Berlin, Bern, Bielefeld, Birmingham, Bochum, Bogota, Bombay, Bonn, Bordeaux, Boulder, BrandenburgHavel, Braunschweig, Bremen, Bremerhaven, Brisbane, Bristol, Brno, Bruegge, Bruessel, Budapest, BuenosAires, Cairo, Calgary, Cambridge, CambridgeMa, Canberra, CapeTown, Chemnitz, Chicago, ClermontFerrand, Colmar, Copenhagen, Cork, Corsica, Corvallis, Cottbus, Cracow, CraterLake, Curitiba, Cusco, Dallas, Darmstadt, Davis, DenHaag, Denver, Dessau, Dortmund, Dresden, Dublin, Duesseldorf, Duisburg, Edinburgh, Eindhoven, Emden, Erfurt, Erlangen, Eugene, Flensburg, FortCollins, Frankfurt, FrankfurtOder, Freiburg, Gdansk, Genf, Gent, Gera, Glasgow, Gliwice, Goerlitz, Goeteborg, Goettingen, Graz, Groningen, Halifax, Halle, Hamburg, Hamm, Hannover, Heilbronn, Helsinki, Hertogenbosch, Huntsville, Innsbruck, Istanbul, Jena, Jerusalem, Johannesburg, Kaiserslautern, Karlsruhe, Kassel, Katowice, Kaunas, Kiel, Kiew, Koblenz, Koeln, Konstanz, LakeGarda, LaPaz, LaPlata, Lausanne, Leeds, Leipzig, Lima, Linz, Lisbon, Liverpool, Ljubljana, Lodz, London, Luebeck, Luxemburg, Lyon, Maastricht, Madison, Madrid, Magdeburg, Mainz, Malmoe, Manchester, Mannheim, Marseille, Melbourne, Memphis, MexicoCity, Miami, Minsk, Moenchengladbach, Montevideo, Montpellier, Montreal, Moscow, Muenchen, Muenster, NewDelhi, NewOrleans, NewYork, Nuernberg, Oldenburg, Oranienburg, Orlando, Oslo, Osnabrueck, Ostrava, Ottawa, Paderborn, Palma, PaloAlto, Paris, Perth, Philadelphia, PhnomPenh, Portland, PortlandME, Porto, PortoAlegre, Potsdam, Poznan, Prag, Providence, Regensburg, Riga, RiodeJaneiro, Rostock, Rotterdam, Ruegen, Saarbruecken, Sacramento, Saigon, Salzburg, SanFrancisco, SanJose, SanktPetersburg, SantaBarbara, SantaCruz, Santiago, Sarajewo, Schwerin, Seattle, Seoul, Sheffield, Singapore, Sofia, Stockholm, Stockton, Strassburg, Stuttgart, Sucre, Sydney, Szczecin, Tallinn, Tehran, Tilburg, Tokyo, Toronto, Toulouse, Trondheim, Tucson, Turin, UlanBator, Ulm, Usedom, Utrecht, Vancouver, Victoria, WarenMueritz, Warsaw, WashingtonDC, Waterloo, Wien, Wroclaw, Wuerzburg, Wuppertal, Zagreb, Zuerich
</details>

#### Build procedure.
#### Build procedure

This approach will download all the mapping data you need automatically, but only works for the pre-defined metro areas above.

Expand All @@ -62,6 +62,16 @@ To build Headway for a custom area, you just need to provide your own OSM extrac

The process is largely the same as above. After downloading your OSM extract, move it to the project root (in the same directory as this BUILD.md), and wherever you see `with-area Amsterdam` in the build scripts, change it to `with-area YourArea --local-pbf ./your-area.osm.pbf`.

#### OpenAddresses address mappings

By default, a planet-wide address database is downloaded from [OpenAddresses](https://openaddresses.io/). You can supply your own addresses (for example exports from https://openaddresses.io) in either CSV or GeoJSON format. To do so, the file needs to be provided to the `openaddresses` container and configured in `csv/areas.csv`. For example:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, a planet-wide address database is downloaded

That should be true only for planet builds. Smaller builds should not include any openaddress data, unless it's been specified in the service/areas.csv. Are you seeing otherwise?

Modify dagger/pelias.go to include your file by adding a WithFile("/data/openaddresses/myadds.geojson", p.Pelias.Headway.ServicesDir.File("myadds.geojson"). line to the ImportOpenAddresses container.

It should be sufficient to add the OpenAddress file names to the service/areas.csv (like I have for Seattle). Running the build should then download the data from OpenAddresses. It is not necessary to manually download and then edit the dagger code.

Or is there some other use case I'm not considering?

In any case, it'd be good to have this better documented, and it might be nice to encourage people to upstream any mappings they need in that file.


Long ago I actually started an experiment to dynamically download the OA data by bounding box: main...mkirk/openaddresses-downloader

...might be nice to revive that some day.


1. Put your addresses file at `services/myadds.geojson`
2. Put a line for your area in `services/areas.csv`: `MyArea,NK,100.0 100.0 200.0 200.0,myadds.geojson`
3. Modify `dagger/pelias.go` to include your file by adding a `WithFile("/data/openaddresses/myadds.geojson", p.Pelias.Headway.ServicesDir.File("myadds.geojson").` line to the `ImportOpenAddresses` container.

After rebuilding containers and assets, your addresses should now be indexed in Pelias and included in results.

## Docker-compose restarts

Because Headway's docker-compose configuration uses init containers to populate a docker volume containing internal data, rebuilding the data for a metro area won't update existing containers. It's necessary to run `docker compose down --volumes` to re-initialize the data in the init containers.
Expand Down
2 changes: 1 addition & 1 deletion bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ if [ -d "$TRANSIT_CONFIG_DIR" ]; then
bin/build-transit "$CONFIG_DIR"
fi

echo "Next, run: git co . && k8s/bin/regenerate-all"
echo "You can now regenerate kubernetes deployments by running: git co . && k8s/bin/regenerate-all"