-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprocess_departement_X.tuttle
37 lines (25 loc) · 6.46 KB
/
process_departement_X.tuttle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Création de shapefiles dans un zip pour le département {{num}}
file://departement-{{num}} <- file://departements-pbf/departement-{{num}}.osm.pbf
mkdir departement-{{num}}
file://departement-{{num}}/places.shp file://departement-{{num}}/places.shx file://departement-{{num}}/places.prj file://departement-{{num}}/places.dbf file://departement-{{num}}/places.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/places.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, place AS "type", population from points where place is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/roads.shp <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/roads.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, highway AS "type", CAST(oneway AS integer) + 1 AS "oneway", CAST(bridge AS integer) + 1 AS bridge, CAST(tunnel AS integer) + 1 AS tunnel, CAST(maxspeed AS integer) + 1 AS maxspeed from lines where highway is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/buildings.shp file://departement-{{num}}/buildings.shx file://departement-{{num}}/buildings.prj file://departement-{{num}}/buildings.dbf file://departement-{{num}}/buildings.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/buildings.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, building AS "type" from multipolygons where building is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/railways.shp file://departement-{{num}}/railways.shx file://departement-{{num}}/railways.prj file://departement-{{num}}/railways.dbf file://departement-{{num}}/railways.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/railways.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, railway AS "type", width from lines where railway is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/waterways.shp file://departement-{{num}}/waterways.shx file://departement-{{num}}/waterways.prj file://departement-{{num}}/waterways.dbf file://departement-{{num}}/waterways.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/waterways.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, waterway AS "type", width from lines where waterway is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/points.shp file://departement-{{num}}/points.shx file://departement-{{num}}/points.prj file://departement-{{num}}/points.dbf file://departement-{{num}}/points.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/points.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -dialect SQLITE -sql "select osm_id, GEOMETRY, name, coalesce(REPLACE(highway,'yes','highway'), REPLACE(man_made,'yes','man_made'), REPLACE(amenity,'yes','amenity'), REPLACE(shop,'yes','shop'), REPLACE(tourism,'yes','tourism'), REPLACE(railway,'yes','railway'), REPLACE(historic,'yes','historic'), REPLACE(office,'yes','office'), REPLACE(craft,'yes','craft')) AS type FROM points WHERE highway is not null OR man_made is not null OR amenity is not null OR shop is not null OR tourism is not null OR railway is not null OR historic is not null OR office is not null OR craft is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/natural.shp file://departement-{{num}}/natural.shx file://departement-{{num}}/natural.prj file://departement-{{num}}/natural.dbf file://departement-{{num}}/natural.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/natural.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -dialect SQLITE -sql "select osm_id, GEOMETRY, name, coalesce(waterway,leisure,landuse,REPLACE(natural,'wood','forest')) AS "type" from multipolygons where waterway is not null or leisure='park' or landuse='forest' or landuse='park' or natural='wood' or natural='water'" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/landuse.shp file://departement-{{num}}/landuse.shx file://departement-{{num}}/landuse.prj file://departement-{{num}}/landuse.dbf file://departement-{{num}}/landuse.cpg <- file://departements-pbf/departement-{{num}}.osm.pbf file://departement-{{num}} file://osm_extract/osm_config.ini
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/landuse.shp --config OSM_CONFIG_FILE osm_extract/osm_config.ini -sql "select osm_id, name, landuse AS "type" from multipolygons where landuse is not null" -lco ENCODING=UTF-8 departements-pbf/departement-{{num}}.osm.pbf
file://departement-{{num}}/admin-departement.shp file://departement-{{num}}/admin-departement.shx file://departement-{{num}}/admin-departement.prj file://departement-{{num}}/admin-departement.dbf <- file://departement-{{num}} file://departements
ogr2ogr -f "ESRI Shapefile" departement-{{num}}/admin-departement.shp -where "code_insee='{{num}}'" departements/departements.shp
file://departement-{{num}}/departement.qgs <- file://departement.qgs, file://departement-{{num}}
cp departement.qgs departement-{{num}}/departement.qgs
file://zips/departement-{{num}}-{{nom}}.zip <- file://zips file://departement-{{num}}/departement.qgs file://departement-{{num}}/admin-departement.shp file://departement-{{num}}/places.shp file://departement-{{num}}/roads.shp file://departement-{{num}}/buildings.shp file://departement-{{num}}/railways.shp file://departement-{{num}}/waterways.shp file://departement-{{num}}/points.shp file://departement-{{num}}/natural.shp file://departement-{{num}}/landuse.shp
zip -r zips/departement-{{num}}-{{nom}}.zip departement-{{num}}