Skip to content
Browse files

print villages not found in nlsc features

  • Loading branch information...
1 parent 2a2e53b commit 955fcf1049cbcb2b0c1e0848a5eb663dc56660e8 @clkao clkao committed Apr 28, 2013
Showing with 10 additions and 2 deletions.
  1. +4 −0 Makefile
  2. +6 −2 cleanup-nlsc.ls
View
4 Makefile
@@ -62,3 +62,7 @@ county: twCounty1982.topo.json
clean-topo:
rm tw*.topo.json
+
+nlsc:
+ lsc cleanup-nlsc.ls > villages.json
+ ogr2ogr -f 'ESRI Shapefile' tmpdir/tw-fixed/ villages.json -lco ENCODING=UTF-8
View
8 cleanup-nlsc.ls
@@ -14,7 +14,7 @@ set = require \./raw/tw-2013-03
by-vid = {}
-f = set.features.map ({properties}:f) ->
+set.features.=map ({properties}:f) ->
return f if properties.TOWN is /\(海\)/
delete properties.V_ID if properties.V_ID is \10004010-021 # incorrect id
if properties.ET_ID is 7822
@@ -50,5 +50,9 @@ f = set.features.map ({properties}:f) ->
by-vid[properties.V_ID] = f
f
-set.features = f.filter -> it
+set.features.=filter -> it
+
+seen = {[V_ID, 1] for {properties:{V_ID}} in set.features when V_ID}
+for {id}:v in villages when !seen[id]
+ console.error "NOT FOUND", v<[county town name]>
console.log JSON.stringify set

0 comments on commit 955fcf1

Please sign in to comment.
Something went wrong with that request. Please try again.