Skip to content

Commit d6fff2f

Browse files
DamienHarperjbelien
authored andcommitted
[Here] Fix reverse geocoding (a typo was present in the prox parameter) (#991)
* Fix reverse geocoding (a typo was present in the prox parameter) Bump API version from 8 to 9 * Updated tests * Added cached responses * Fixed typo
1 parent 527813e commit d6fff2f

17 files changed

+32
-18
lines changed

src/Provider/Here/Here.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ final class Here extends AbstractHttpProvider implements Provider
3232
/**
3333
* @var string
3434
*/
35-
const GEOCODE_ENDPOINT_URL = 'https://geocoder.api.here.com/6.2/geocode.json?app_id=%s&app_code=%s&searchtext=%s&gen=8';
35+
const GEOCODE_ENDPOINT_URL = 'https://geocoder.api.here.com/6.2/geocode.json?app_id=%s&app_code=%s&searchtext=%s&gen=9';
3636

3737
/**
3838
* @var string
3939
*/
40-
const REVERSE_ENDPOINT_URL = 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json?prox=%F,%F&250&app_id=%s&app_code=%s&mode=retrieveAddresses&gen=8&maxresults=%d';
40+
const REVERSE_ENDPOINT_URL = 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json?prox=%F,%F,250&app_id=%s&app_code=%s&mode=retrieveAddresses&gen=9&maxresults=%d';
4141

4242
/**
4343
* @var string
4444
*/
45-
const GEOCODE_CIT_ENDPOINT_URL = 'https://geocoder.cit.api.here.com/6.2/geocode.json?app_id=%s&app_code=%s&searchtext=%s&gen=8';
45+
const GEOCODE_CIT_ENDPOINT_URL = 'https://geocoder.cit.api.here.com/6.2/geocode.json?app_id=%s&app_code=%s&searchtext=%s&gen=9';
4646

4747
/**
4848
* @var string
4949
*/
50-
const REVERSE_CIT_ENDPOINT_URL = 'https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json?prox=%F,%F&250&app_id=%s&app_code=%s&mode=retrieveAddresses&gen=8&maxresults=%d';
50+
const REVERSE_CIT_ENDPOINT_URL = 'https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json?prox=%F,%F,250&app_id=%s&app_code=%s&mode=retrieveAddresses&gen=9&maxresults=%d';
5151

5252
/**
5353
* @var string

src/Provider/Here/Tests/.cached_responses/geocoder.api.here.com_08cc36efcb100bbd649db91ca18ce91cf4bcf4be

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:80:"{"Response":{"MetaInfo":{"Timestamp":"2019-07-30T07:05:36.129+0000"},"View":[]}}";
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:991:"{"Response":{"MetaInfo":{"Timestamp":"2018-06-29T12:03:41.853+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_0cb6yPlJYuup8k2I7emOLA_xAD","LocationType":"address","DisplayPosition":{"Latitude":48.8653,"Longitude":2.39844},"NavigationPosition":[{"Latitude":48.86518,"Longitude":2.39873}],"MapView":{"TopLeft":{"Latitude":48.8664242,"Longitude":2.3967311},"BottomRight":{"Latitude":48.8641758,"Longitude":2.4001489}},"Address":{"Label":"10 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"10","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]}}}]}]}}";
1+
s:991:"{"Response":{"MetaInfo":{"Timestamp":"2019-07-30T07:05:35.379+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_0cb6yPlJYuup8k2I7emOLA_xAD","LocationType":"address","DisplayPosition":{"Latitude":48.8653,"Longitude":2.39844},"NavigationPosition":[{"Latitude":48.86518,"Longitude":2.39873}],"MapView":{"TopLeft":{"Latitude":48.8664242,"Longitude":2.3967311},"BottomRight":{"Latitude":48.8641758,"Longitude":2.4001489}},"Address":{"Label":"10 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"10","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]}}}]}]}}";

src/Provider/Here/Tests/.cached_responses/geocoder.api.here.com_cde57abaffb6351f78a5357919bf516eae2acefa

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s:998:"{"Response":{"MetaInfo":{"Timestamp":"2019-05-14T11:59:07.488+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_lWsc8knsFwVitNTFX88zmA_xAD","LocationType":"address","DisplayPosition":{"Latitude":51.50341,"Longitude":-0.12765},"NavigationPosition":[{"Latitude":51.50322,"Longitude":-0.12767}],"MapView":{"TopLeft":{"Latitude":51.5045342,"Longitude":-0.129456},"BottomRight":{"Latitude":51.5022858,"Longitude":-0.125844}},"Address":{"Label":"10 Downing Street, London, SW1A 2AA, United Kingdom","Country":"GBR","State":"England","County":"London","City":"London","District":"Westminster","Street":"Downing Street","HouseNumber":"10","PostalCode":"SW1A 2AA","AdditionalData":[{"value":"United Kingdom","key":"CountryName"},{"value":"England","key":"StateName"},{"value":"London","key":"CountyName"}]}}}]}]}}";
1+
s:998:"{"Response":{"MetaInfo":{"Timestamp":"2019-07-30T07:05:35.734+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_lWsc8knsFwVitNTFX88zmA_xAD","LocationType":"address","DisplayPosition":{"Latitude":51.50341,"Longitude":-0.12765},"NavigationPosition":[{"Latitude":51.50322,"Longitude":-0.12767}],"MapView":{"TopLeft":{"Latitude":51.5045342,"Longitude":-0.129456},"BottomRight":{"Latitude":51.5022858,"Longitude":-0.125844}},"Address":{"Label":"10 Downing Street, London, SW1A 2AA, United Kingdom","Country":"GBR","State":"England","County":"London","City":"London","District":"Westminster","Street":"Downing Street","HouseNumber":"10","PostalCode":"SW1A 2AA","AdditionalData":[{"value":"United Kingdom","key":"CountryName"},{"value":"England","key":"StateName"},{"value":"London","key":"CountyName"}]}}}]}]}}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:998:"{"Response":{"MetaInfo":{"Timestamp":"2019-07-30T07:05:35.932+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"City":1.0,"Street":[1.0],"HouseNumber":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_lWsc8knsFwVitNTFX88zmA_xAD","LocationType":"address","DisplayPosition":{"Latitude":51.50341,"Longitude":-0.12765},"NavigationPosition":[{"Latitude":51.50322,"Longitude":-0.12767}],"MapView":{"TopLeft":{"Latitude":51.5045342,"Longitude":-0.129456},"BottomRight":{"Latitude":51.5022858,"Longitude":-0.125844}},"Address":{"Label":"10 Downing Street, London, SW1A 2AA, United Kingdom","Country":"GBR","State":"England","County":"London","City":"London","District":"Westminster","Street":"Downing Street","HouseNumber":"10","PostalCode":"SW1A 2AA","AdditionalData":[{"value":"United Kingdom","key":"CountryName"},{"value":"England","key":"StateName"},{"value":"London","key":"CountyName"}]}}}]}]}}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:6245:"{"Response":{"MetaInfo":{"Timestamp":"2019-07-30T07:12:19.249+0000","NextPageInformation":"2"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"Distance":0.7,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"HouseNumber":1.0,"PostalCode":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_-nSC1VIpTK6RxGk-RZa.1D_xA","LocationType":"address","DisplayPosition":{"Latitude":48.8633,"Longitude":2.38874},"NavigationPosition":[{"Latitude":48.86322,"Longitude":2.38878}],"MapView":{"TopLeft":{"Latitude":48.8644242,"Longitude":2.3870312},"BottomRight":{"Latitude":48.8621758,"Longitude":2.3904488}},"Address":{"Label":"1 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"1","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"1231932773","MapId":"UWAM19121","MapVersion":"Q1/2019","MapReleaseDate":"2019-07-15","Spot":0.84,"SideOfStreet":"left","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149","AddressId":"301293292","RoadLinkId":"551618336"}}},{"Relevance":1.0,"Distance":19.2,"MatchLevel":"street","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"PostalCode":1.0},"Location":{"LocationId":"NT_-nSC1VIpTK6RxGk-RZa.1D_l_1231932772_L","LocationType":"address","DisplayPosition":{"Latitude":48.86315,"Longitude":2.38853},"NavigationPosition":[{"Latitude":48.86315,"Longitude":2.38853}],"MapView":{"TopLeft":{"Latitude":48.86315,"Longitude":2.38847},"BottomRight":{"Latitude":48.86314,"Longitude":2.38853}},"Address":{"Label":"Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"1231932772","MapId":"UWAM19121","MapVersion":"Q1/2019","MapReleaseDate":"2019-07-15","Spot":1.0,"SideOfStreet":"left","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149"}}},{"Relevance":1.0,"Distance":20.0,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"HouseNumber":1.0,"PostalCode":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_jGt0M5q6w3vXrh-8i9g30A_xMD","LocationType":"address","DisplayPosition":{"Latitude":48.8633,"Longitude":2.38853},"NavigationPosition":[{"Latitude":48.86331,"Longitude":2.38836}],"MapView":{"TopLeft":{"Latitude":48.8644242,"Longitude":2.3868212},"BottomRight":{"Latitude":48.8621758,"Longitude":2.3902388}},"Address":{"Label":"13 Place Auguste Métivier, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Place Auguste Métivier","HouseNumber":"13","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"56244035","MapId":"UWAM19121","MapVersion":"Q1/2019","MapReleaseDate":"2019-07-15","Spot":1.0,"SideOfStreet":"right","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149","AddressId":"301244140","RoadLinkId":"43783314"}}},{"Relevance":1.0,"Distance":22.9,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"HouseNumber":1.0,"PostalCode":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_-nSC1VIpTK6RxGk-RZa.1D_zA","LocationType":"address","DisplayPosition":{"Latitude":48.86337,"Longitude":2.38898},"NavigationPosition":[{"Latitude":48.86328,"Longitude":2.38903}],"MapView":{"TopLeft":{"Latitude":48.8644942,"Longitude":2.3872712},"BottomRight":{"Latitude":48.8622458,"Longitude":2.3906888}},"Address":{"Label":"3 Avenue Gambetta, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Avenue Gambetta","HouseNumber":"3","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"1212860160","MapId":"UWAM19121","MapVersion":"Q1/2019","MapReleaseDate":"2019-07-15","Spot":0.31,"SideOfStreet":"left","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149","AddressId":"301293287","RoadLinkId":"528453417"}}},{"Relevance":1.0,"Distance":26.2,"MatchLevel":"houseNumber","MatchQuality":{"Country":1.0,"State":1.0,"County":1.0,"City":1.0,"District":1.0,"Street":[1.0],"HouseNumber":1.0,"PostalCode":1.0},"MatchType":"pointAddress","Location":{"LocationId":"NT_S4HDUP1qC0Wsf6qd4v2h7C_0A","LocationType":"address","DisplayPosition":{"Latitude":48.86344,"Longitude":2.38866},"NavigationPosition":[{"Latitude":48.86348,"Longitude":2.38859}],"MapView":{"TopLeft":{"Latitude":48.8645642,"Longitude":2.3869512},"BottomRight":{"Latitude":48.8623158,"Longitude":2.3903688}},"Address":{"Label":"4 Rue des Amandiers, 75020 Paris, France","Country":"FRA","State":"Île-de-France","County":"Paris","City":"Paris","District":"20e Arrondissement","Street":"Rue des Amandiers","HouseNumber":"4","PostalCode":"75020","AdditionalData":[{"value":"France","key":"CountryName"},{"value":"Île-de-France","key":"StateName"},{"value":"Paris","key":"CountyName"}]},"MapReference":{"ReferenceId":"56242581","MapId":"UWAM19121","MapVersion":"Q1/2019","MapReleaseDate":"2019-07-15","Spot":0.42,"SideOfStreet":"right","CountryId":"20000001","StateId":"20002126","CountyId":"20002127","CityId":"20002128","DistrictId":"20002149","AddressId":"301411378","RoadLinkId":"43615631"}}}]}]}}";

src/Provider/Here/Tests/.cached_responses/reverse.geocoder.api.here.com_2b4dd12c8ea8987438a9d20bc48d3587dcf1d137

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Provider/Here/Tests/.cached_responses/reverse.geocoder.api.here.com_42ff54577c0b177d0d532affcf773ea40a9a949d

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)