Skip to content

Commit

Permalink
feat(build): rebuild from latest data
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Jul 10, 2018
1 parent 6f0f865 commit c5ed71a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cmd/jq.filter
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
test("^mz:(is_current|population)$"),
test("^gn:(population|pop)$"),
test("^zs:(pop10)$"),
test("^qs:(pop|gn_pop)$"),
test("^qs:(pop|gn_pop|photo_sum)$"),
test("^wk:(population)$"),
test("^meso:(pop)$"),
test("^statoids:(population)$"),
test("^misc:(photo_sum)$"),
test("^name:")
)
)
6 changes: 5 additions & 1 deletion cmd/wof_extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ function placetypeFilter {
}

# extract only the json properies from each file (eg: excluding zs:*)
find "${WOF_DIR}" -type f -name '*.geojson' | placetypeFilter | ${XARGS_CMD} ${JQ_BIN} -c -M -f "${DIR}/jq.filter";
# note: excludes 'alt' geometeries
find "${WOF_DIR}" -type f -name '*.geojson' |\
grep -E '/[0-9]+\.geojson$' |\
placetypeFilter |\
${XARGS_CMD} ${JQ_BIN} -c -M -f "${DIR}/jq.filter";
2 changes: 1 addition & 1 deletion prototype/wof.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function insertWofRecord( wof, next ){
abbr: getAbbreviation( wof ),
placetype: wof['wof:placetype'],
population: getPopulation( wof ),
popularity: wof['misc:photo_sum'],
popularity: wof['qs:photo_sum'],
lineage: wof['wof:hierarchy'],
geom: {
area: wof['geom:area'],
Expand Down
4 changes: 2 additions & 2 deletions test/prototype/wof.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ module.exports.store_popularity = function(test, util) {
test( 'popularity: exists', function(t) {
var mock = new Mock();
mock.insertWofRecord(params({
'misc:photo_sum': 100
'qs:photo_sum': 100
}), function(){
t.deepEqual( mock._calls.set[0][1].popularity, 100);
t.end();
Expand All @@ -226,7 +226,7 @@ module.exports.store_popularity = function(test, util) {
test( 'popularity: exists - as string', function(t) {
var mock = new Mock();
mock.insertWofRecord(params({
'misc:photo_sum': '100'
'qs:photo_sum': '100'
}), function(){
t.deepEqual( mock._calls.set[0][1].popularity, 100);
t.end();
Expand Down

0 comments on commit c5ed71a

Please sign in to comment.