summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/osm/osm.village.nat_ref.makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/osm/osm.village.nat_ref.makefile b/scripts/osm/osm.village.nat_ref.makefile
index 3937144..f763c19 100755
--- a/scripts/osm/osm.village.nat_ref.makefile
+++ b/scripts/osm/osm.village.nat_ref.makefile
@@ -33,14 +33,19 @@ matched.csv: data/VILLAGE_MOI_1081007.shp village.no_nat_ref.csv
33 FROM 'village.no_nat_ref' osm, '$<'.VILLAGE_MOI_1081007 gov \ 33 FROM 'village.no_nat_ref' osm, '$<'.VILLAGE_MOI_1081007 gov \
34 WHERE osm.name = gov.VILLNAME AND Intersects(gov.geometry, osm.geometry)" 34 WHERE osm.name = gov.VILLNAME AND Intersects(gov.geometry, osm.geometry)"
35 35
36matched.by_ref.csv: data/VILLAGE_MOI_1081007.shp village.with_nat_ref.csv 36village.gov.csv: data/VILLAGE_MOI_1081007.shp
37 ogr2ogr $@ $<
38
39matched.by_ref.csv: village.gov.csv village.with_nat_ref.csv
37 ogr2ogr $@ $(word 2,$^) \ 40 ogr2ogr $@ $(word 2,$^) \
38 -oo X_POSSIBLE_NAMES=X -oo Y_POSSIBLE_NAMES=Y \
39 -dialect sqlite \ 41 -dialect sqlite \
40 -sql "SELECT osm.osm_id, gov.* \ 42 -sql "SELECT osm.osm_id, gov.* \
41 FROM 'village.with_nat_ref' osm, '$<'.VILLAGE_MOI_1081007 gov \ 43 FROM 'village.with_nat_ref' osm, '$<'.'village.gov' gov \
42 WHERE osm.nat_ref = gov.VILLCODE" 44 WHERE osm.nat_ref = gov.VILLCODE"
43 45
46diff: matched.by_ref.csv
47 awk -F',' -v q='"' '{print (, "is_in:county", q{q, "is_in:town", q{})}" q, "name:en", q$6q }' $<
48
44confilct.list: matched.csv 49confilct.list: matched.csv
45 cat $< | cut -d',' -f2 | sort | uniq -d | xargs -I {} grep {} $< 50 cat $< | cut -d',' -f2 | sort | uniq -d | xargs -I {} grep {} $<
46 51