kopia lustrzana https://github.com/kartoza/docker-osm
custom diff url
rodzic
524883bc81
commit
e4df803d22
|
@ -4,3 +4,4 @@ settings/*.pbf
|
||||||
settings/*.state.txt
|
settings/*.state.txt
|
||||||
settings/*.poly
|
settings/*.poly
|
||||||
settings/last.state.txt
|
settings/last.state.txt
|
||||||
|
settings/custom_url_diff.txt
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from os.path import exists, join, isabs, abspath
|
from os.path import exists, join, isabs, abspath, isfile
|
||||||
from os import listdir, environ
|
from os import listdir, environ
|
||||||
from sys import exit
|
from sys import exit
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
@ -73,6 +73,13 @@ for f in listdir(default['SETTINGS']):
|
||||||
if f.endswith('.poly'):
|
if f.endswith('.poly'):
|
||||||
poly_file = join(default['SETTINGS'], f)
|
poly_file = join(default['SETTINGS'], f)
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Todo : need fix custom URL and sporadic diff : daily, hourly and minutely
|
||||||
|
if f == 'custom_url_diff.txt':
|
||||||
|
with open(join(default['SETTINGS'], f), 'r') as content_file:
|
||||||
|
default['BASE_URL'] = content_file.read()
|
||||||
|
"""
|
||||||
|
|
||||||
if not state_file:
|
if not state_file:
|
||||||
print >> stderr, 'State file *.state.txt is missing in %s' % default['SETTINGS']
|
print >> stderr, 'State file *.state.txt is missing in %s' % default['SETTINGS']
|
||||||
exit()
|
exit()
|
||||||
|
|
|
@ -37,7 +37,7 @@ if url:
|
||||||
state = diff + 'state.txt'
|
state = diff + 'state.txt'
|
||||||
print 'Polygon file : ' + poly_file
|
print 'Polygon file : ' + poly_file
|
||||||
print 'PBF file : ' + pbf_file
|
print 'PBF file : ' + pbf_file
|
||||||
print 'Diff (not used): ' + diff
|
print 'Diff URL : ' + diff
|
||||||
print 'state : ' + state
|
print 'state : ' + state
|
||||||
|
|
||||||
print 'Downloading PBF'
|
print 'Downloading PBF'
|
||||||
|
@ -52,6 +52,10 @@ if url:
|
||||||
commands = ['wget', '-c', '-O', 'settings/country.state.txt', state]
|
commands = ['wget', '-c', '-O', 'settings/country.state.txt', state]
|
||||||
call(commands)
|
call(commands)
|
||||||
|
|
||||||
|
print 'Setting custom URL diff'
|
||||||
|
with open('settings/custom_url_diff.txt', 'w') as f:
|
||||||
|
f.write(diff)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print 'This area is unkown in geofabrik or in our script. Check with the list argument.'
|
print 'This area is unkown in geofabrik or in our script. Check with the list argument.'
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue