Skip to content

Commit 2b00663

Browse files
Merge branch 'reverse-geocode-location-name' into semantic-release-monorepo
2 parents 9f96405 + 0e5fe50 commit 2b00663

File tree

3 files changed

+56
-51
lines changed

3 files changed

+56
-51
lines changed

packages/geocoder/src/__snapshots__/index.test.js.snap

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ exports[`geocoder PELIAS should make reverse query 1`] = `
289289
Object {
290290
"lat": 45.516198,
291291
"lon": -122.67324,
292-
"name": "Mill Ends Park, Portland, OR, USA",
292+
"name": "722 NE Shaver St, Portland",
293293
"rawGeocodedFeature": Object {
294294
"accuracy": "point",
295-
"address": "Mill Ends Park, Portland, OR, USA",
296-
"confidence": 0.9,
295+
"address": "722 NE Shaver St, Portland 97212",
296+
"confidence": 0.8,
297297
"continent": "North America",
298298
"continent_gid": "whosonfirst:continent:102191575",
299299
"country": "United States",
@@ -302,25 +302,28 @@ Object {
302302
"county": "Multnomah County",
303303
"county_a": "MU",
304304
"county_gid": "whosonfirst:county:102081631",
305-
"distance": 0.001,
306-
"gid": "openstreetmap:venue:way/156366633",
307-
"id": "way/156366633",
308-
"label": "Mill Ends Park, Portland, OR, USA",
305+
"distance": 0.01,
306+
"gid": "openaddresses:address:us/or/portland:8c4e99815d1dbedd",
307+
"housenumber": "722",
308+
"id": "us/or/portland:8c4e99815d1dbedd",
309+
"label": "722 NE Shaver St, Portland",
309310
"latlng": Object {
310-
"lat": 45.516201,
311-
"lon": -122.673245,
311+
"lat": 45.551892,
312+
"lon": -122.658057,
312313
},
313-
"layer": "venue",
314+
"layer": "address",
314315
"locality": "Portland",
315316
"locality_gid": "whosonfirst:locality:101715829",
316-
"name": "Mill Ends Park",
317-
"neighbourhood": "Downtown",
318-
"neighbourhood_gid": "whosonfirst:neighbourhood:85867131",
317+
"name": "722 NE Shaver St",
318+
"neighbourhood": "King",
319+
"neighbourhood_gid": "whosonfirst:neighbourhood:85893199",
320+
"postalcode": "97212",
319321
"region": "Oregon",
320322
"region_a": "OR",
321323
"region_gid": "whosonfirst:region:85688513",
322-
"source": "openstreetmap",
323-
"source_id": "way/156366633",
324+
"source": "openaddresses",
325+
"source_id": "us/or/portland:8c4e99815d1dbedd",
326+
"street": "NE Shaver St",
324327
},
325328
}
326329
`;

