Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87e2a1e

Browse files
alexsegurajbelien
andauthored
Update Komoot TLD. (#1091)
* Update Komoot TLD. * Update tests and cached responses Co-authored-by: Jonathan Beliën <[email protected]>
1 parent f2fa3c7 commit 87e2a1e

13 files changed

+27
-25
lines changed

src/Provider/Photon/Photon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class Photon extends AbstractHttpProvider implements Provider
4343
*/
4444
public static function withKomootServer(HttpClient $client): self
4545
{
46-
return new self($client, 'https://photon.komoot.de');
46+
return new self($client, 'https://photon.komoot.io');
4747
}
4848

4949
/**

src/Provider/Photon/Tests/.cached_responses/photon.komoot.de_44f05b2deb4d31a52824e4fe033fd14dbfdbfc2c

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

src/Provider/Photon/Tests/.cached_responses/photon.komoot.de_7a311ff9d0c9ac8a34403e815cd943b191433b1c

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

src/Provider/Photon/Tests/.cached_responses/photon.komoot.de_aeef9ba1cccae98d9f4e89494d8fc5a6678e218a

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

src/Provider/Photon/Tests/.cached_responses/photon.komoot.de_f4ac621e4c0bef6e8f8455d6570d3b59817cd0a5

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:455:"{"features":[{"geometry":{"coordinates":[-77.036931,38.900368],"type":"Point"},"type":"Feature","properties":{"osm_id":5076279021,"country":"United States of America","city":"Washington","countrycode":"US","postcode":"20012","locality":"Golden Triangle","type":"house","osm_type":"N","osm_key":"man_made","housenumber":"800","street":"Black Lives Matter Plaza Northwest","osm_value":"surveillance","state":"Washington, D.C."}}],"type":"FeatureCollection"}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:2279:"{"features":[{"geometry":{"coordinates":[-0.1285993,51.5010484],"type":"Point"},"type":"Feature","properties":{"osm_id":2806295309,"country":"United Kingdom","city":"London","countrycode":"GB","postcode":"SW1P 3AE","locality":"Westminster","county":"Greater London","type":"house","osm_type":"N","osm_key":"office","housenumber":"8\u201310","street":"Great George Street","district":"Millbank","osm_value":"warmonger","name":"Finmeccanica UK Ltd","state":"England"}},{"geometry":{"coordinates":[-0.12770820958562096,51.50344025],"type":"Point"},"type":"Feature","properties":{"osm_id":1879842,"extent":[-0.1278356,51.5036483,-0.1273038,51.5032573],"country":"United Kingdom","countrycode":"GB","postcode":"SW1A 2AA","locality":"Westminster","county":"Greater London","type":"house","osm_type":"R","osm_key":"tourism","housenumber":"10","street":"Downing Street","district":"Covent Garden","osm_value":"attraction","name":"Prime Minister\u2019s Office","state":"England"}},{"geometry":{"coordinates":[-0.2765595,51.6136283],"type":"Point"},"type":"Feature","properties":{"osm_id":7179640410,"country":"United Kingdom","city":"Edgware, London","countrycode":"GB","postcode":"HA8 7JJ","county":"Greater London","type":"house","osm_type":"N","osm_key":"amenity","housenumber":"103","street":"Station Road","district":"Mill Hill","osm_value":"bank","name":"HSBC UK","state":"England"}},{"geometry":{"coordinates":[-0.1050314,51.5149368],"type":"Point"},"type":"Feature","properties":{"osm_id":6878399378,"country":"United Kingdom","city":"City of London","countrycode":"GB","postcode":"EC4A 4AD","locality":"Blackfriars","county":"Greater London","type":"house","osm_type":"N","osm_key":"office","housenumber":"10","street":"Saint Bride Street","osm_value":"company","name":"techUK","state":"England"}},{"geometry":{"coordinates":[-0.0469504,51.6429794],"type":"Point"},"type":"Feature","properties":{"osm_id":2444967088,"country":"United Kingdom","city":"London Borough of Enfield","countrycode":"GB","postcode":"EN3 4ES","locality":"Enfield Highway","county":"Greater London","type":"house","osm_type":"N","osm_key":"shop","housenumber":"106","street":"High Street","district":"Ponders End","osm_value":"car_parts","name":"UK Garage","state":"England"}}],"type":"FeatureCollection"}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:455:"{"features":[{"geometry":{"coordinates":[9.998645,51.9982968],"type":"Point"},"type":"Feature","properties":{"osm_id":693697564,"country":"Deutschland","city":"Lamspringe","countrycode":"DE","postcode":"31195","county":"Landkreis Hildesheim","type":"house","osm_type":"N","osm_key":"tourism","street":"Evensener Dorfstraße","district":"Sehlem","osm_value":"information","name":"Geographischer Punkt","state":"Niedersachsen"}}],"type":"FeatureCollection"}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:455:"{"features":[{"geometry":{"coordinates":[2.3890894,48.8631927],"type":"Point"},"type":"Feature","properties":{"osm_id":1988097192,"country":"France","city":"Paris","countrycode":"FR","postcode":"75020","locality":"Campagne à Paris","county":"Paris","type":"house","osm_type":"N","osm_key":"place","housenumber":"10","street":"Avenue Gambetta","district":"Quartier Saint-Fargeau","osm_value":"house","state":"Île-de-France"}}],"type":"FeatureCollection"}";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s:246:"{"features":[{"geometry":{"coordinates":[0,0],"type":"Point"},"type":"Feature","properties":{"osm_id":3815077900,"osm_type":"N","osm_key":"man_made","osm_value":"monitoring_station","name":"Soul Buoy","type":"house"}}],"type":"FeatureCollection"}";

src/Provider/Photon/Tests/IntegrationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class IntegrationTest extends ProviderIntegrationTest
2828
protected $testIpv6 = false;
2929

3030
protected $skippedTests = [
31+
'testGeocodeQuery' => 'Photon API returns "Great George Street" for "10 Downing St, London, UK" query.',
3132
'testReverseQueryWithNoResults' => 'Photon API returns "Atlas Buoy 0.00E 0.00N" for reverse query at 0,0.',
3233
];
3334

src/Provider/Photon/Tests/PhotonTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,26 @@ public function testGeocodeWithRealIPv6()
5757
public function testGeocodeQuery()
5858
{
5959
$provider = Photon::withKomootServer($this->getHttpClient());
60-
$results = $provider->geocodeQuery(GeocodeQuery::create('35 avenue jean de bologne 1020 bruxelles'));
60+
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));
6161

6262
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
6363
$this->assertCount(1, $results);
6464

6565
/** @var \Geocoder\Model\Address $result */
6666
$result = $results->first();
6767
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
68-
$this->assertEquals(50.896344, $result->getCoordinates()->getLatitude(), '', 0.00001);
69-
$this->assertEquals(4.3605984, $result->getCoordinates()->getLongitude(), '', 0.00001);
70-
$this->assertEquals('35', $result->getStreetNumber());
71-
$this->assertEquals('Avenue Jean de Bologne - Jean de Bolognelaan', $result->getStreetName());
72-
$this->assertEquals('1020', $result->getPostalCode());
73-
$this->assertEquals('Ville de Bruxelles - Stad Brussel', $result->getLocality());
74-
$this->assertEquals('Belgium', $result->getCountry());
75-
76-
$this->assertEquals(220754533, $result->getOSMId());
77-
$this->assertEquals('W', $result->getOSMType());
78-
$this->assertEquals('building', $result->getOSMTag()->key);
79-
$this->assertEquals('yes', $result->getOSMTag()->value);
68+
$this->assertEquals(48.8631927, $result->getCoordinates()->getLatitude(), '', 0.00001);
69+
$this->assertEquals(2.3890894, $result->getCoordinates()->getLongitude(), '', 0.00001);
70+
$this->assertEquals('10', $result->getStreetNumber());
71+
$this->assertEquals('Avenue Gambetta', $result->getStreetName());
72+
$this->assertEquals('75020', $result->getPostalCode());
73+
$this->assertEquals('Paris', $result->getLocality());
74+
$this->assertEquals('France', $result->getCountry());
75+
76+
$this->assertEquals(1988097192, $result->getOSMId());
77+
$this->assertEquals('N', $result->getOSMType());
78+
$this->assertEquals('place', $result->getOSMTag()->key);
79+
$this->assertEquals('house', $result->getOSMTag()->value);
8080
}
8181

