-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(geocode): refactor geocoding to allow use of ArcGIS geocoder
- Loading branch information
1 parent
69aa4f0
commit bd16dd7
Showing
14 changed files
with
1,163 additions
and
72 deletions.
There are no files selected for viewing
154 changes: 154 additions & 0 deletions
154
__tests__/test-utils/fixtures/geocoding/arcgis/findAddressCandidates-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
{ | ||
"spatialReference": { | ||
"wkid": 4326, | ||
"latestWkid": 4326 | ||
}, | ||
"candidates": [ | ||
{ | ||
"address": "Mill End, Clavering, Saffron Walden, Essex, England", | ||
"location": { | ||
"x": 0.12961000000007061, | ||
"y": 51.973520000000065 | ||
}, | ||
"score": 87.5, | ||
"attributes": { | ||
"Loc_name": "World", | ||
"Status": "T", | ||
"Score": 87.5, | ||
"Match_addr": "Mill End, Clavering, Saffron Walden, Essex, England", | ||
"LongLabel": "Mill End, Clavering, Saffron Walden, Essex, England, GBR", | ||
"ShortLabel": "Mill End", | ||
"Addr_type": "Locality", | ||
"Type": "Village", | ||
"PlaceName": "Mill End", | ||
"Place_addr": "Clavering, Saffron Walden, Essex, England", | ||
"Phone": "", | ||
"URL": "", | ||
"Rank": 15, | ||
"AddBldg": "", | ||
"AddNum": "", | ||
"AddNumFrom": "", | ||
"AddNumTo": "", | ||
"AddRange": "", | ||
"Side": "", | ||
"StPreDir": "", | ||
"StPreType": "", | ||
"StName": "", | ||
"StType": "", | ||
"StDir": "", | ||
"BldgType": "", | ||
"BldgName": "", | ||
"LevelType": "", | ||
"LevelName": "", | ||
"UnitType": "", | ||
"UnitName": "", | ||
"SubAddr": "", | ||
"StAddr": "", | ||
"Block": "", | ||
"Sector": "", | ||
"Nbrhd": "Mill End", | ||
"District": "Clavering", | ||
"City": "Saffron Walden", | ||
"MetroArea": "", | ||
"Subregion": "Essex", | ||
"Region": "England", | ||
"RegionAbbr": "ENG", | ||
"Territory": "", | ||
"Zone": "", | ||
"Postal": "", | ||
"PostalExt": "", | ||
"Country": "GBR", | ||
"LangCode": "ENG", | ||
"Distance": 0, | ||
"X": 0.12961000000007061, | ||
"Y": 51.973520000000065, | ||
"DisplayX": 0.12961000000007061, | ||
"DisplayY": 51.973520000000065, | ||
"Xmin": 0.11961000000007062, | ||
"Xmax": 0.13961000000007062, | ||
"Ymin": 51.963520000000067, | ||
"Ymax": 51.983520000000063, | ||
"ExInfo": "" | ||
}, | ||
"extent": { | ||
"xmin": 0.11961000000007062, | ||
"ymin": 51.963520000000067, | ||
"xmax": 0.13961000000007062, | ||
"ymax": 51.983520000000063 | ||
} | ||
}, | ||
{ | ||
"address": "Mill End, Hambleden, Henley-on-Thames, Oxfordshire, England", | ||
"location": { | ||
"x": -0.86689999999993006, | ||
"y": 51.558340000000044 | ||
}, | ||
"score": 87.5, | ||
"attributes": { | ||
"Loc_name": "World", | ||
"Status": "T", | ||
"Score": 87.5, | ||
"Match_addr": "Mill End, Hambleden, Henley-on-Thames, Oxfordshire, England", | ||
"LongLabel": "Mill End, Hambleden, Henley-on-Thames, Oxfordshire, England, GBR", | ||
"ShortLabel": "Mill End", | ||
"Addr_type": "Locality", | ||
"Type": "Village", | ||
"PlaceName": "Mill End", | ||
"Place_addr": "Hambleden, Henley-on-Thames, Oxfordshire, England", | ||
"Phone": "", | ||
"URL": "", | ||
"Rank": 15, | ||
"AddBldg": "", | ||
"AddNum": "", | ||
"AddNumFrom": "", | ||
"AddNumTo": "", | ||
"AddRange": "", | ||
"Side": "", | ||
"StPreDir": "", | ||
"StPreType": "", | ||
"StName": "", | ||
"StType": "", | ||
"StDir": "", | ||
"BldgType": "", | ||
"BldgName": "", | ||
"LevelType": "", | ||
"LevelName": "", | ||
"UnitType": "", | ||
"UnitName": "", | ||
"SubAddr": "", | ||
"StAddr": "", | ||
"Block": "", | ||
"Sector": "", | ||
"Nbrhd": "Mill End", | ||
"District": "Hambleden", | ||
"City": "Henley-on-Thames", | ||
"MetroArea": "", | ||
"Subregion": "Oxfordshire", | ||
"Region": "England", | ||
"RegionAbbr": "ENG", | ||
"Territory": "", | ||
"Zone": "", | ||
"Postal": "", | ||
"PostalExt": "", | ||
"Country": "GBR", | ||
"LangCode": "ENG", | ||
"Distance": 0, | ||
"X": -0.86689999999993006, | ||
"Y": 51.558340000000044, | ||
"DisplayX": -0.86689999999993006, | ||
"DisplayY": 51.558340000000044, | ||
"Xmin": -0.87689999999993007, | ||
"Xmax": -0.85689999999993005, | ||
"Ymin": 51.548340000000046, | ||
"Ymax": 51.568340000000042, | ||
"ExInfo": "" | ||
}, | ||
"extent": { | ||
"xmin": -0.87689999999993007, | ||
"ymin": 51.548340000000046, | ||
"xmax": -0.85689999999993005, | ||
"ymax": 51.568340000000042 | ||
} | ||
} | ||
] | ||
} |
32 changes: 32 additions & 0 deletions
32
__tests__/test-utils/fixtures/geocoding/arcgis/reverseGeocode-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"address": { | ||
"Match_addr": "SW Naito Pkwy, Portland, Oregon, 97204", | ||
"LongLabel": "SW Naito Pkwy, Portland, OR, 97204, USA", | ||
"ShortLabel": "SW Naito Pkwy", | ||
"Addr_type": "StreetName", | ||
"Type": "", | ||
"PlaceName": "", | ||
"AddNum": "", | ||
"Address": "SW Naito Pkwy", | ||
"Block": "", | ||
"Sector": "", | ||
"Neighborhood": "Downtown", | ||
"District": "", | ||
"City": "Portland", | ||
"MetroArea": "Portland-Vancouver Metro Area", | ||
"Subregion": "Multnomah County", | ||
"Region": "Oregon", | ||
"Territory": "", | ||
"Postal": "97204", | ||
"PostalExt": "", | ||
"CountryCode": "USA" | ||
}, | ||
"location": { | ||
"x": -122.67320084756255, | ||
"y": 45.516175523600715, | ||
"spatialReference": { | ||
"wkid": 4326, | ||
"latestWkid": 4326 | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
__tests__/test-utils/fixtures/geocoding/arcgis/suggest-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"suggestions": [ | ||
{ | ||
"text": "Mill Ends City Park, Portland, OR, USA", | ||
"magicKey": "dHA9MCNsb2M9ODU3OTE0NyNsbmc9MzMjcGw9MzI4OTA3MSNsYnM9MTQ6MjAwNTI3NTc=", | ||
"isCollection": false | ||
}, | ||
{ | ||
"text": "Mill End Sports & Social, Penn Road, Mill End, Rickmansworth, Hertfordshire, England, WD3 8, GBR", | ||
"magicKey": "dHA9MCNsb2M9OTY5Mzc0MiNsbmc9MzMjcGw9NTA4NTQ2NiNsYnM9MTQ6MjAwNTI3NTI=", | ||
"isCollection": false | ||
} | ||
] | ||
} |
83 changes: 83 additions & 0 deletions
83
__tests__/test-utils/fixtures/geocoding/pelias/autocomplete-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"geocoding": { | ||
"version": "0.2", | ||
"attribution": "http://lb-st-mapgeo.tri-met.org:4000/attribution", | ||
"query": { | ||
"text": "Mill Ends", | ||
"parser": "addressit", | ||
"parsed_text": {}, | ||
"tokens": [ | ||
"Mill", | ||
"Ends" | ||
], | ||
"size": 10, | ||
"sources": [ | ||
"geonames", | ||
"openaddresses", | ||
"openstreetmap", | ||
"whosonfirst" | ||
], | ||
"private": false, | ||
"focus.point.lat": 45.52, | ||
"focus.point.lon": -122.67, | ||
"lang": { | ||
"name": "English", | ||
"iso6391": "en", | ||
"iso6393": "eng", | ||
"defaulted": true | ||
} | ||
}, | ||
"warnings": [ | ||
"Invalid Parameter: api_key" | ||
], | ||
"engine": { | ||
"name": "Pelias", | ||
"author": "Mapzen", | ||
"version": "1.0" | ||
}, | ||
"timestamp": 1563948844191 | ||
}, | ||
"type": "FeatureCollection", | ||
"features": [{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-122.673377, | ||
45.516278 | ||
] | ||
}, | ||
"properties": { | ||
"id": "node/4243944023", | ||
"gid": "openstreetmap:venue:node/4243944023", | ||
"layer": "venue", | ||
"source": "openstreetmap", | ||
"source_id": "node/4243944023", | ||
"name": "Mill Ends Park", | ||
"distance": 0.491, | ||
"accuracy": "point", | ||
"country": "United States", | ||
"country_gid": "whosonfirst:country:85633793", | ||
"country_a": "USA", | ||
"region": "Oregon", | ||
"region_gid": "whosonfirst:region:85688513", | ||
"region_a": "OR", | ||
"county": "Multnomah County", | ||
"county_gid": "whosonfirst:county:102081631", | ||
"county_a": "MU", | ||
"locality": "Portland", | ||
"locality_gid": "whosonfirst:locality:101715829", | ||
"neighbourhood": "Downtown", | ||
"neighbourhood_gid": "whosonfirst:neighbourhood:85867131", | ||
"continent": "North America", | ||
"continent_gid": "whosonfirst:continent:102191575", | ||
"label": "Mill Ends Park, Portland, OR, USA" | ||
} | ||
}], | ||
"bbox": [ | ||
-122.673377, | ||
45.516278, | ||
-122.673377, | ||
45.516278 | ||
] | ||
} |
Oops, something went wrong.