-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update scripts to match latest version from MapRando ablet o use IGN …
…contours for France
- Loading branch information
Showing
58 changed files
with
877 additions
and
1,238 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import os | ||
import subprocess | ||
from get_contours import get_contours | ||
import os, shutil, fnmatch | ||
import subprocess | ||
import time | ||
|
||
country_name_args=sys.argv[1] | ||
|
||
country_list=[] | ||
|
||
#File country | ||
file_in = open("country.txt", "rt") | ||
|
||
lines = file_in.readlines() | ||
for line in lines: | ||
result = line.split(";") | ||
country_name=result[0].replace('#','') | ||
add=0 | ||
if(country_name==country_name_args): | ||
add=1 | ||
if(len(result)==4): | ||
country_list.append([result[0],result[1],result[2],result[3],add+1]) | ||
else: | ||
country_list.append([result[0],result[1],result[2],result[3],int(result[4])+add]) | ||
|
||
file_in.close() | ||
|
||
file_out = open("country.txt", "wt") | ||
file_modif="\n" | ||
for idx, country in enumerate(country_list): | ||
file_modif=file_modif+"\n"+country[0]+";"+country[1]+";"+country[2]+";"+country[3].strip()+";"+str(country[4]) | ||
|
||
file_out.write(file_modif.strip()) | ||
file_out.close() | ||
|
||
for idx, country in enumerate(country_list): | ||
country_name=country[0].replace('#','') | ||
id=country[1] | ||
style=country[2] | ||
url=country[3] | ||
if(country_name==country_name_args): | ||
print("Update "+country_name+ " "+id+" "+style+" "+url) | ||
#Launch script | ||
subprocess.run(["bash", "download_osm.sh",country_name,id,style,url]) | ||
subprocess.run(["bash", "create_map.sh",country_name,id,style]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import os | ||
import subprocess | ||
import os, shutil, fnmatch | ||
import subprocess | ||
import time | ||
import pathlib | ||
|
||
country_list=[] | ||
|
||
#File country | ||
file_in = open("country.txt", "rt") | ||
|
||
lines = file_in.readlines() | ||
for line in lines: | ||
result = line.split(";") | ||
country_list.append([result[0],result[1],result[2],result[3]]) | ||
|
||
file_in.close() | ||
|
||
for idx, country in enumerate(country_list): | ||
hasFilesDem=False | ||
hasFilesDemWithId=False | ||
country_name=country[0].replace("#",'') | ||
id=country[1] | ||
style=country[2] | ||
url=country[3] | ||
country_dir = "carte_"+country_name.replace(' ','_').lower() | ||
isDir = os.path.isdir(country_dir) | ||
if(isDir==False): | ||
print("Dir "+country_name+" missing") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import os | ||
import os, shutil, fnmatch | ||
import subprocess | ||
import time | ||
|
||
country_list_id=[] | ||
|
||
#File country | ||
file_in = open("country.txt", "rt") | ||
|
||
lines = file_in.readlines() | ||
for line in lines: | ||
result = line.split(";") | ||
for element in country_list_id: | ||
if(element[1]==result[1]): | ||
print(result[0]) | ||
country_list_id.append([result[0],result[1]]) | ||
|
||
|
||
file_in.close() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import os | ||
import subprocess | ||
from scripts_hgt.get_hgt import get_hgt | ||
#from scripts_hgt.hgt_to_osm import hgt_to_osm | ||
from get_contours import get_contours | ||
import os, shutil, fnmatch | ||
import subprocess | ||
import time | ||
|
||
country_dict={} | ||
|
||
#File country | ||
file_in = open("country.txt", "rt") | ||
|
||
lines = file_in.readlines() | ||
for line in lines: | ||
result = line.split(";") | ||
country_name=result[0].replace('#','') | ||
if(len(result)==4): | ||
if(result[0].startswith('#')): | ||
country_dict[country_name]=1 | ||
else: | ||
country_dict[country_name]=sys.maxsize | ||
else: | ||
if(result[0].startswith('#')): | ||
country_dict[country_name]=int(result[4]) | ||
else: | ||
country_dict[country_name]=sys.maxsize | ||
|
||
file_in.close() | ||
|
||
sorted_dict=dict(sorted(country_dict.items(), key=lambda item: item[1],reverse=True)) | ||
for country in sorted_dict: | ||
if(sorted_dict[country]==sys.maxsize): | ||
print(country) | ||
else: | ||
print(country + " -> "+str(sorted_dict[country])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,51 @@ | ||
France;02;utagawa;https://download.geofabrik.de/europe/france-latest.osm.pbf | ||
Suisse;03;utagawa;https://download.geofabrik.de/europe/switzerland-latest.osm.pbf | ||
Italie;04;utagawa;https://download.geofabrik.de/europe/italy-latest.osm.pbf | ||
Belgique;05;utagawa;https://download.geofabrik.de/europe/belgium-latest.osm.pbf | ||
Espagne;06;utagawa;https://download.geofabrik.de/europe/spain-latest.osm.pbf | ||
Reunion;07;utagawa;https://download.geofabrik.de/europe/france/reunion-latest.osm.pbf | ||
Allemagne;08;utagawa;https://download.geofabrik.de/europe/germany-latest.osm.pbf | ||
Luxembourg;09;utagawa;https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf | ||
Midi-Pyrenees;10;utagawa;https://download.geofabrik.de/europe/france/midi-pyrenees-latest.osm.pbf | ||
Languedoc;11;utagawa;https://download.geofabrik.de/europe/france/languedoc-roussillon-latest.osm.pbf | ||
Haute-Normandie;12;utagawa;https://download.geofabrik.de/europe/france/haute-normandie-latest.osm.pbf | ||
Liechtenstein;14;utagawa;https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf | ||
Rhone-Alpes;13;utagawa;https://download.geofabrik.de/europe/france/rhone-alpes-latest.osm.pbf | ||
Andorre;19;utagawa;https://download.geofabrik.de/europe/andorra-latest.osm.pbf | ||
Autriche;14;utagawa;https://download.geofabrik.de/europe/austria-latest.osm.pbf | ||
Baleares;21;utagawa;https://download.geofabrik.de/europe/spain/islas-baleares-latest.osm.pbf | ||
Belgique;05;utagawa;https://download.geofabrik.de/europe/belgium-latest.osm.pbf | ||
Danemark;15;utagawa;https://download.geofabrik.de/europe/denmark-latest.osm.pbf | ||
Pays-bas;16;utagawa;https://download.geofabrik.de/europe/netherlands-latest.osm.pbf | ||
Portugal;17;utagawa;https://download.geofabrik.de/europe/portugal-latest.osm.pbf | ||
Espagne;06;utagawa;https://download.geofabrik.de/europe/spain-latest.osm.pbf | ||
France;02;utagawa;https://download.geofabrik.de/europe/france-latest.osm.pbf | ||
FR-Alsace;34;utagawa;https://download.geofabrik.de/europe/france/alsace-latest.osm.pbf | ||
FR-Aquitaine;35;utagawa;https://download.geofabrik.de/europe/france/aquitaine-latest.osm.pbf | ||
FR-Auvergne;20;utagawa;https://download.geofabrik.de/europe/france/auvergne-latest.osm.pbf | ||
FR-BasNormandie;36;utagawa;https://download.geofabrik.de/europe/france/basse-normandie-latest.osm.pbf | ||
FR-Bourgogne;37;utagawa;https://download.geofabrik.de/europe/france/bourgogne-latest.osm.pbf | ||
FR-Bretagne;32;utagawa;https://download.geofabrik.de/europe/france/bretagne-latest.osm.pbf | ||
FR-Centre;38;utagawa;https://download.geofabrik.de/europe/france/centre-latest.osm.pbf | ||
FR-Champagne;39;utagawa;https://download.geofabrik.de/europe/france/champagne-ardenne-latest.osm.pbf | ||
FR-Corse;40;utagawa;https://download.geofabrik.de/europe/france/corse-latest.osm.pbf | ||
FR-FrcheComte;41;utagawa;https://download.geofabrik.de/europe/france/franche-comte-latest.osm.pbf | ||
FR-Guadeloupe;22;utagawa;https://download.geofabrik.de/europe/france/guadeloupe-latest.osm.pbf | ||
FR-Guyane;42;utagawa;https://download.geofabrik.de/europe/france/guyane-latest.osm.pbf | ||
FR-HteNormandie;12;utagawa;https://download.geofabrik.de/europe/france/haute-normandie-latest.osm.pbf | ||
FR-IDF;43;utagawa;https://download.geofabrik.de/europe/france/ile-de-france-latest.osm.pbf | ||
FR-Languedoc;11;utagawa;https://download.geofabrik.de/europe/france/languedoc-roussillon-latest.osm.pbf | ||
FR-Limousin;44;utagawa;https://download.geofabrik.de/europe/france/limousin-latest.osm.pbf | ||
FR-Lorraine;45;utagawa;https://download.geofabrik.de/europe/france/lorraine-latest.osm.pbf | ||
FR-Martinique;23;utagawa;https://download.geofabrik.de/europe/france/martinique-latest.osm.pbf | ||
FR-Mayotte;46;utagawa;https://download.geofabrik.de/europe/france/mayotte-latest.osm.pbf | ||
FR-MidiPy;10;utagawa;https://download.geofabrik.de/europe/france/midi-pyrenees-latest.osm.pbf | ||
FR-Nord-PdC;47;utagawa;https://download.geofabrik.de/europe/france/nord-pas-de-calais-latest.osm.pbf | ||
FR-PACA;32;utagawa;https://download.geofabrik.de/europe/france/provence-alpes-cote-d-azur-latest.osm.pbf | ||
FR-Pays-Loire;48;utagawa;https://download.geofabrik.de/europe/france/pays-de-la-loire-latest.osm.pbf | ||
FR-Picardie;49;utagawa;https://download.geofabrik.de/europe/france/picardie-latest.osm.pbf | ||
FR-Poitou;50;utagawa;https://download.geofabrik.de/europe/france/poitou-charentes-latest.osm.pbf | ||
FR-Polynesie;24;utagawa;https://download.geofabrik.de/australia-oceania/polynesie-francaise-latest.osm.pbf | ||
FR-Reunion;07;utagawa;https://download.geofabrik.de/europe/france/reunion-latest.osm.pbf | ||
FR-Rhone-Alpes;13;utagawa;https://download.geofabrik.de/europe/france/rhone-alpes-latest.osm.pbf | ||
Israel;18;utagawa;https://download.geofabrik.de/asia/israel-and-palestine-latest.osm.pbf | ||
Andorre;19;utagawa;https://download.geofabrik.de/europe/andorra-latest.osm.pbf | ||
Auvergne;20;utagawa;https://download.geofabrik.de/europe/france/auvergne-latest.osm.pbf | ||
Baleares;21;utagawa;https://download.geofabrik.de/europe/spain/islas-baleares-latest.osm.pbf | ||
Guadeloupe;22;utagawa;https://download.geofabrik.de/europe/france/guadeloupe-latest.osm.pbf | ||
Martinique;23;utagawa;https://download.geofabrik.de/europe/france/martinique-latest.osm.pbf | ||
Polynesie;24;utagawa;https://download.geofabrik.de/australia-oceania/polynesie-francaise-latest.osm.pbf | ||
Italie;04;utagawa;https://download.geofabrik.de/europe/italy-latest.osm.pbf | ||
Japon;25;utagawa;https://download.geofabrik.de/asia/japan-latest.osm.pbf | ||
Liechtenstein;26;utagawa;https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf | ||
Luxembourg;09;utagawa;https://download.geofabrik.de/europe/luxembourg-latest.osm.pbf | ||
Pays-bas;16;utagawa;https://download.geofabrik.de/europe/netherlands-latest.osm.pbf | ||
Portugal;17;utagawa;https://download.geofabrik.de/europe/portugal-latest.osm.pbf | ||
Royaume-Uni;31;utagawa;https://download.geofabrik.de/europe/united-kingdom-latest.osm.pbf | ||
Seychelles;33;utagawa;https://download.geofabrik.de/africa/seychelles-latest.osm.pbf | ||
Suisse;03;utagawa;https://download.geofabrik.de/europe/switzerland-latest.osm.pbf | ||
US-midwest;27;utagawa;https://download.geofabrik.de/north-america/us-midwest-latest.osm.pbf | ||
US-northeast;28;utagawa;https://download.geofabrik.de/north-america/us-northeast-latest.osm.pbf | ||
US-south;29;utagawa;https://download.geofabrik.de/north-america/us-south-latest.osm.pbf | ||
US-west;30;utagawa;https://download.geofabrik.de/north-america/us-west-latest.osm.pbf | ||
Slovenie;51;utagawa;https://download.geofabrik.de/europe/slovenia-latest.osm.pbf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import os | ||
import subprocess | ||
from get_contours import get_contours | ||
import os, shutil, fnmatch | ||
import subprocess | ||
import time | ||
import pathlib | ||
from multiprocessing import Pool | ||
|
||
def task(country): | ||
hasFiles=False | ||
country_name=country[0].replace("#",'') | ||
id=country[1] | ||
style=country[2] | ||
url=country[3] | ||
country_dir = "carte_"+country_name.replace(' ','_').lower() | ||
for file in pathlib.Path(country_dir).glob("*.img"): | ||
if(str(file).split("/")[1].startswith("55")): | ||
hasFiles=True | ||
if(hasFiles==False): | ||
#Get contours | ||
print("Update "+country_name+ " "+id+" "+style+" "+url) | ||
get_contours(country_name, url) | ||
#Launch script | ||
subprocess.run(["bash", "create_map.sh",country_name,id,style]) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
country_list=[] | ||
#File country | ||
file_in = open("country.txt", "rt") | ||
|
||
lines = file_in.readlines() | ||
for line in lines: | ||
result = line.split(";") | ||
country_list.append([result[0],result[1],result[2],result[3]]) | ||
|
||
file_in.close() | ||
|
||
with Pool(processes=3) as pool: | ||
pool.map(task, country_list) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,4 +87,4 @@ mv -f gmapsupp.img ${name_file}${dm}.img | |
|
||
time_task | ||
|
||
cd .. | ||
cd .. |
Oops, something went wrong.