From 44ec4e5ef5fbc40db67dbdca05c9f7bbc6cd5a79 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 4 Feb 2026 16:20:37 +0100 Subject: [PATCH 1/3] update rootUrl 2026 --- Addok.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Addok.php b/Addok.php index 24d8e08..8e56db6 100644 --- a/Addok.php +++ b/Addok.php @@ -47,7 +47,7 @@ final class Addok extends AbstractHttpProvider implements Provider */ public static function withBANServer(ClientInterface $client) { - return new self($client, 'https://api-adresse.data.gouv.fr'); + return new self($client, 'https://data.geopf.fr/geocodage'); } /** From ffa4e6426d489e71a06a34f38aea41e0dd351dda Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 6 Feb 2026 09:35:13 +0100 Subject: [PATCH 2/3] Update AddokTest.php fix tests --- Tests/AddokTest.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Tests/AddokTest.php b/Tests/AddokTest.php index 97b3b6e..fdd9bf1 100644 --- a/Tests/AddokTest.php +++ b/Tests/AddokTest.php @@ -54,10 +54,9 @@ public function testGeocodeWithRealIPv6() public function testReverseQuery() { $provider = Addok::withBANServer($this->getHttpClient()); - $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(49.031407, 2.060204)); + $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(49.031526, 2.060164)); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); - $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); @@ -79,8 +78,8 @@ public function testGeocodeQuery() /** @var \Geocoder\Model\Address $result */ $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(49.031407, $result->getCoordinates()->getLatitude(), 0.00001); - $this->assertEqualsWithDelta(2.060204, $result->getCoordinates()->getLongitude(), 0.00001); + $this->assertEqualsWithDelta(49.031526, $result->getCoordinates()->getLatitude(), 0.00001); + $this->assertEqualsWithDelta(2.060164, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('6', $result->getStreetNumber()); $this->assertEquals('Quai de la Tourelle', $result->getStreetName()); $this->assertEquals('95000', $result->getPostalCode()); @@ -90,19 +89,19 @@ public function testGeocodeQuery() public function testGeocodeOnlyCityQuery() { $provider = Addok::withBANServer($this->getHttpClient()); - $results = $provider->geocodeQuery(GeocodeQuery::create('Meaux')); + $results = $provider->geocodeQuery(GeocodeQuery::create('Grenoble')); $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(48.95732, $result->getCoordinates()->getLatitude(), 0.00001); - $this->assertEqualsWithDelta(2.902793, $result->getCoordinates()->getLongitude(), 0.00001); + $this->assertEqualsWithDelta(45.182828, $result->getCoordinates()->getLatitude(), 0.00001); + $this->assertEqualsWithDelta(5.724369, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); - $this->assertEquals('77100', $result->getPostalCode()); - $this->assertEquals('Meaux', $result->getLocality()); + $this->assertEquals('38000', $result->getPostalCode()); + $this->assertEquals('Grenoble', $result->getLocality()); } public function testGeocodeHouseNumberTypeQuery() @@ -155,8 +154,8 @@ public function testGeocodeLocalityQuery() $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); - $this->assertEqualsWithDelta(48.871759, $result->getCoordinates()->getLatitude(), 0.00001); - $this->assertEqualsWithDelta(2.294253, $result->getCoordinates()->getLongitude(), 0.00001); + $this->assertEqualsWithDelta(48.871176, $result->getCoordinates()->getLatitude(), 0.00001); + $this->assertEqualsWithDelta(2.292863, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('75016', $result->getPostalCode()); $this->assertEquals('Paris', $result->getLocality()); } From bcf5c7ed1258abb415727aec26fdd13394b49161 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 6 Feb 2026 18:09:35 +0100 Subject: [PATCH 3/3] Update AddokTest.php update test testGeocodeLocalityQuery --- Tests/AddokTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/AddokTest.php b/Tests/AddokTest.php index fdd9bf1..7fdd008 100644 --- a/Tests/AddokTest.php +++ b/Tests/AddokTest.php @@ -154,9 +154,9 @@ public function testGeocodeLocalityQuery() $this->assertInstanceOf('\Geocoder\Model\Address', $result); $this->assertNull($result->getStreetNumber()); $this->assertNull($result->getStreetName()); - $this->assertEqualsWithDelta(48.871176, $result->getCoordinates()->getLatitude(), 0.00001); - $this->assertEqualsWithDelta(2.292863, $result->getCoordinates()->getLongitude(), 0.00001); - $this->assertEquals('75016', $result->getPostalCode()); - $this->assertEquals('Paris', $result->getLocality()); + $this->assertEqualsWithDelta(43.631962, $result->getCoordinates()->getLatitude(), 0.00001); + $this->assertEqualsWithDelta(1.380094, $result->getCoordinates()->getLongitude(), 0.00001); + $this->assertEquals('31700', $result->getPostalCode()); + $this->assertEquals('Blagnac', $result->getLocality()); } }