packages/geocoder/src/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ describe("geocoder", () => {
6363
200,
6464
mockResponsePath("pelias", "autocomplete-response.json")
6565
)
66-
// reverse
66+
// search
6767
.get(`${basePeliasPath}search`)
6868
.query(true)
6969
.replyWithFile(200, mockResponsePath("pelias", "search-response.json"))
70-
// search
70+
// reverse, includes not using zip/country in returned location.name.
7171
.get(`${basePeliasPath}reverse`)
7272
.query(true)
7373
.replyWithFile(200, mockResponsePath("pelias", "reverse-response.json"));
Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"geocoding": {
33
"version": "0.2",
4-
"attribution": "http://lb-st-mapgeo.tri-met.org:4000/attribution",
4+
"attribution": "http://localhost:4000/attribution",
55
"query": {
66
"size": 10,
77
"private": false,
8-
"point.lat": 45.516198,
9-
"point.lon": -122.67324,
10-
"boundary.circle.lat": 45.516198,
11-
"boundary.circle.lon": -122.67324,
8+
"point.lat": 45.551804006178294,
9+
"point.lon": -122.65806198120119,
10+
"boundary.circle.lat": 45.551804006178294,
11+
"boundary.circle.lon": -122.65806198120119,
1212
"lang": {
1313
"name": "English",
1414
"iso6391": "en",
@@ -17,31 +17,33 @@
1717
},
1818
"querySize": 20
1919
},
20-
"warnings": ["Invalid Parameter: api_key"],
2120
"engine": {
2221
"name": "Pelias",
2322
"author": "Mapzen",
2423
"version": "1.0"
2524
},
26-
"timestamp": 1563949092620
25+
"timestamp": 1593119187895
2726
},
2827
"type": "FeatureCollection",
2928
"features": [
3029
{
3130
"type": "Feature",
3231
"geometry": {
3332
"type": "Point",
34-
"coordinates": [-122.673245, 45.516201]
33+
"coordinates": [-122.658057, 45.551892]
3534
},
3635
"properties": {
37-
"id": "way/156366633",
38-
"gid": "openstreetmap:venue:way/156366633",
39-
"layer": "venue",
40-
"source": "openstreetmap",
41-
"source_id": "way/156366633",
42-
"name": "Mill Ends Park",
43-
"confidence": 0.9,
44-
"distance": 0.001,
36+
"id": "us/or/portland:8c4e99815d1dbedd",
37+
"gid": "openaddresses:address:us/or/portland:8c4e99815d1dbedd",
38+
"layer": "address",
39+
"source": "openaddresses",
40+
"source_id": "us/or/portland:8c4e99815d1dbedd",
41+
"name": "722 NE Shaver St",
42+
"housenumber": "722",
43+
"street": "NE Shaver St",
44+
"postalcode": "97212",
45+
"confidence": 0.8,
46+
"distance": 0.01,
4547
"accuracy": "point",
4648
"country": "United States",
4749
"country_gid": "whosonfirst:country:85633793",
@@ -54,32 +56,31 @@
5456
"county_a": "MU",
5557
"locality": "Portland",
5658
"locality_gid": "whosonfirst:locality:101715829",
57-
"neighbourhood": "Downtown",
58-
"neighbourhood_gid": "whosonfirst:neighbourhood:85867131",
59+
"neighbourhood": "King",
60+
"neighbourhood_gid": "whosonfirst:neighbourhood:85893199",
5961
"continent": "North America",
6062
"continent_gid": "whosonfirst:continent:102191575",
61-
"label": "Mill Ends Park, Portland, OR, USA"
62-
},
63-
"bbox": [-122.6732557, 45.5161964, -122.673234, 45.5162067]
63+
"label": "722 NE Shaver St, Portland"
64+
}
6465
},
6566
{
6667
"type": "Feature",
6768
"geometry": {
6869
"type": "Point",
69-
"coordinates": [-122.673609, 45.516337]
70+
"coordinates": [-122.658316, 45.551934]
7071
},
7172
"properties": {
72-
"id": "us/or/portland_metro:bd3f9863242e4ec7",
73-
"gid": "openaddresses:address:us/or/portland_metro:bd3f9863242e4ec7",
73+
"id": "us/or/portland:835fad73186635f9",
74+
"gid": "openaddresses:address:us/or/portland:835fad73186635f9",
7475
"layer": "address",
7576
"source": "openaddresses",
76-
"source_id": "us/or/portland_metro:bd3f9863242e4ec7",
77-
"name": "833 SW Naito Pkwy",
78-
"housenumber": "833",
79-
"street": "SW Naito Pkwy",
80-
"postalcode": "97204",
77+
"source_id": "us/or/portland:835fad73186635f9",
78+
"name": "3974 NE 7th Ave",
79+
"housenumber": "3974",
80+
"street": "NE 7th Ave",
81+
"postalcode": "97212",
8182
"confidence": 0.8,
82-
"distance": 0.033,
83+
"distance": 0.025,
8384
"accuracy": "point",
8485
"country": "United States",
8586
"country_gid": "whosonfirst:country:85633793",
@@ -92,13 +93,14 @@
9293
"county_a": "MU",
9394
"locality": "Portland",
9495
"locality_gid": "whosonfirst:locality:101715829",
95-
"neighbourhood": "Downtown",
96-
"neighbourhood_gid": "whosonfirst:neighbourhood:85867131",
96+
"neighbourhood": "King",
97+
"neighbourhood_gid": "whosonfirst:neighbourhood:85893199",
9798
"continent": "North America",
9899
"continent_gid": "whosonfirst:continent:102191575",
99-
"label": "833 SW Naito Pkwy, Portland, OR, USA"
100+
"label": "3974 NE 7th Ave, Portland"
100101
}
101102
}
102103
],
103-
"bbox": [-122.673883, 45.5161964, -122.673234, 45.516689]
104+
"bbox": [-122.658318, 45.55163, -122.657798, 45.551934],
105+
"hostname": "rj-st-mapgeo01"
104106
}

0 commit comments

Comments
 (0)