-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osm2pgsql free version recoded by frodrigo (#1)
* Deals With / * Magasin, Boutique -> rm * community_centre alternatives * Gares * Salle des fêtes * Océan * Monument aux Morts * Maison de quartier * -public * -building=yes * No place bigger than than city * Remove addressable highway * Remove some *=yes * Add key2 * Remove key1 without value * rank is value between 0 and 1 * Rename poi.csv to def.csv * Rewrite extraction process without osm2pgsql * Fix city_code to citycode
- Loading branch information
Showing
10 changed files
with
574 additions
and
670 deletions.
There are no files selected for viewing
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,2 @@ | ||
psql < def.sql | ||
psql -c "COPY def FROM STDIN CSV HEADER" < def.csv |
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,6 @@ | ||
URL=http://osm13.openstreetmap.fr/~cquest/openfla/export/communes-20150101-5m-shp.zip | ||
[ -f communes-20150101-5m-shp.zip ] || wget $URL && unzip communes-20150101-5m-shp.zip | ||
shp2pgsql -d communes-20150101-5m.shp > communes.sql | ||
rm communes-20150101-5m.* LICENCE.txt communes-descriptif.txt | ||
psql < communes.sql | ||
psql -c 'CREATE INDEX idx_com_geom ON "communes-20150101-5m" USING gist(geom);' |
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,10 @@ | ||
PBF=http://download.geofabrik.de/europe/france-latest.osm.pbf | ||
[ -f france-latest.osm.pbf ] || wget $PBF | ||
|
||
FILTER="`tail -n +2 def.csv | cut -d ',' -f 1,2,3 | sort | sed -e 's/\([-_a-z0-9]\+\),\([-_a-z0-9]\+\),\([-_a-z0-9]*\)/( \1=\2 and \3= ) or/' | tr '\n' ' ' | sed -e 's/ and =//g' | sed -e 's/ or \$//'`" | ||
osmconvert france-latest.osm.pbf -o=france-latest.o5m | ||
osmfilter france-latest.o5m --keep="$FILTER" -o=france-poi.o5m | ||
osmconvert france-poi.o5m --all-to-nodes --max-objects=1000000000 -o=france-poi-all-to-nodes.o5m | ||
osmfilter france-poi-all-to-nodes.o5m --keep="$FILTER" -o=france-poi.o5m | ||
KEY="`tail -n +2 def.csv | cut -d ',' -f 1 | sort -u | tr '\n' ' '`" | ||
osmconvert france-poi.o5m --csv="@id @lon @lat name $KEY" --csv-headline > poi.csv |
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,8 @@ | ||
psql < poi.sql | ||
tail -n +2 poi.csv | psql -c "COPY poi FROM STDIN WITH NULL ''" | ||
|
||
psql -c "SELECT AddGeometryColumn ('public','poi','geom',0,'POINT',2);" | ||
psql -c "UPDATE poi SET geom = ST_MakePoint(lon, lat);" | ||
psql -c "CREATE INDEX idx_poi_geom ON poi USING gist(geom);" | ||
|
||
psql < poi2addok.sql |
Oops, something went wrong.