diff --git a/packages/geocoder/src/__snapshots__/index.test.js.snap b/packages/geocoder/src/__snapshots__/index.test.js.snap index f5cda40cd..8096aadd6 100644 --- a/packages/geocoder/src/__snapshots__/index.test.js.snap +++ b/packages/geocoder/src/__snapshots__/index.test.js.snap @@ -289,11 +289,11 @@ exports[`geocoder PELIAS should make reverse query 1`] = ` Object { "lat": 45.516198, "lon": -122.67324, - "name": "Mill Ends Park, Portland, OR, USA", + "name": "722 NE Shaver St, Portland", "rawGeocodedFeature": Object { "accuracy": "point", - "address": "Mill Ends Park, Portland, OR, USA", - "confidence": 0.9, + "address": "722 NE Shaver St, Portland 97212", + "confidence": 0.8, "continent": "North America", "continent_gid": "whosonfirst:continent:102191575", "country": "United States", @@ -302,25 +302,28 @@ Object { "county": "Multnomah County", "county_a": "MU", "county_gid": "whosonfirst:county:102081631", - "distance": 0.001, - "gid": "openstreetmap:venue:way/156366633", - "id": "way/156366633", - "label": "Mill Ends Park, Portland, OR, USA", + "distance": 0.01, + "gid": "openaddresses:address:us/or/portland:8c4e99815d1dbedd", + "housenumber": "722", + "id": "us/or/portland:8c4e99815d1dbedd", + "label": "722 NE Shaver St, Portland", "latlng": Object { - "lat": 45.516201, - "lon": -122.673245, + "lat": 45.551892, + "lon": -122.658057, }, - "layer": "venue", + "layer": "address", "locality": "Portland", "locality_gid": "whosonfirst:locality:101715829", - "name": "Mill Ends Park", - "neighbourhood": "Downtown", - "neighbourhood_gid": "whosonfirst:neighbourhood:85867131", + "name": "722 NE Shaver St", + "neighbourhood": "King", + "neighbourhood_gid": "whosonfirst:neighbourhood:85893199", + "postalcode": "97212", "region": "Oregon", "region_a": "OR", "region_gid": "whosonfirst:region:85688513", - "source": "openstreetmap", - "source_id": "way/156366633", + "source": "openaddresses", + "source_id": "us/or/portland:8c4e99815d1dbedd", + "street": "NE Shaver St", }, } `; diff --git a/packages/geocoder/src/index.test.js b/packages/geocoder/src/index.test.js index f395acb03..ceab7a8c3 100644 --- a/packages/geocoder/src/index.test.js +++ b/packages/geocoder/src/index.test.js @@ -63,11 +63,11 @@ describe("geocoder", () => { 200, mockResponsePath("pelias", "autocomplete-response.json") ) - // reverse + // search .get(`${basePeliasPath}search`) .query(true) .replyWithFile(200, mockResponsePath("pelias", "search-response.json")) - // search + // reverse, includes not using zip/country in returned location.name. .get(`${basePeliasPath}reverse`) .query(true) .replyWithFile(200, mockResponsePath("pelias", "reverse-response.json")); diff --git a/packages/geocoder/src/test-fixtures/pelias/reverse-response.json b/packages/geocoder/src/test-fixtures/pelias/reverse-response.json index 6cfd3d583..f07c96a13 100644 --- a/packages/geocoder/src/test-fixtures/pelias/reverse-response.json +++ b/packages/geocoder/src/test-fixtures/pelias/reverse-response.json @@ -1,14 +1,14 @@ { "geocoding": { "version": "0.2", - "attribution": "http://lb-st-mapgeo.tri-met.org:4000/attribution", + "attribution": "http://localhost:4000/attribution", "query": { "size": 10, "private": false, - "point.lat": 45.516198, - "point.lon": -122.67324, - "boundary.circle.lat": 45.516198, - "boundary.circle.lon": -122.67324, + "point.lat": 45.551804006178294, + "point.lon": -122.65806198120119, + "boundary.circle.lat": 45.551804006178294, + "boundary.circle.lon": -122.65806198120119, "lang": { "name": "English", "iso6391": "en", @@ -17,13 +17,12 @@ }, "querySize": 20 }, - "warnings": ["Invalid Parameter: api_key"], "engine": { "name": "Pelias", "author": "Mapzen", "version": "1.0" }, - "timestamp": 1563949092620 + "timestamp": 1593119187895 }, "type": "FeatureCollection", "features": [ @@ -31,17 +30,20 @@ "type": "Feature", "geometry": { "type": "Point", - "coordinates": [-122.673245, 45.516201] + "coordinates": [-122.658057, 45.551892] }, "properties": { - "id": "way/156366633", - "gid": "openstreetmap:venue:way/156366633", - "layer": "venue", - "source": "openstreetmap", - "source_id": "way/156366633", - "name": "Mill Ends Park", - "confidence": 0.9, - "distance": 0.001, + "id": "us/or/portland:8c4e99815d1dbedd", + "gid": "openaddresses:address:us/or/portland:8c4e99815d1dbedd", + "layer": "address", + "source": "openaddresses", + "source_id": "us/or/portland:8c4e99815d1dbedd", + "name": "722 NE Shaver St", + "housenumber": "722", + "street": "NE Shaver St", + "postalcode": "97212", + "confidence": 0.8, + "distance": 0.01, "accuracy": "point", "country": "United States", "country_gid": "whosonfirst:country:85633793", @@ -54,32 +56,31 @@ "county_a": "MU", "locality": "Portland", "locality_gid": "whosonfirst:locality:101715829", - "neighbourhood": "Downtown", - "neighbourhood_gid": "whosonfirst:neighbourhood:85867131", + "neighbourhood": "King", + "neighbourhood_gid": "whosonfirst:neighbourhood:85893199", "continent": "North America", "continent_gid": "whosonfirst:continent:102191575", - "label": "Mill Ends Park, Portland, OR, USA" - }, - "bbox": [-122.6732557, 45.5161964, -122.673234, 45.5162067] + "label": "722 NE Shaver St, Portland" + } }, { "type": "Feature", "geometry": { "type": "Point", - "coordinates": [-122.673609, 45.516337] + "coordinates": [-122.658316, 45.551934] }, "properties": { - "id": "us/or/portland_metro:bd3f9863242e4ec7", - "gid": "openaddresses:address:us/or/portland_metro:bd3f9863242e4ec7", + "id": "us/or/portland:835fad73186635f9", + "gid": "openaddresses:address:us/or/portland:835fad73186635f9", "layer": "address", "source": "openaddresses", - "source_id": "us/or/portland_metro:bd3f9863242e4ec7", - "name": "833 SW Naito Pkwy", - "housenumber": "833", - "street": "SW Naito Pkwy", - "postalcode": "97204", + "source_id": "us/or/portland:835fad73186635f9", + "name": "3974 NE 7th Ave", + "housenumber": "3974", + "street": "NE 7th Ave", + "postalcode": "97212", "confidence": 0.8, - "distance": 0.033, + "distance": 0.025, "accuracy": "point", "country": "United States", "country_gid": "whosonfirst:country:85633793", @@ -92,13 +93,14 @@ "county_a": "MU", "locality": "Portland", "locality_gid": "whosonfirst:locality:101715829", - "neighbourhood": "Downtown", - "neighbourhood_gid": "whosonfirst:neighbourhood:85867131", + "neighbourhood": "King", + "neighbourhood_gid": "whosonfirst:neighbourhood:85893199", "continent": "North America", "continent_gid": "whosonfirst:continent:102191575", - "label": "833 SW Naito Pkwy, Portland, OR, USA" + "label": "3974 NE 7th Ave, Portland" } } ], - "bbox": [-122.673883, 45.5161964, -122.673234, 45.516689] + "bbox": [-122.658318, 45.55163, -122.657798, 45.551934], + "hostname": "rj-st-mapgeo01" }