Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Provider/Photon/Photon.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class Photon extends AbstractHttpProvider implements Provider
*/
public static function withKomootServer(HttpClient $client): self
{
return new self($client, 'https://photon.komoot.de');
return new self($client, 'https://photon.komoot.io');
}

/**
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +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"}";
1 change: 1 addition & 0 deletions src/Provider/Photon/Tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class IntegrationTest extends ProviderIntegrationTest
protected $testIpv6 = false;

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

Expand Down
40 changes: 20 additions & 20 deletions src/Provider/Photon/Tests/PhotonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,26 @@ public function testGeocodeWithRealIPv6()
public function testGeocodeQuery()
{
$provider = Photon::withKomootServer($this->getHttpClient());
$results = $provider->geocodeQuery(GeocodeQuery::create('35 avenue jean de bologne 1020 bruxelles'));
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));

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

/** @var \Geocoder\Model\Address $result */
$result = $results->first();
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
$this->assertEquals(50.896344, $result->getCoordinates()->getLatitude(), '', 0.00001);
$this->assertEquals(4.3605984, $result->getCoordinates()->getLongitude(), '', 0.00001);
$this->assertEquals('35', $result->getStreetNumber());
$this->assertEquals('Avenue Jean de Bologne - Jean de Bolognelaan', $result->getStreetName());
$this->assertEquals('1020', $result->getPostalCode());
$this->assertEquals('Ville de Bruxelles - Stad Brussel', $result->getLocality());
$this->assertEquals('Belgium', $result->getCountry());

$this->assertEquals(220754533, $result->getOSMId());
$this->assertEquals('W', $result->getOSMType());
$this->assertEquals('building', $result->getOSMTag()->key);
$this->assertEquals('yes', $result->getOSMTag()->value);
$this->assertEquals(48.8631927, $result->getCoordinates()->getLatitude(), '', 0.00001);
$this->assertEquals(2.3890894, $result->getCoordinates()->getLongitude(), '', 0.00001);
$this->assertEquals('10', $result->getStreetNumber());
$this->assertEquals('Avenue Gambetta', $result->getStreetName());
$this->assertEquals('75020', $result->getPostalCode());
$this->assertEquals('Paris', $result->getLocality());
$this->assertEquals('France', $result->getCountry());

$this->assertEquals(1988097192, $result->getOSMId());
$this->assertEquals('N', $result->getOSMType());
$this->assertEquals('place', $result->getOSMTag()->key);
$this->assertEquals('house', $result->getOSMTag()->value);
}

public function testReverseQuery()
Expand All @@ -90,15 +90,15 @@ public function testReverseQuery()
/** @var \Geocoder\Model\Address $result */
$result = $results->first();
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
$this->assertEquals(52.004657, $result->getCoordinates()->getLatitude(), '', 0.00001);
$this->assertEquals(10.012148, $result->getCoordinates()->getLongitude(), '', 0.00001);
$this->assertEquals(51.9982968, $result->getCoordinates()->getLatitude(), '', 0.00001);
$this->assertEquals(9.998645, $result->getCoordinates()->getLongitude(), '', 0.00001);
$this->assertEquals('31195', $result->getPostalCode());
$this->assertEquals('Lamspringe', $result->getLocality());
$this->assertEquals('Germany', $result->getCountry());
$this->assertEquals('Deutschland', $result->getCountry());

$this->assertEquals(15219847, $result->getOSMId());
$this->assertEquals('W', $result->getOSMType());
$this->assertEquals('highway', $result->getOSMTag()->key);
$this->assertEquals('tertiary', $result->getOSMTag()->value);
$this->assertEquals(693697564, $result->getOSMId());
$this->assertEquals('N', $result->getOSMType());
$this->assertEquals('tourism', $result->getOSMTag()->key);
$this->assertEquals('information', $result->getOSMTag()->value);
}
}