kopia lustrzana https://github.com/kartoza/docker-osm
if TIME=0, not diff are imported, only the first PBF file
rodzic
70913aa378
commit
b8387bab9d
4
Makefile
4
Makefile
|
@ -1,6 +1,6 @@
|
|||
PROJECT_ID := dockerosm
|
||||
COMPOSE_FILE := docker-compose-web.yml
|
||||
# COMPOSE_FILE := docker-compose.yml
|
||||
# COMPOSE_FILE := docker-compose-web.yml
|
||||
COMPOSE_FILE := docker-compose.yml
|
||||
|
||||
.PHONY: logs
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ imposm:
|
|||
- HOST=db
|
||||
- DATABASE=gis
|
||||
# seconds between 2 executions of the script
|
||||
# if 0, the no update will be done, only the first initial import from the PBF
|
||||
- TIME=120
|
||||
# folder for settings (with *.json and *.sql)
|
||||
- SETTINGS=settings
|
||||
|
@ -87,6 +88,7 @@ osmupdate:
|
|||
# folder for diff which has been imported
|
||||
- IMPORT_DONE=import_done
|
||||
# seconds between 2 executions of the script
|
||||
# if 0, the no update will be done, only the first initial import from the PBF
|
||||
- TIME=120
|
||||
|
||||
qgisserver:
|
||||
|
|
|
@ -39,7 +39,8 @@ imposm:
|
|||
- HOST=db
|
||||
- DATABASE=gis
|
||||
# seconds between 2 executions of the script
|
||||
- TIME=120
|
||||
# if 0, the no update will be done, only the first initial import from the PBF
|
||||
- TIME=0
|
||||
# folder for settings (with *.json and *.sql)
|
||||
- SETTINGS=settings
|
||||
# folder for caching
|
||||
|
@ -87,4 +88,5 @@ osmupdate:
|
|||
# folder for diff which has been imported
|
||||
- IMPORT_DONE=import_done
|
||||
# seconds between 2 executions of the script
|
||||
- TIME=120
|
||||
# if 0, the no update will be done, only the first initial import from the PBF
|
||||
- TIME=0
|
||||
|
|
|
@ -325,8 +325,13 @@ class Importer(object):
|
|||
self.error(msg)
|
||||
|
||||
if len(listdir(self.default['IMPORT_QUEUE'])) == 0:
|
||||
self.info('Sleeping for %s seconds.' % self.default['TIME'])
|
||||
sleep(float(self.default['TIME']))
|
||||
if self.default['TIME'] != '0':
|
||||
self.info(
|
||||
'Sleeping for %s seconds.' % self.default['TIME'])
|
||||
sleep(float(self.default['TIME']))
|
||||
else:
|
||||
self.info('No more update to the database. Leaving.')
|
||||
quit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -60,6 +60,10 @@ class Downloader(object):
|
|||
if key in self.default.keys():
|
||||
self.default[key] = environ[key]
|
||||
|
||||
if self.default['TIME'] == '0':
|
||||
self.info('No more update to the database. Leaving.')
|
||||
quit()
|
||||
|
||||
def check_settings(self):
|
||||
"""Perform various checking."""
|
||||
# Folders
|
||||
|
|
|
@ -16,6 +16,11 @@ cd settings
|
|||
wget -c -O country.pbf http://download.openstreetmap.fr/extracts/africa/south_africa.osm.pbf
|
||||
```
|
||||
|
||||
### Updates
|
||||
|
||||
You can configure the time interval in the docker-compose file. By default, it's two minutes.
|
||||
If you set the TIME variable to 0, no diff files will be imported. Only the first PBF file.
|
||||
|
||||
### Clipping
|
||||
|
||||
You can put a shapefile in the clip folder. This shapefile will be
|
||||
|
|
Ładowanie…
Reference in New Issue