diff --git a/config/venue_normalization.js b/config/venue_normalization.js new file mode 100644 index 00000000..72b27d5a --- /dev/null +++ b/config/venue_normalization.js @@ -0,0 +1,69 @@ + +/** + expansion and normalization of venue names to allow for consistent searching and more effective synonym use +**/ + +var mapping = [ + { + 'conditions': [ + ['railway', 'station'] + ], + 'synonyms': [ + 'train station', + 'station' + ], + 'suffix': 'railway station' + }, + { + 'conditions': [ + ['public_transport', 'station'], + ['station', 'light_rail'] + ], + 'synonyms': [ + 'light rail' + ], + 'suffix': 'light rail station' + }, + { + 'conditions': [ + ['public_transport', 'stop_position'], + ['ferry', 'yes'] + ], + 'synonyms': [ + 'ferry', + 'wharf', + ], + 'suffix': 'ferry terminal' + }, + { + 'conditions': [ + ['amenity', 'parking'] + ], + 'synonyms': [ + 'garage', + 'car park', + 'parking', + ], + 'suffix': 'car park' + } +]; + +/*{ + 'railway': { + 'station': { + 'alt_suffixes': ['station'], + 'suffix': 'Railway Station', + } + }, + 'station': { + 'light_rail': { + 'alt_suffixes': ['station', 'light rail'], + 'suffix': 'light rail station', + } + }, + 'public_transport': { + + } +};*/ + +module.exports = mapping; diff --git a/stream/importPipeline.js b/stream/importPipeline.js index a6d0a2f4..e23ed1b6 100644 --- a/stream/importPipeline.js +++ b/stream/importPipeline.js @@ -1,9 +1,11 @@ var categoryDefaults = require('../config/category_map'); +var venueNormalizations = require('../config/venue_normalization'); var streams = {}; streams.config = { - categoryDefaults: categoryDefaults + categoryDefaults: categoryDefaults, + venueNormalizations: venueNormalizations }; streams.pbfParser = require('./multiple_pbfs').create; @@ -13,6 +15,7 @@ streams.tagMapper = require('./tag_mapper'); streams.adminLookup = require('pelias-wof-admin-lookup').create; streams.addressExtractor = require('./address_extractor'); streams.categoryMapper = require('./category_mapper'); +streams.venueNormalization = require('./venue_normalization'); streams.dbMapper = require('pelias-model').createDocumentMapperStream; streams.elasticsearch = require('pelias-dbclient'); @@ -24,9 +27,10 @@ streams.import = function(){ .pipe( streams.addressExtractor() ) .pipe( streams.blacklistStream() ) .pipe( streams.categoryMapper( categoryDefaults ) ) + .pipe( streams.venueNormalization( venueNormalizations ) ) .pipe( streams.adminLookup() ) .pipe( streams.dbMapper() ) .pipe( streams.elasticsearch({name: 'openstreetmap'}) ); }; -module.exports = streams; +module.exports = streams; \ No newline at end of file diff --git a/stream/venue_normalization.js b/stream/venue_normalization.js new file mode 100644 index 00000000..9841d985 --- /dev/null +++ b/stream/venue_normalization.js @@ -0,0 +1,87 @@ + +/** + The venue normalization is similar to the category mapper + It's designed to add standardized aliases for different venue types to allow easier searching' +**/ + +var through = require('through2'); +var peliasLogger = require( 'pelias-logger' ).get( 'openstreetmap' ); + +module.exports = function( mapping ){ + + return through.obj( function( doc, enc, next ){ + + try { + + // do not normalize addresses + if( doc.getType().match('address') ){ + return next( null, doc ); + } + + // skip records with no tags + var tags = doc.getMeta('tags'); + if( !tags ){ + return next( null, doc ); + } + + var name = doc.getName( 'default' ); + if ( !name ) { + name = doc.getNameAliases( 'default' ); + } + if ( !name || name.legnth === 0 ){ + return next( null, doc ); + } + + // iterate over mapping + for( var idx in mapping ){ + var process = true; + var rule = mapping[idx]; + + loop_conditions: + for( var condition in rule.conditions ) { + var cond = rule.conditions[condition]; + + if( !tags.hasOwnProperty( cond[0] ) ) { + process = false; + break loop_conditions; + } + + if ( cond.length === 2 && cond[1] !== tags[ cond[0] ] ) + { + process = false; + break loop_conditions; + } + } + + if (!process) { + continue; + } + + var current_name = name; + + if( rule.hasOwnProperty( 'synonyms' ) ) { + for( var synonym_idx in rule.synonyms ) { + var synonym = rule.synonyms[synonym_idx]; + if( current_name.toLowerCase().endsWith( ' ' + synonym ) ) { + current_name = current_name.slice( 0, -synonym.length - 1 ); + } + } + } + + if( rule.hasOwnProperty( 'suffix' ) && current_name.length > 0 ){ + doc.setNameAlias( 'default', current_name + ' ' + rule.suffix ); + } + } + } + + catch( e ){ + peliasLogger.error( 'venue normalization error' ); + peliasLogger.error( e.stack ); + peliasLogger.error( JSON.stringify( doc, null, 2 ) ); + } + + return next( null, doc ); + + }); + +}; diff --git a/test/end-to-end.js b/test/end-to-end.js index d1642f9e..da064c8e 100644 --- a/test/end-to-end.js +++ b/test/end-to-end.js @@ -51,6 +51,7 @@ streams.pbfParser() .pipe( streams.tagMapper() ) .pipe( streams.addressExtractor() ) .pipe( streams.categoryMapper( streams.config.categoryDefaults ) ) + .pipe( streams.venueNormalization( streams.config.venueNormalizations ) ) .pipe( model.createDocumentMapperStream() ) .pipe( sink.obj(function (doc) { results.push(doc); diff --git a/test/fixtures/combined_vancouver_queens.json b/test/fixtures/combined_vancouver_queens.json index 35e32dea..c6512003 100644 --- a/test/fixtures/combined_vancouver_queens.json +++ b/test/fixtures/combined_vancouver_queens.json @@ -1745,10 +1745,16 @@ "_id": "node/1116400886", "data": { "name": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "phrase": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "center_point": { "lon": -123.139224, @@ -2379,10 +2385,16 @@ "_id": "node/1116405077", "data": { "name": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "phrase": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "center_point": { "lon": -123.138156, @@ -20342,10 +20354,16 @@ "_id": "node/1499615964", "data": { "name": { - "default": "Rocky Mountaineer Vancouver Station" + "default": [ + "Rocky Mountaineer Vancouver Station", + "Rocky Mountaineer Vancouver railway station" + ] }, "phrase": { - "default": "Rocky Mountaineer Vancouver Station" + "default": [ + "Rocky Mountaineer Vancouver Station", + "Rocky Mountaineer Vancouver railway station" + ] }, "address_parts": { "number": "1755", @@ -35764,10 +35782,16 @@ "_id": "node/2122824826", "data": { "name": { - "default": "Costco parking" + "default": [ + "Costco parking", + "Costco car park" + ] }, "phrase": { - "default": "Costco parking" + "default": [ + "Costco parking", + "Costco car park" + ] }, "center_point": { "lon": -123.110303, @@ -37919,10 +37943,16 @@ "_id": "node/2310467891", "data": { "name": { - "default": "Yaletown-Roundhouse" + "default": [ + "Yaletown-Roundhouse", + "Yaletown-Roundhouse railway station" + ] }, "phrase": { - "default": "Yaletown-Roundhouse" + "default": [ + "Yaletown-Roundhouse", + "Yaletown-Roundhouse railway station" + ] }, "center_point": { "lon": -123.122009, @@ -44579,10 +44609,16 @@ "_id": "node/25325837", "data": { "name": { - "default": "VCC-Clark" + "default": [ + "VCC-Clark", + "VCC-Clark railway station" + ] }, "phrase": { - "default": "VCC-Clark" + "default": [ + "VCC-Clark", + "VCC-Clark railway station" + ] }, "center_point": { "lon": -123.078985, @@ -44604,10 +44640,16 @@ "_id": "node/25325841", "data": { "name": { - "default": "Renfrew Station" + "default": [ + "Renfrew Station", + "Renfrew railway station" + ] }, "phrase": { - "default": "Renfrew Station" + "default": [ + "Renfrew Station", + "Renfrew railway station" + ] }, "center_point": { "lon": -123.045556, @@ -67041,10 +67083,16 @@ "_id": "node/25751159", "data": { "name": { - "default": "Main Street-Science World Station" + "default": [ + "Main Street-Science World Station", + "Main Street-Science World railway station" + ] }, "phrase": { - "default": "Main Street-Science World Station" + "default": [ + "Main Street-Science World Station", + "Main Street-Science World railway station" + ] }, "center_point": { "lon": -123.100449, @@ -70686,10 +70734,16 @@ "_id": "node/2720126176", "data": { "name": { - "default": "Burrard" + "default": [ + "Burrard", + "Burrard railway station" + ] }, "phrase": { - "default": "Burrard" + "default": [ + "Burrard", + "Burrard railway station" + ] }, "center_point": { "lon": -123.119776, @@ -70711,10 +70765,16 @@ "_id": "node/2720126179", "data": { "name": { - "default": "Granville" + "default": [ + "Granville", + "Granville railway station" + ] }, "phrase": { - "default": "Granville" + "default": [ + "Granville", + "Granville railway station" + ] }, "center_point": { "lon": -123.116237, @@ -70736,10 +70796,16 @@ "_id": "node/2720126183", "data": { "name": { - "default": "Waterfront Station" + "default": [ + "Waterfront Station", + "Waterfront railway station" + ] }, "phrase": { - "default": "Waterfront Station" + "default": [ + "Waterfront Station", + "Waterfront railway station" + ] }, "center_point": { "lon": -123.112134, @@ -70813,10 +70879,16 @@ "_id": "node/2720229330", "data": { "name": { - "default": "Stadium-Chinatown" + "default": [ + "Stadium-Chinatown", + "Stadium-Chinatown railway station" + ] }, "phrase": { - "default": "Stadium-Chinatown" + "default": [ + "Stadium-Chinatown", + "Stadium-Chinatown railway station" + ] }, "center_point": { "lon": -123.109173, @@ -70838,10 +70910,16 @@ "_id": "node/2720250789", "data": { "name": { - "default": "Commercial-Broadway Station" + "default": [ + "Commercial-Broadway Station", + "Commercial-Broadway railway station" + ] }, "phrase": { - "default": "Commercial-Broadway Station" + "default": [ + "Commercial-Broadway Station", + "Commercial-Broadway railway station" + ] }, "center_point": { "lon": -123.069042, @@ -70863,10 +70941,16 @@ "_id": "node/2720250798", "data": { "name": { - "default": "Nanaimo Station" + "default": [ + "Nanaimo Station", + "Nanaimo railway station" + ] }, "phrase": { - "default": "Nanaimo Station" + "default": [ + "Nanaimo Station", + "Nanaimo railway station" + ] }, "center_point": { "lon": -123.055948, @@ -70888,10 +70972,16 @@ "_id": "node/2720256092", "data": { "name": { - "default": "29th Avenue Station" + "default": [ + "29th Avenue Station", + "29th Avenue railway station" + ] }, "phrase": { - "default": "29th Avenue Station" + "default": [ + "29th Avenue Station", + "29th Avenue railway station" + ] }, "center_point": { "lon": -123.04586, @@ -70913,10 +71003,16 @@ "_id": "node/2720260918", "data": { "name": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "phrase": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "center_point": { "lon": -123.031884, @@ -70938,10 +71034,16 @@ "_id": "node/2720270388", "data": { "name": { - "default": "Oakridge-41st Avenue Station" + "default": [ + "Oakridge-41st Avenue Station", + "Oakridge-41st Avenue railway station" + ] }, "phrase": { - "default": "Oakridge-41st Avenue Station" + "default": [ + "Oakridge-41st Avenue Station", + "Oakridge-41st Avenue railway station" + ] }, "center_point": { "lon": -123.11624, @@ -116200,10 +116302,16 @@ "_id": "node/2926318356", "data": { "name": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "phrase": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "center_point": { "lon": -123.031805, @@ -120889,10 +120997,16 @@ "_id": "node/3072748937", "data": { "name": { - "default": "Waterfront" + "default": [ + "Waterfront", + "Waterfront railway station" + ] }, "phrase": { - "default": "Waterfront" + "default": [ + "Waterfront", + "Waterfront railway station" + ] }, "center_point": { "lon": -123.113226, @@ -123166,10 +123280,16 @@ "_id": "node/324334016", "data": { "name": { - "default": "Hollis" + "default": [ + "Hollis", + "Hollis railway station" + ] }, "phrase": { - "default": "Hollis" + "default": [ + "Hollis", + "Hollis railway station" + ] }, "center_point": { "lon": -73.766668, @@ -126439,10 +126559,16 @@ "_id": "node/3452488798", "data": { "name": { - "default": "West Park Public Parking" + "default": [ + "West Park Public Parking", + "West Park Public car park" + ] }, "phrase": { - "default": "West Park Public Parking" + "default": [ + "West Park Public Parking", + "West Park Public car park" + ] }, "address_parts": { "number": "1495", @@ -129894,10 +130020,16 @@ "_id": "node/393643280", "data": { "name": { - "default": "Rupert Station" + "default": [ + "Rupert Station", + "Rupert railway station" + ] }, "phrase": { - "default": "Rupert Station" + "default": [ + "Rupert Station", + "Rupert railway station" + ] }, "center_point": { "lon": -123.033257, @@ -130326,10 +130458,16 @@ "_id": "node/430022553", "data": { "name": { - "default": "Vancouver City Centre Station" + "default": [ + "Vancouver City Centre Station", + "Vancouver City Centre railway station" + ] }, "phrase": { - "default": "Vancouver City Centre Station" + "default": [ + "Vancouver City Centre Station", + "Vancouver City Centre railway station" + ] }, "center_point": { "lon": -123.11893, @@ -130351,10 +130489,16 @@ "_id": "node/430022615", "data": { "name": { - "default": "Olympic Village" + "default": [ + "Olympic Village", + "Olympic Village railway station" + ] }, "phrase": { - "default": "Olympic Village" + "default": [ + "Olympic Village", + "Olympic Village railway station" + ] }, "center_point": { "lon": -123.115448, @@ -130376,10 +130520,16 @@ "_id": "node/430022629", "data": { "name": { - "default": "Broadway - City Hall" + "default": [ + "Broadway - City Hall", + "Broadway - City Hall railway station" + ] }, "phrase": { - "default": "Broadway - City Hall" + "default": [ + "Broadway - City Hall", + "Broadway - City Hall railway station" + ] }, "center_point": { "lon": -123.114739, @@ -130401,10 +130551,16 @@ "_id": "node/430022636", "data": { "name": { - "default": "King Edward" + "default": [ + "King Edward", + "King Edward railway station" + ] }, "phrase": { - "default": "King Edward" + "default": [ + "King Edward", + "King Edward railway station" + ] }, "center_point": { "lon": -123.115329, @@ -130426,10 +130582,16 @@ "_id": "node/430022664", "data": { "name": { - "default": "Langara-49th Avenue Station" + "default": [ + "Langara-49th Avenue Station", + "Langara-49th Avenue railway station" + ] }, "phrase": { - "default": "Langara-49th Avenue Station" + "default": [ + "Langara-49th Avenue Station", + "Langara-49th Avenue railway station" + ] }, "center_point": { "lon": -123.116495, @@ -130451,10 +130613,16 @@ "_id": "node/430022715", "data": { "name": { - "default": "Marine Drive" + "default": [ + "Marine Drive", + "Marine Drive railway station" + ] }, "phrase": { - "default": "Marine Drive" + "default": [ + "Marine Drive", + "Marine Drive railway station" + ] }, "center_point": { "lon": -123.116903, @@ -130476,10 +130644,16 @@ "_id": "node/430025257", "data": { "name": { - "default": "Bridgeport" + "default": [ + "Bridgeport", + "Bridgeport railway station" + ] }, "phrase": { - "default": "Bridgeport" + "default": [ + "Bridgeport", + "Bridgeport railway station" + ] }, "center_point": { "lon": -123.126018, @@ -130501,10 +130675,16 @@ "_id": "node/430025268", "data": { "name": { - "default": "Templeton" + "default": [ + "Templeton", + "Templeton railway station" + ] }, "phrase": { - "default": "Templeton" + "default": [ + "Templeton", + "Templeton railway station" + ] }, "center_point": { "lon": -123.146425, @@ -144080,10 +144260,16 @@ "_id": "node/736729129", "data": { "name": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "phrase": { - "default": "Impark" + "default": [ + "Impark", + "Impark car park" + ] }, "center_point": { "lon": -123.11497, @@ -144194,10 +144380,16 @@ "_id": "node/741418452", "data": { "name": { - "default": "Parkwell (Seymour entrance)" + "default": [ + "Parkwell (Seymour entrance)", + "Parkwell (Seymour entrance) car park" + ] }, "phrase": { - "default": "Parkwell (Seymour entrance)" + "default": [ + "Parkwell (Seymour entrance)", + "Parkwell (Seymour entrance) car park" + ] }, "center_point": { "lon": -123.116268, @@ -144214,10 +144406,16 @@ "_id": "node/741418457", "data": { "name": { - "default": "Parkwell (Richards entrance)" + "default": [ + "Parkwell (Richards entrance)", + "Parkwell (Richards entrance) car park" + ] }, "phrase": { - "default": "Parkwell (Richards entrance)" + "default": [ + "Parkwell (Richards entrance)", + "Parkwell (Richards entrance) car park" + ] }, "center_point": { "lon": -123.115281, @@ -148356,10 +148554,16 @@ "_id": "node/822487113", "data": { "name": { - "default": "Sun Sui Wah Parking Entrance" + "default": [ + "Sun Sui Wah Parking Entrance", + "Sun Sui Wah Parking Entrance car park" + ] }, "phrase": { - "default": "Sun Sui Wah Parking Entrance" + "default": [ + "Sun Sui Wah Parking Entrance", + "Sun Sui Wah Parking Entrance car park" + ] }, "center_point": { "lon": -123.10043, @@ -159059,6 +159263,777 @@ "source_id": "node/998895939" } }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1249530", + "data": { + "name": { + "default": "Biological Sciences" + }, + "phrase": { + "default": "Biological Sciences" + }, + "center_point": { + "lon": -123.252073, + "lat": 49.26466 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1249530", + "bounding_box": "{\"min_lat\":49.2637232,\"max_lat\":49.2650869,\"min_lon\":-123.2521456,\"max_lon\":-123.2504313}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1414693", + "data": { + "name": { + "default": "St. James Building" + }, + "phrase": { + "default": "St. James Building" + }, + "center_point": { + "lon": -123.237244, + "lat": 49.258204 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1414693", + "bounding_box": "{\"min_lat\":49.2578312,\"max_lat\":49.2586211,\"min_lon\":-123.2379569,\"max_lon\":-123.2364634}" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/1414902", + "data": { + "name": { + "default": "4004 Wesbrook Mall" + }, + "phrase": { + "default": "4004 Wesbrook Mall" + }, + "address_parts": { + "number": "4004", + "street": "Wesbrook Mall" + }, + "center_point": { + "lon": -123.230703, + "lat": 49.247648 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/1414902" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1414902", + "data": { + "name": { + "default": "TRIUMF MOB" + }, + "phrase": { + "default": "TRIUMF MOB" + }, + "address_parts": { + "number": "4004", + "street": "Wesbrook Mall" + }, + "center_point": { + "lon": -123.230703, + "lat": 49.247648 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1414902", + "bounding_box": "{\"min_lat\":49.2473937,\"max_lat\":49.2478749,\"min_lon\":-123.2309654,\"max_lon\":-123.2301584}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1414968", + "data": { + "name": { + "default": "Thames Court" + }, + "phrase": { + "default": "Thames Court" + }, + "center_point": { + "lon": -123.236179, + "lat": 49.256587 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1414968", + "bounding_box": "{\"min_lat\":49.256485,\"max_lat\":49.2574398,\"min_lon\":-123.2372829,\"max_lon\":-123.2347479}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1414970", + "data": { + "name": { + "default": "Sandringham" + }, + "phrase": { + "default": "Sandringham" + }, + "center_point": { + "lon": -123.233418, + "lat": 49.258421 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1414970", + "bounding_box": "{\"min_lat\":49.2575465,\"max_lat\":49.2587334,\"min_lon\":-123.2345583,\"max_lon\":-123.2324489}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1414971", + "data": { + "name": { + "default": "West Hampstead" + }, + "phrase": { + "default": "West Hampstead" + }, + "center_point": { + "lon": -123.235308, + "lat": 49.257193 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1414971", + "bounding_box": "{\"min_lat\":49.2567199,\"max_lat\":49.2577534,\"min_lon\":-123.235789,\"max_lon\":-123.2347479}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416479", + "data": { + "name": { + "default": "Fairview Crescent" + }, + "phrase": { + "default": "Fairview Crescent" + }, + "center_point": { + "lon": -123.240157, + "lat": 49.262953 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416479", + "bounding_box": "{\"min_lat\":49.2624251,\"max_lat\":49.2633248,\"min_lon\":-123.2413768,\"max_lon\":-123.2391369}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416490", + "data": { + "name": { + "default": "Acadia Park Residences" + }, + "phrase": { + "default": "Acadia Park Residences" + }, + "center_point": { + "lon": -123.236516, + "lat": 49.264256 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416490", + "bounding_box": "{\"min_lat\":49.2626545,\"max_lat\":49.265861,\"min_lon\":-123.2378345,\"max_lon\":-123.2351932}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416491", + "data": { + "name": { + "default": "Child Care Services" + }, + "phrase": { + "default": "Child Care Services" + }, + "center_point": { + "lon": -123.23445, + "lat": 49.259557 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416491", + "bounding_box": "{\"min_lat\":49.2591537,\"max_lat\":49.259898,\"min_lon\":-123.2356188,\"max_lon\":-123.2332764}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416614", + "data": { + "name": { + "default": "Nitobe Memorial Garden" + }, + "phrase": { + "default": "Nitobe Memorial Garden" + }, + "center_point": { + "lon": -123.260024, + "lat": 49.266938 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416614", + "bounding_box": "{\"min_lat\":49.2655713,\"max_lat\":49.2670378,\"min_lon\":-123.2602038,\"max_lon\":-123.2588529}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416615", + "data": { + "name": { + "default": "Place Vanier" + }, + "phrase": { + "default": "Place Vanier" + }, + "center_point": { + "lon": -123.259058, + "lat": 49.263499 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416615", + "bounding_box": "{\"min_lat\":49.262938,\"max_lat\":49.2653801,\"min_lon\":-123.2603353,\"max_lon\":-123.2567204}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1416616", + "data": { + "name": { + "default": "Totem Park Residence" + }, + "phrase": { + "default": "Totem Park Residence" + }, + "center_point": { + "lon": -123.252148, + "lat": 49.258785 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1416616", + "bounding_box": "{\"min_lat\":49.2570604,\"max_lat\":49.2599669,\"min_lon\":-123.2533869,\"max_lon\":-123.2514683}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1418094", + "data": { + "name": { + "default": "Thunderbird Residence" + }, + "phrase": { + "default": "Thunderbird Residence" + }, + "center_point": { + "lon": -123.251056, + "lat": 49.259903 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1418094", + "bounding_box": "{\"min_lat\":49.2585142,\"max_lat\":49.260036,\"min_lon\":-123.2515809,\"max_lon\":-123.2493271}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1418110", + "data": { + "name": { + "default": "Hawthorn Place" + }, + "phrase": { + "default": "Hawthorn Place" + }, + "center_point": { + "lon": -123.248281, + "lat": 49.259285 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1418110", + "bounding_box": "{\"min_lat\":49.2585142,\"max_lat\":49.2600625,\"min_lon\":-123.2506093,\"max_lon\":-123.2459556}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1420040", + "data": { + "name": { + "default": "Instructional Resources Centre" + }, + "phrase": { + "default": "Instructional Resources Centre" + }, + "center_point": { + "lon": -123.24634, + "lat": 49.264994 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1420040", + "bounding_box": "{\"min_lat\":49.2644543,\"max_lat\":49.2651477,\"min_lon\":-123.247425,\"max_lon\":-123.2462502}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1420041", + "data": { + "name": { + "default": "Woodward Library" + }, + "phrase": { + "default": "Woodward Library" + }, + "center_point": { + "lon": -123.247925, + "lat": 49.264554 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1420041", + "bounding_box": "{\"min_lat\":49.264304,\"max_lat\":49.2648185,\"min_lon\":-123.247971,\"max_lon\":-123.2471822}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424726", + "data": { + "name": { + "default": "Mary Murrin Hall" + }, + "phrase": { + "default": "Mary Murrin Hall" + }, + "center_point": { + "lon": -123.258209, + "lat": 49.270603 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424726", + "bounding_box": "{\"min_lat\":49.2703082,\"max_lat\":49.2706431,\"min_lon\":-123.2582184,\"max_lon\":-123.2578217}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424727", + "data": { + "name": { + "default": "Anne Wesbrook Hall" + }, + "phrase": { + "default": "Anne Wesbrook Hall" + }, + "center_point": { + "lon": -123.258288, + "lat": 49.269948 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424727", + "bounding_box": "{\"min_lat\":49.2699212,\"max_lat\":49.2702206,\"min_lon\":-123.258332,\"max_lon\":-123.2576257}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424728", + "data": { + "name": { + "default": "Anthropology And Sociology Building" + }, + "phrase": { + "default": "Anthropology And Sociology Building" + }, + "center_point": { + "lon": -123.257158, + "lat": 49.270367 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424728", + "bounding_box": "{\"min_lat\":49.2701017,\"max_lat\":49.2704394,\"min_lon\":-123.2578217,\"max_lon\":-123.2570518}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424987", + "data": { + "name": { + "default": [ + "University of British Columbia", + "UBC" + ] + }, + "phrase": { + "default": [ + "University of British Columbia", + "UBC" + ] + }, + "center_point": { + "lon": -123.256728, + "lat": 49.260257 + }, + "category": [ + "education" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424987", + "bounding_box": "{\"min_lat\":49.2538559,\"max_lat\":49.2667964,\"min_lon\":-123.2607478,\"max_lon\":-123.2517239}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424992", + "data": { + "name": { + "default": "UBC Endowment Lands" + }, + "phrase": { + "default": "UBC Endowment Lands" + }, + "center_point": { + "lon": -123.219093, + "lat": 49.258771 + }, + "category": [ + "natural", + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424992", + "bounding_box": "{\"min_lat\":49.2577478,\"max_lat\":49.2603602,\"min_lon\":-123.2334057,\"max_lon\":-123.2189678}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1424998", + "data": { + "name": { + "default": "Green College" + }, + "phrase": { + "default": "Green College" + }, + "center_point": { + "lon": -123.256859, + "lat": 49.272005 + }, + "category": [ + "education" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1424998", + "bounding_box": "{\"min_lat\":49.271015,\"max_lat\":49.2720328,\"min_lon\":-123.2590805,\"max_lon\":-123.2547057}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1425001", + "data": { + "name": { + "default": "Shaughnessy Golf Course" + }, + "phrase": { + "default": "Shaughnessy Golf Course" + }, + "center_point": { + "lon": -123.203715, + "lat": 49.230837 + }, + "category": [ + "recreation", + "entertainment" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1425001", + "bounding_box": "{\"min_lat\":49.2300238,\"max_lat\":49.2377131,\"min_lon\":-123.2213403,\"max_lon\":-123.1973157}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1425002", + "data": { + "name": { + "default": "UBC Botanical Garden" + }, + "phrase": { + "default": "UBC Botanical Garden" + }, + "center_point": { + "lon": -123.248247, + "lat": 49.250858 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1425002", + "bounding_box": "{\"min_lat\":49.2490696,\"max_lat\":49.2538559,\"min_lon\":-123.2517239,\"max_lon\":-123.2440188}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1425006", + "data": { + "name": { + "default": "Pacific Spirit Regional Park" + }, + "phrase": { + "default": "Pacific Spirit Regional Park" + }, + "center_point": { + "lon": -123.196914, + "lat": 49.239217 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1425006", + "bounding_box": "{\"min_lat\":49.2353223,\"max_lat\":49.2492503,\"min_lon\":-123.205551,\"max_lon\":-123.196859}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1527960", + "data": { + "name": { + "default": "Crescent West" + }, + "phrase": { + "default": "Crescent West" + }, + "center_point": { + "lon": -123.232814, + "lat": 49.253241 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1527960", + "bounding_box": "{\"min_lat\":49.2527994,\"max_lat\":49.253513,\"min_lon\":-123.2334725,\"max_lon\":-123.2320791}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1613140", + "data": { + "name": { + "default": "Iona Beach Regional Park" + }, + "phrase": { + "default": "Iona Beach Regional Park" + }, + "center_point": { + "lon": -123.255619, + "lat": 49.207097 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1613140", + "bounding_box": "{\"min_lat\":49.2047756,\"max_lat\":49.2167457,\"min_lon\":-123.264222,\"max_lon\":-123.2016117}" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/1671051", + "data": { + "name": { + "default": "2075 Kingsway" + }, + "phrase": { + "default": "2075 Kingsway" + }, + "address_parts": { + "number": "2075", + "street": "Kingsway" + }, + "center_point": { + "lon": -123.063685, + "lat": 49.244914 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/1671051" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/1671051", + "data": { + "name": { + "default": "Days Inn - Vancouver Metro" + }, + "phrase": { + "default": "Days Inn - Vancouver Metro" + }, + "address_parts": { + "number": "2075", + "street": "Kingsway" + }, + "center_point": { + "lon": -123.063685, + "lat": 49.244914 + }, + "category": [ + "accommodation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/1671051", + "bounding_box": "{\"min_lat\":49.2446708,\"max_lat\":49.2453123,\"min_lon\":-123.0640355,\"max_lon\":-123.0631808}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/2061512", + "data": { + "name": { + "default": "Tower Beach" + }, + "phrase": { + "default": "Tower Beach" + }, + "center_point": { + "lon": -123.264763, + "lat": 49.266153 + }, + "category": [ + "natural", + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/2061512", + "bounding_box": "{\"min_lat\":49.2646772,\"max_lat\":49.2690487,\"min_lon\":-123.2654851,\"max_lon\":-123.2632639}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/2061525", + "data": { + "name": { + "default": "Iona Beach" + }, + "phrase": { + "default": "Iona Beach" + }, + "center_point": { + "lon": -123.214557, + "lat": 49.221007 + }, + "category": [ + "natural", + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/2061525", + "bounding_box": "{\"min_lat\":49.2159065,\"max_lat\":49.2224913,\"min_lon\":-123.2192177,\"max_lon\":-123.2141655}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/2140438", + "data": { + "name": { + "default": "Albion Fisheries Ltd" + }, + "phrase": { + "default": "Albion Fisheries Ltd" + }, + "center_point": { + "lon": -123.081439, + "lat": 49.265747 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/2140438", + "bounding_box": "{\"min_lat\":49.2653765,\"max_lat\":49.266638,\"min_lon\":-123.0839695,\"max_lon\":-123.081434}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/2140439", + "data": { + "name": { + "default": "Discovery Parks" + }, + "phrase": { + "default": "Discovery Parks" + }, + "center_point": { + "lon": -123.086391, + "lat": 49.266943 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/2140439", + "bounding_box": "{\"min_lat\":49.2658448,\"max_lat\":49.267302,\"min_lon\":-123.0864903,\"max_lon\":-123.0836115}" + } + }, { "_index": "pelias", "_type": "venue", @@ -159071,8 +160046,8 @@ "default": "Hadden Park" }, "center_point": { - "lon": -123.147814, - "lat": 49.278196 + "lon": -123.154068, + "lat": 49.275396 }, "category": [ "recreation" @@ -159080,7 +160055,268 @@ "source": "openstreetmap", "layer": "venue", "source_id": "relation/2330465", - "bounding_box": "{\"min_lat\":49.2768218,\"max_lat\":49.2792055,\"min_lon\":-123.150091,\"max_lon\":-123.1460737}" + "bounding_box": "{\"min_lat\":49.273643,\"max_lat\":49.2777511,\"min_lon\":-123.1566728,\"max_lon\":-123.1518266}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/2330466", + "data": { + "name": { + "default": "Kitsilano Beach" + }, + "phrase": { + "default": "Kitsilano Beach" + }, + "center_point": { + "lon": -123.153629, + "lat": 49.274857 + }, + "category": [ + "natural", + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/2330466", + "bounding_box": "{\"min_lat\":49.2735538,\"max_lat\":49.2777511,\"min_lon\":-123.1566728,\"max_lon\":-123.1517448}" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/3274518", + "data": { + "name": { + "default": "2146 Health Sciences Mall" + }, + "phrase": { + "default": "2146 Health Sciences Mall" + }, + "address_parts": { + "number": "2146", + "street": "Health Sciences Mall", + "zip": "V6T 1Z3" + }, + "center_point": { + "lon": -123.247433, + "lat": 49.265539 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/3274518" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/3274518", + "data": { + "name": { + "default": "D.H. Copp Building" + }, + "phrase": { + "default": "D.H. Copp Building" + }, + "address_parts": { + "number": "2146", + "zip": "V6T 1Z3", + "street": "Health Sciences Mall" + }, + "center_point": { + "lon": -123.247433, + "lat": 49.265539 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/3274518", + "bounding_box": "{\"min_lat\":49.2652481,\"max_lat\":49.2657471,\"min_lon\":-123.2482981,\"max_lon\":-123.2467844}" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/3579391", + "data": { + "name": { + "default": "350 Nanaimo Street" + }, + "phrase": { + "default": "350 Nanaimo Street" + }, + "address_parts": { + "number": "350", + "street": "Nanaimo Street" + }, + "center_point": { + "lon": -123.056185, + "lat": 49.281486 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/3579391" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/3579448", + "data": { + "name": { + "default": "Discovery Square" + }, + "phrase": { + "default": "Discovery Square" + }, + "center_point": { + "lon": -123.120711, + "lat": 49.285916 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/3579448", + "bounding_box": "{\"min_lat\":49.2855507,\"max_lat\":49.2859746,\"min_lon\":-123.1210827,\"max_lon\":-123.1196913}" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/3757027", + "data": { + "name": { + "default": "207-01 116th Avenue" + }, + "phrase": { + "default": "207-01 116th Avenue" + }, + "address_parts": { + "number": "207-01", + "street": "116th Avenue", + "zip": "11411" + }, + "center_point": { + "lon": -73.746088, + "lat": 40.698408 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/3757027" + } + }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/4055271", + "data": { + "name": { + "default": "1950 East Pender Street" + }, + "phrase": { + "default": "1950 East Pender Street" + }, + "address_parts": { + "number": "1950", + "street": "East Pender Street", + "zip": "V5L 1T7" + }, + "center_point": { + "lon": -123.064779, + "lat": 49.280655 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/4055271" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4055271", + "data": { + "name": { + "default": "Sir William Macdonald Elementary School" + }, + "phrase": { + "default": "Sir William Macdonald Elementary School" + }, + "address_parts": { + "number": "1950", + "zip": "V5L 1T7", + "street": "East Pender Street" + }, + "center_point": { + "lon": -123.064779, + "lat": 49.280655 + }, + "category": [ + "education" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4055271", + "bounding_box": "{\"min_lat\":49.2804302,\"max_lat\":49.2807812,\"min_lon\":-123.0649937,\"max_lon\":-123.0643952}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4247717", + "data": { + "name": { + "default": "Livingstone Lake" + }, + "phrase": { + "default": "Livingstone Lake" + }, + "center_point": { + "lon": -123.131202, + "lat": 49.240066 + }, + "category": [ + "natural", + "natural:water", + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4247717", + "bounding_box": "{\"min_lat\":49.2396215,\"max_lat\":49.2404099,\"min_lon\":-123.1319651,\"max_lon\":-123.1305508}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4308097", + "data": { + "name": { + "default": [ + "Floatplane Terminal", + "Vancouver Harbour Water Airport" + ] + }, + "phrase": { + "default": [ + "Floatplane Terminal", + "Vancouver Harbour Water Airport" + ] + }, + "center_point": { + "lon": -123.117614, + "lat": 49.290605 + }, + "category": [ + "transport", + "transport:air", + "transport:air:aerodrome" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4308097", + "bounding_box": "{\"min_lat\":49.2901658,\"max_lat\":49.29132,\"min_lon\":-123.1185457,\"max_lon\":-123.1161353}" } }, { @@ -159108,6 +160344,30 @@ "bounding_box": "{\"min_lat\":40.7125991,\"max_lat\":40.7147609,\"min_lon\":-73.7285606,\"max_lon\":-73.7280813}" } }, + { + "_index": "pelias", + "_type": "address", + "_id": "relation/4600827", + "data": { + "name": { + "default": "1856 Frances Street" + }, + "phrase": { + "default": "1856 Frances Street" + }, + "address_parts": { + "number": "1856", + "street": "Frances Street" + }, + "center_point": { + "lon": -123.067147, + "lat": 49.27898 + }, + "source": "openstreetmap", + "layer": "address", + "source_id": "relation/4600827" + } + }, { "_index": "pelias", "_type": "venue", @@ -159158,6 +160418,196 @@ "bounding_box": "{\"min_lat\":40.7173243,\"max_lat\":40.7178436,\"min_lon\":-73.7373096,\"max_lon\":-73.7351722}" } }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4606374", + "data": { + "name": { + "default": "Hollis" + }, + "phrase": { + "default": "Hollis" + }, + "center_point": { + "lon": -73.766625, + "lat": 40.710116 + }, + "category": [ + "transport", + "transport:public" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4606374", + "bounding_box": "{\"min_lat\":40.7099346,\"max_lat\":40.7102894,\"min_lon\":-73.7673412,\"max_lon\":-73.7659868}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4761998", + "data": { + "name": { + "default": "Larchway Apartments" + }, + "phrase": { + "default": "Larchway Apartments" + }, + "center_point": { + "lon": -123.16131, + "lat": 49.264223 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4761998", + "bounding_box": "{\"min_lat\":49.2641425,\"max_lat\":49.2643333,\"min_lon\":-123.1615745,\"max_lon\":-123.1610401}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4849765", + "data": { + "name": { + "default": [ + "Faculty/Staff Parking", + "Faculty/Staff car park" + ] + }, + "phrase": { + "default": [ + "Faculty/Staff Parking", + "Faculty/Staff car park" + ] + }, + "center_point": { + "lon": -123.247558, + "lat": 49.267103 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4849765", + "bounding_box": "{\"min_lat\":49.266851,\"max_lat\":49.2672366,\"min_lon\":-123.2485071,\"max_lon\":-123.2474286}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4849767", + "data": { + "name": { + "default": "Student Union Building (SUB)" + }, + "phrase": { + "default": "Student Union Building (SUB)" + }, + "center_point": { + "lon": -123.250026, + "lat": 49.267375 + }, + "category": [ + "education" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4849767", + "bounding_box": "{\"min_lat\":49.2669588,\"max_lat\":49.2679039,\"min_lon\":-123.2508548,\"max_lon\":-123.2492829}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/4849820", + "data": { + "name": { + "default": "Aquatic Centre" + }, + "phrase": { + "default": "Aquatic Centre" + }, + "center_point": { + "lon": -123.249075, + "lat": 49.266891 + }, + "category": [ + "education" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/4849820", + "bounding_box": "{\"min_lat\":49.2665164,\"max_lat\":49.2672028,\"min_lon\":-123.2496271,\"max_lon\":-123.248532}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/6065926", + "data": { + "name": { + "default": "Eagles Claw Nature Reserve" + }, + "phrase": { + "default": "Eagles Claw Nature Reserve" + }, + "center_point": { + "lon": 149.916861, + "lat": -37.073025 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/6065926", + "bounding_box": "{\"min_lat\":-37.0731045,\"max_lat\":-37.0724824,\"min_lon\":149.916216,\"max_lon\":149.9172153}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/6066041", + "data": { + "name": { + "default": "Five Islands Nature Reserve" + }, + "phrase": { + "default": "Five Islands Nature Reserve" + }, + "center_point": { + "lon": 150.934411, + "lat": -34.493565 + }, + "category": [ + "recreation" + ], + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/6066041", + "bounding_box": "{\"min_lat\":-34.493577,\"max_lat\":-34.4932432,\"min_lon\":150.933553,\"max_lon\":150.9353367}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "relation/87022", + "data": { + "name": { + "default": "Fraser River (North Arm)" + }, + "phrase": { + "default": "Fraser River (North Arm)" + }, + "center_point": { + "lon": -123.157066, + "lat": 49.211261 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "relation/87022", + "bounding_box": "{\"min_lat\":49.1996686,\"max_lat\":49.22269,\"min_lon\":-123.2019788,\"max_lon\":-123.131594}" + } + }, { "_index": "pelias", "_type": "address", @@ -160920,10 +162370,16 @@ "_id": "way/115937407", "data": { "name": { - "default": "EasyPark, lot 10" + "default": [ + "EasyPark, lot 10", + "EasyPark, lot 10 car park" + ] }, "phrase": { - "default": "EasyPark, lot 10" + "default": [ + "EasyPark, lot 10", + "EasyPark, lot 10 car park" + ] }, "center_point": { "lon": -123.131516, @@ -161358,10 +162814,16 @@ "_id": "way/121143035", "data": { "name": { - "default": "EasyPark - lot 12" + "default": [ + "EasyPark - lot 12", + "EasyPark - lot 12 car park" + ] }, "phrase": { - "default": "EasyPark - lot 12" + "default": [ + "EasyPark - lot 12", + "EasyPark - lot 12 car park" + ] }, "center_point": { "lon": -123.119442, @@ -161804,10 +163266,16 @@ "_id": "way/125715570", "data": { "name": { - "default": "Walmart Supercentre Parking" + "default": [ + "Walmart Supercentre Parking", + "Walmart Supercentre car park" + ] }, "phrase": { - "default": "Walmart Supercentre Parking" + "default": [ + "Walmart Supercentre Parking", + "Walmart Supercentre car park" + ] }, "center_point": { "lon": -123.027557, @@ -162660,10 +164128,16 @@ "_id": "way/135493881", "data": { "name": { - "default": "Broadway - City Hall" + "default": [ + "Broadway - City Hall", + "Broadway - City Hall railway station" + ] }, "phrase": { - "default": "Broadway - City Hall" + "default": [ + "Broadway - City Hall", + "Broadway - City Hall railway station" + ] }, "center_point": { "lon": -123.114492, @@ -165667,10 +167141,16 @@ "_id": "way/156136378", "data": { "name": { - "default": "Knox Church" + "default": [ + "Knox Church", + "Knox Church car park" + ] }, "phrase": { - "default": "Knox Church" + "default": [ + "Knox Church", + "Knox Church car park" + ] }, "center_point": { "lon": -123.175907, @@ -166260,10 +167740,16 @@ "_id": "way/157768008", "data": { "name": { - "default": "No Frills" + "default": [ + "No Frills", + "No Frills car park" + ] }, "phrase": { - "default": "No Frills" + "default": [ + "No Frills", + "No Frills car park" + ] }, "center_point": { "lon": -123.111853, @@ -173511,10 +174997,16 @@ "_id": "way/238793092", "data": { "name": { - "default": "Parkade" + "default": [ + "Parkade", + "Parkade car park" + ] }, "phrase": { - "default": "Parkade" + "default": [ + "Parkade", + "Parkade car park" + ] }, "center_point": { "lon": -123.128853, @@ -173532,10 +175024,16 @@ "_id": "way/238793095", "data": { "name": { - "default": "Shoppers" + "default": [ + "Shoppers", + "Shoppers car park" + ] }, "phrase": { - "default": "Shoppers" + "default": [ + "Shoppers", + "Shoppers car park" + ] }, "center_point": { "lon": -123.131674, @@ -472995,10 +474493,16 @@ "_id": "way/266484143", "data": { "name": { - "default": "VCC-Clark" + "default": [ + "VCC-Clark", + "VCC-Clark railway station" + ] }, "phrase": { - "default": "VCC-Clark" + "default": [ + "VCC-Clark", + "VCC-Clark railway station" + ] }, "center_point": { "lon": -123.07902, @@ -473021,10 +474525,16 @@ "_id": "way/266484144", "data": { "name": { - "default": "Nanaimo Station" + "default": [ + "Nanaimo Station", + "Nanaimo railway station" + ] }, "phrase": { - "default": "Nanaimo Station" + "default": [ + "Nanaimo Station", + "Nanaimo railway station" + ] }, "center_point": { "lon": -123.055721, @@ -748109,10 +749619,16 @@ "_id": "way/283224143", "data": { "name": { - "default": "Queens Village" + "default": [ + "Queens Village", + "Queens Village railway station" + ] }, "phrase": { - "default": "Queens Village" + "default": [ + "Queens Village", + "Queens Village railway station" + ] }, "address_parts": { "number": "218-03", @@ -924983,10 +926499,16 @@ "_id": "way/32603955", "data": { "name": { - "default": "Pacific Central Station" + "default": [ + "Pacific Central Station", + "Pacific Central railway station" + ] }, "phrase": { - "default": "Pacific Central Station" + "default": [ + "Pacific Central Station", + "Pacific Central railway station" + ] }, "center_point": { "lon": -123.098196, @@ -925854,13 +927376,15 @@ "name": { "default": [ "Belmont", - "Belmont Park" + "Belmont Park", + "Belmont railway station" ] }, "phrase": { "default": [ "Belmont", - "Belmont Park" + "Belmont Park", + "Belmont railway station" ] }, "center_point": { @@ -926146,10 +927670,16 @@ "_id": "way/328967581", "data": { "name": { - "default": "Bellerose" + "default": [ + "Bellerose", + "Bellerose railway station" + ] }, "phrase": { - "default": "Bellerose" + "default": [ + "Bellerose", + "Bellerose railway station" + ] }, "center_point": { "lon": -73.716649, @@ -928413,10 +929943,16 @@ "_id": "way/336763836", "data": { "name": { - "default": "Visitor Parking" + "default": [ + "Visitor Parking", + "Visitor car park" + ] }, "phrase": { - "default": "Visitor Parking" + "default": [ + "Visitor Parking", + "Visitor car park" + ] }, "center_point": { "lon": -123.194236, @@ -928434,10 +929970,16 @@ "_id": "way/336763840", "data": { "name": { - "default": "Staff Parking" + "default": [ + "Staff Parking", + "Staff car park" + ] }, "phrase": { - "default": "Staff Parking" + "default": [ + "Staff Parking", + "Staff car park" + ] }, "center_point": { "lon": -123.193084, @@ -928455,10 +929997,16 @@ "_id": "way/336763845", "data": { "name": { - "default": "Military Vehicle Compound (Restricted Access)" + "default": [ + "Military Vehicle Compound (Restricted Access)", + "Military Vehicle Compound (Restricted Access) car park" + ] }, "phrase": { - "default": "Military Vehicle Compound (Restricted Access)" + "default": [ + "Military Vehicle Compound (Restricted Access)", + "Military Vehicle Compound (Restricted Access) car park" + ] }, "center_point": { "lon": -123.192916, @@ -928497,10 +930045,16 @@ "_id": "way/336763852", "data": { "name": { - "default": "Restricted Parking" + "default": [ + "Restricted Parking", + "Restricted car park" + ] }, "phrase": { - "default": "Restricted Parking" + "default": [ + "Restricted Parking", + "Restricted car park" + ] }, "center_point": { "lon": -123.189594, @@ -935065,10 +936619,16 @@ "_id": "way/37114268", "data": { "name": { - "default": "Larwill Parking" + "default": [ + "Larwill Parking", + "Larwill car park" + ] }, "phrase": { - "default": "Larwill Parking" + "default": [ + "Larwill Parking", + "Larwill car park" + ] }, "center_point": { "lon": -123.111649, @@ -935732,6 +937292,54 @@ "bounding_box": "{\"min_lat\":40.730948,\"max_lat\":40.7327081,\"min_lon\":-73.7324083,\"max_lon\":-73.7311201}" } }, + { + "_index": "pelias", + "_type": "venue", + "_id": "way/404651087", + "data": { + "name": { + "default": [ + "Denison Street Park & Ride", + "Denison Street Park & Ride car park" + ] + }, + "phrase": { + "default": [ + "Denison Street Park & Ride", + "Denison Street Park & Ride car park" + ] + }, + "center_point": { + "lon": 147.306226, + "lat": -42.978659 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "way/404651087", + "bounding_box": "{\"min_lat\":-42.9786585,\"max_lat\":-42.9786585,\"min_lon\":147.3062257,\"max_lon\":147.3062257}" + } + }, + { + "_index": "pelias", + "_type": "venue", + "_id": "way/404673227", + "data": { + "name": { + "default": "Gads Creek" + }, + "phrase": { + "default": "Gads Creek" + }, + "center_point": { + "lon": 152.4992, + "lat": -30.868845 + }, + "source": "openstreetmap", + "layer": "venue", + "source_id": "way/404673227", + "bounding_box": "{\"min_lat\":-30.8688452,\"max_lat\":-30.8688452,\"min_lon\":152.4992001,\"max_lon\":152.4992001}" + } + }, { "_index": "pelias", "_type": "venue", @@ -936978,10 +938586,16 @@ "_id": "way/53559282", "data": { "name": { - "default": "Overflow Parking" + "default": [ + "Overflow Parking", + "Overflow car park" + ] }, "phrase": { - "default": "Overflow Parking" + "default": [ + "Overflow Parking", + "Overflow car park" + ] }, "center_point": { "lon": -123.188528, @@ -937702,10 +939316,16 @@ "_id": "way/56400442", "data": { "name": { - "default": "La Casa Gelato Parking Lot" + "default": [ + "La Casa Gelato Parking Lot", + "La Casa Gelato Parking Lot car park" + ] }, "phrase": { - "default": "La Casa Gelato Parking Lot" + "default": [ + "La Casa Gelato Parking Lot", + "La Casa Gelato Parking Lot car park" + ] }, "center_point": { "lon": -123.081029, @@ -938370,10 +939990,16 @@ "_id": "way/62020058", "data": { "name": { - "default": "UBC Botanical Garden Parking" + "default": [ + "UBC Botanical Garden Parking", + "UBC Botanical Garden car park" + ] }, "phrase": { - "default": "UBC Botanical Garden Parking" + "default": [ + "UBC Botanical Garden Parking", + "UBC Botanical Garden car park" + ] }, "center_point": { "lon": -123.251487, @@ -940016,11 +941642,17 @@ "_id": "way/78393326", "data": { "name": { - "default": "Waterfront Station", + "default": [ + "Waterfront Station", + "Waterfront railway station" + ], "old": "Canadian Pacific Railway Station" }, "phrase": { - "default": "Waterfront Station", + "default": [ + "Waterfront Station", + "Waterfront railway station" + ], "old": "Canadian Pacific Railway Station" }, "center_point": { @@ -941225,10 +942857,16 @@ "_id": "way/85123382", "data": { "name": { - "default": "Lot 16 - 1500 Quebec Street" + "default": [ + "Lot 16 - 1500 Quebec Street", + "Lot 16 - 1500 Quebec Street car park" + ] }, "phrase": { - "default": "Lot 16 - 1500 Quebec Street" + "default": [ + "Lot 16 - 1500 Quebec Street", + "Lot 16 - 1500 Quebec Street car park" + ] }, "center_point": { "lon": -123.101229, @@ -941448,10 +943086,16 @@ "_id": "way/87222664", "data": { "name": { - "default": "29th Avenue Station" + "default": [ + "29th Avenue Station", + "29th Avenue railway station" + ] }, "phrase": { - "default": "29th Avenue Station" + "default": [ + "29th Avenue Station", + "29th Avenue railway station" + ] }, "center_point": { "lon": -123.045822, @@ -941474,10 +943118,16 @@ "_id": "way/87222665", "data": { "name": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "phrase": { - "default": "Joyce-Collingwood Station" + "default": [ + "Joyce-Collingwood Station", + "Joyce-Collingwood railway station" + ] }, "center_point": { "lon": -123.03185, @@ -941500,10 +943150,16 @@ "_id": "way/87222727", "data": { "name": { - "default": "Main Street-Science World Station" + "default": [ + "Main Street-Science World Station", + "Main Street-Science World railway station" + ] }, "phrase": { - "default": "Main Street-Science World Station" + "default": [ + "Main Street-Science World Station", + "Main Street-Science World railway station" + ] }, "center_point": { "lon": -123.100276, @@ -942487,10 +944143,16 @@ "_id": "way/90081256", "data": { "name": { - "default": "YVR Employee Parking Lot" + "default": [ + "YVR Employee Parking Lot", + "YVR Employee Parking Lot car park" + ] }, "phrase": { - "default": "YVR Employee Parking Lot" + "default": [ + "YVR Employee Parking Lot", + "YVR Employee Parking Lot car park" + ] }, "center_point": { "lon": -123.146383, @@ -945856,10 +947518,16 @@ "_id": "way/98838330", "data": { "name": { - "default": "West Parkade" + "default": [ + "West Parkade", + "West Parkade car park" + ] }, "phrase": { - "default": "West Parkade" + "default": [ + "West Parkade", + "West Parkade car park" + ] }, "center_point": { "lon": -123.255086, @@ -947133,10 +948801,16 @@ "_id": "way/99135915", "data": { "name": { - "default": "Thunderbird Parkade" + "default": [ + "Thunderbird Parkade", + "Thunderbird Parkade car park" + ] }, "phrase": { - "default": "Thunderbird Parkade" + "default": [ + "Thunderbird Parkade", + "Thunderbird Parkade car park" + ] }, "center_point": { "lon": -123.243069, @@ -947418,10 +949092,16 @@ "_id": "way/99205664", "data": { "name": { - "default": "North Parkade" + "default": [ + "North Parkade", + "North Parkade car park" + ] }, "phrase": { - "default": "North Parkade" + "default": [ + "North Parkade", + "North Parkade car park" + ] }, "center_point": { "lon": -123.250409, @@ -947677,10 +949357,16 @@ "_id": "way/99272772", "data": { "name": { - "default": "Health Sciences Parkade" + "default": [ + "Health Sciences Parkade", + "Health Sciences Parkade car park" + ] }, "phrase": { - "default": "Health Sciences Parkade" + "default": [ + "Health Sciences Parkade", + "Health Sciences Parkade car park" + ] }, "center_point": { "lon": -123.247813, @@ -948234,10 +949920,16 @@ "_id": "way/99436420", "data": { "name": { - "default": "Fraser River Parkade" + "default": [ + "Fraser River Parkade", + "Fraser River Parkade car park" + ] }, "phrase": { - "default": "Fraser River Parkade" + "default": [ + "Fraser River Parkade", + "Fraser River Parkade car park" + ] }, "center_point": { "lon": -123.258062, @@ -948523,10 +950215,16 @@ "_id": "way/99575357", "data": { "name": { - "default": "Rose Garden Parkade" + "default": [ + "Rose Garden Parkade", + "Rose Garden Parkade car park" + ] }, "phrase": { - "default": "Rose Garden Parkade" + "default": [ + "Rose Garden Parkade", + "Rose Garden Parkade car park" + ] }, "center_point": { "lon": -123.256334, @@ -948895,4 +950593,4 @@ "bounding_box": "{\"min_lat\":49.2174915,\"max_lat\":49.2194865,\"min_lon\":-123.2018987,\"max_lon\":-123.1991481}" } } -] +] \ No newline at end of file diff --git a/test/run.js b/test/run.js index a7942471..6de0e63e 100644 --- a/test/run.js +++ b/test/run.js @@ -1,4 +1,3 @@ - var tape = require('tape'); var common = {}; @@ -10,6 +9,7 @@ var tests = [ require('./config/localized_name_keys'), require('./stream/address_extractor'), require('./stream/category_mapper'), + require('./stream/venue_normalization'), require('./stream/document_constructor'), require('./stream/importPipeline'), require('./stream/pbf'), @@ -19,4 +19,4 @@ var tests = [ tests.map(function(t) { t.all(tape, common); -}); +}); \ No newline at end of file diff --git a/test/stream/importPipeline.js b/test/stream/importPipeline.js index ee4595c3..ec6fe1ca 100644 --- a/test/stream/importPipeline.js +++ b/test/stream/importPipeline.js @@ -15,6 +15,7 @@ module.exports.tests.interface = function(test, common) { 'adminLookup', 'addressExtractor', 'categoryMapper', + 'venueNormalization', 'dbMapper', 'elasticsearch', 'import' @@ -47,4 +48,4 @@ module.exports.all = function (tape, common) { for( var testCase in module.exports.tests ){ module.exports.tests[testCase](test, common); } -}; +}; \ No newline at end of file diff --git a/test/stream/venue_normalization.js b/test/stream/venue_normalization.js new file mode 100644 index 00000000..f092e6c8 --- /dev/null +++ b/test/stream/venue_normalization.js @@ -0,0 +1,95 @@ + +var through = require('through2'), + mapper = require('../../stream/venue_normalization'), + fixtures = require('../fixtures/docs'), + Document = require('pelias-model').Document, + defaultMapping = require('../../config/venue_normalization'); + +module.exports.tests = {}; + +// test exports +module.exports.tests.interface = function(test, common) { + test('interface: factory', function(t) { + t.equal(typeof mapper, 'function', 'stream factory'); + t.end(); + }); + test('interface: stream', function(t) { + var stream = mapper(); + t.equal(typeof stream, 'object', 'valid stream'); + t.equal(typeof stream._read, 'function', 'valid readable'); + t.equal(typeof stream._write, 'function', 'valid writeable'); + t.end(); + }); +}; + +// perform a no-op for docs with no tags (just in case!) +module.exports.tests.passthrough = function(test, common) { + test('passthrough: no tags', function(t) { + var stream = mapper(); + stream.pipe( through.obj( function( doc, enc, next ){ + t.equal( doc, fixtures.osmNode1, 'no-op for docs with no tags' ); + t.deepEqual( doc.name, { node: 'node7' }, 'no name data mapped' ); + t.deepEqual( doc.address_parts, {}, 'no address data mapped' ); + t.end(); // test will fail if not called (or called twice). + next(); + })); + stream.write(fixtures.osmNode1); + }); +}; + +module.exports.tests.no_name = function(test, common) { + var doc = new Document('osm','a',1); + doc.setMeta( 'tags', { 'railway': 'station' } ); + test('maps - no name', function(t) { + var stream = mapper( [{'conditions': [['railway', 'station']], 'synonyms': ['station'],'suffix': 'railway station'}] ); + stream.pipe( through.obj( function( doc, enc, next ){ + t.deepEqual(doc.name, {}, 'no name passed through'); + t.end(); // test will fail if not called (or called twice). + next(); + })); + stream.write(doc); + }); +}; + +// ===================== feature mapping ====================== + +module.exports.tests.no_suffix = function(test, common) { + var doc = new Document('osm','a',1); + doc.setName( 'default', 'test' ); + doc.setMeta( 'tags', { 'railway': 'station' } ); + test('maps - no suffix', function(t) { + var stream = mapper( [{'conditions': [['railway', 'station']], 'synonyms': ['station'],'suffix': 'railway station'}] ); + stream.pipe( through.obj( function( doc, enc, next ){ + t.deepEqual(doc.name, { 'default': [ 'test', 'test railway station' ] }, 'correctly aliased'); + t.end(); // test will fail if not called (or called twice). + next(); + })); + stream.write(doc); + }); +}; + +module.exports.tests.with_suffix = function(test, common) { + var doc = new Document('osm','a',1); + doc.setName( 'default', 'test station' ); + doc.setMeta( 'tags', { 'railway': 'station' } ); + test('maps - with suffix', function(t) { + var stream = mapper( [{'conditions': [['railway', 'station']], 'synonyms': ['station'],'suffix': 'railway station'}] ); + stream.pipe( through.obj( function( doc, enc, next ){ + t.deepEqual(doc.name, { 'default': [ 'test station', 'test railway station' ] }, 'correctly aliased'); + t.end(); // test will fail if not called (or called twice). + next(); + })); + stream.write(doc); + }); +}; + +module.exports.all = function (tape, common) { + + function test(name, testFunction) { + return tape('venue_normalization: ' + name, testFunction); + } + + for( var testCase in module.exports.tests ){ + module.exports.tests[testCase](test, common); + } +};