From 39502df284b877ecd2e28f7a53e1c62f0a42ec5a Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Fri, 8 Apr 2016 13:29:46 -0400 Subject: [PATCH] Add borough to geojson output and USA.local labels --- helper/geojsonify.js | 3 +++ helper/labelSchema.js | 2 +- test/unit/helper/labelSchema.js | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/helper/geojsonify.js b/helper/geojsonify.js index a2dc3e2b..666ab60c 100644 --- a/helper/geojsonify.js +++ b/helper/geojsonify.js @@ -35,6 +35,9 @@ var DETAILS_PROPS = [ 'locality', 'locality_gid', 'locality_a', + 'borough', + 'borough_gid', + 'borough_a', 'neighbourhood', 'neighbourhood_gid', 'bounding_box' diff --git a/helper/labelSchema.js b/helper/labelSchema.js index 5d3eba5d..32207cba 100644 --- a/helper/labelSchema.js +++ b/helper/labelSchema.js @@ -3,7 +3,7 @@ var _ = require('lodash'), module.exports = { 'USA': { - 'local': getFirstProperty(['localadmin', 'locality', 'neighbourhood', 'county']), + 'local': getFirstProperty(['borough', 'localadmin', 'locality', 'neighbourhood', 'county']), 'regional': getUsState, 'country': getFirstProperty(['country_a']) }, diff --git a/test/unit/helper/labelSchema.js b/test/unit/helper/labelSchema.js index edbf2b77..fd5b7e91 100644 --- a/test/unit/helper/labelSchema.js +++ b/test/unit/helper/labelSchema.js @@ -772,6 +772,21 @@ module.exports.tests.default = function(test, common) { }); + test('USA.local borough should be shown if available', function(t) { + var record = { + borough: 'borough value', + region: 'region value', + region_a: 'region_a value', + country_a: 'country_a value' + }; + + var labelParts = ['initial value']; + + var f = schemas.USA.local; + + t.deepEqual(f(record, labelParts), ['initial value', 'borough value']); + t.end(); + }); }; module.exports.all = function (tape, common) {