-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docker-osmupdate/readme.md b/docker-osmupdate/readme.md
index 83bb263..34b50c3 100644
--- a/docker-osmupdate/readme.md
+++ b/docker-osmupdate/readme.md
@@ -1,6 +1,27 @@
## Docker OSM Update
-You should have 3 folders : base_pbf, import_queue, import_done
+This docker image when run will fetch on a regular interval any new diff file
+for all the changes that have happened in the world over the update interval.
+
+You can also specify a custom url for fetching the diff if you wish to retrieve
+regional diffs rather than the global one.
+
+You can specify a polygonal area for the diff so that it will only apply features
+from the diff that fall within that area. For example providing a polygon of the
+borders of Malawi will result in only Malawi features being extracted from the diff.
+
+Note that the diff retrieved and options specified here are not related to the
+initial base map used - so for example if your initial base map is for Malawi and
+you specify a diff area in Botswana, updated features in Botswana will be applied
+to your base map which only includes features from Malawi. For this reason, take
+care to ensure that your diff area coincides with the region covered by your
+original base map.
+
+Once the diff has been downloaded, it is placed into /home/import_queue where
+it will be picked up by the long running imposm3 container, which will apply
+the diff to the database.
+
+You should have 3 folders : osm_pbf, import_queue, import_done
Put a state file in base-pbf like this one :
http://download.openstreetmap.fr/extracts/africa/south_africa.state.txt
@@ -16,5 +37,5 @@ With -e, you can add some settings :
- BASE_URL = http://planet.openstreetmap.org/replication/, change the URL to use a custom URL to fetch regional file updates.
- IMPORT_QUEUE = import_queue
- IMPORT_DONE = import_done
- - BASE_PBF = base_pbf
- - TIME = 120, secondes between two executions of the script
\ No newline at end of file
+ - OSM_PBF = osm_pbf
+ - TIME = 120, secondes between two executions of the script
diff --git a/osm_pbf/readme.md b/osm_pbf/readme.md
new file mode 100644
index 0000000..a6eec6f
--- /dev/null
+++ b/osm_pbf/readme.md
@@ -0,0 +1,4 @@
+This folder should contain a *.pbf and *.state.txt.
+
+The first pbf file encoutered will be imported, for this reason we recommend
+to only place one pbf in this folder so you can be sure which will be imported.
diff --git a/readme.md b/readme.md
index 75afebd..24a0260 100644
--- a/readme.md
+++ b/readme.md
@@ -1,7 +1,32 @@
-Copy an OSM file (*.pbf) and its state file(*.state.txt) into base-pbf. The state file contains the timestamp of the OSM file. You can add a [polygon file](http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format) for the clipping.
+Copy an OSM file (*.pbf) and its state file(*.state.txt) into base-pbf.
+The state file contains the timestamp of the OSM file. You can add a
+[polygon file](http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format)
+for the clipping.
Check that a *.json is present in 'settings' for the mapping.
``docker-compose build``
``docker-compose up``
-You should read the documentation about [docker-imposm](https://github.com/gustry/docker-imposm3) and [docker-osmupdate](https://github.com/Gustry/docker-osmupdate) for settings.
+You should read the documentation about [docker-imposm]
+(https://github.com/gustry/docker-imposm3) and
+[docker-osmupdate](https://github.com/Gustry/docker-osmupdate) for
+settings.
+
+
+# Example usage
+
+In this example we will set up an OSM database for South Africa that
+will poll for updates every hour.
+
+First fetch the latest South Africa osm binary dump file (.pbf) and state file.
+I will write the example as generically as possible so that you can substitute
+your own country or region here.
+
+```
+mkdir osm
+cd osm
+wget -c -O country.pbf http://download.openstreetmap.fr/extracts/africa/south_africa.osm.pbf
+wget -c http://download.openstreetmap.fr/extracts/africa/south_africa.state.txt
+```
+
+
diff --git a/settings/readme.md b/settings/readme.md
index 239b046..92ac40a 100644
--- a/settings/readme.md
+++ b/settings/readme.md
@@ -1 +1,7 @@
-This folder should contain a json file for the mapping. You can also put a SQL file, it will be executed after the PBF import.
\ No newline at end of file
+This folder should contain a json file for the mapping. You can also put a
+SQL file, it will be executed after the PBF import.
+
+Optionally you can include a .poly file (see http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format)
+in this directory, which will be used as the clip extents for diffs. The
+base name of the .poly file is not important - the first .poly file encountered
+in this folder will be used.