8282
public function testReverseQuery()
@@ -90,15 +90,15 @@ public function testReverseQuery()
9090
/** @var \Geocoder\Model\Address $result */
9191
$result = $results->first();
9292
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
93-
$this->assertEquals(52.004657, $result->getCoordinates()->getLatitude(), '', 0.00001);
94-
$this->assertEquals(10.012148, $result->getCoordinates()->getLongitude(), '', 0.00001);
93+
$this->assertEquals(51.9982968, $result->getCoordinates()->getLatitude(), '', 0.00001);
94+
$this->assertEquals(9.998645, $result->getCoordinates()->getLongitude(), '', 0.00001);
9595
$this->assertEquals('31195', $result->getPostalCode());
9696
$this->assertEquals('Lamspringe', $result->getLocality());
97-
$this->assertEquals('Germany', $result->getCountry());
97+
$this->assertEquals('Deutschland', $result->getCountry());
9898

99-
$this->assertEquals(15219847, $result->getOSMId());
100-
$this->assertEquals('W', $result->getOSMType());
101-
$this->assertEquals('highway', $result->getOSMTag()->key);
102-
$this->assertEquals('tertiary', $result->getOSMTag()->value);
99+
$this->assertEquals(693697564, $result->getOSMId());
100+
$this->assertEquals('N', $result->getOSMType());
101+
$this->assertEquals('tourism', $result->getOSMTag()->key);
102+
$this->assertEquals('information', $result->getOSMTag()->value);
103103
}
104104
}

0 commit comments

Comments
 (0)