PHPackages                             swisnl/geocoder-php-nationaal-georegister-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. swisnl/geocoder-php-nationaal-georegister-provider

ActiveLibrary[API Development](/categories/api)

swisnl/geocoder-php-nationaal-georegister-provider
==================================================

PDOK (formerly Nationaal Georegister) provider for Geocoder PHP

1.7.0(1y ago)28330.8k—8%52MITPHPPHP ^8.0CI passing

Since Feb 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/swisnl/geocoder-php-nationaal-georegister-provider)[ Packagist](https://packagist.org/packages/swisnl/geocoder-php-nationaal-georegister-provider)[ Docs](https://github.com/swisnl/geocoder-php-nationaal-georegister-provider)[ RSS](/packages/swisnl-geocoder-php-nationaal-georegister-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (2)

PDOK (formerly Nationaal Georegister) provider for Geocoder PHP
===============================================================

[](#pdok-formerly-nationaal-georegister-provider-for-geocoder-php)

[![PHP from Packagist](https://camo.githubusercontent.com/981a251e0bd7baf3997d7d2bdd33943aebfabab584c162f0d2aac485989df168/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swisnl/geocoder-php-nationaal-georegister-provider)[![Latest Version on Packagist](https://camo.githubusercontent.com/c846a5737f3c4a9201b236a3394ea7b168ae30de777f645dc98053f95ba00548/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swisnl/geocoder-php-nationaal-georegister-provider)[![Software License](https://camo.githubusercontent.com/63ea76ca1a0a49c38b5eaaa929cc1857693a6c9046c9c2c2e4e29d75d402d6cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Buy us a tree](https://camo.githubusercontent.com/cec0a9b35a1c3235bdbe0d13ea8fbd866a23e30280ad6ca27078c1fd4ac1b709/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://plant.treeware.earth/swisnl/geocoder-php-nationaal-georegister-provider)[![Build Status](https://camo.githubusercontent.com/c5df6a8086f9545edb315b49cd412e6ed0894c2cfdb37a5915257409c87a30c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636865636b732d7374617475732f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722f6d61737465723f6c6162656c3d7465737473)](https://github.com/swisnl/geocoder-php-nationaal-georegister-provider/actions/workflows/tests.yml)[![Coverage Status](https://camo.githubusercontent.com/d5042c97e92ab98d90a3c98b6483c057f885dc31ce5e2b76ade268e90b81c5dc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/swisnl/geocoder-php-nationaal-georegister-provider/code-structure)[![Quality Score](https://camo.githubusercontent.com/3dc35cfc7b74bdc3f6134dee338d79ed4d93e6ce430fbe2003850efaff03b4ee/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/swisnl/geocoder-php-nationaal-georegister-provider)[![Total Downloads](https://camo.githubusercontent.com/1a4ee0bbbae4481755d1cc900339ad8139b3534465d8c4f477a93901b1429673/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737769736e6c2f67656f636f6465722d7068702d6e6174696f6e61616c2d67656f72656769737465722d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swisnl/geocoder-php-nationaal-georegister-provider)[![Made by SWIS](https://camo.githubusercontent.com/ef6bdd6ab8d4f47bceb74dcf558b0915c6b419cbba320096324af0518e43091d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539412538302d6d6164652532306279253230535749532d2532333037333741392e7376673f7374796c653d666c61742d737175617265)](https://www.swis.nl)

This is the [PDOK](https://www.pdok.nl/) (formerly Nationaal Georegister) provider for the [PHP Geocoder](https://github.com/geocoder-php/Geocoder), which uses the [PDOK Locatieserver v3 (Dutch)](https://www.pdok.nl/introductie/-/article/pdok-locatieserver-1). It can geocode addresses (not IP addresses) and reverse geocode coordinates.

Please note that this provider can only (reverse) geocode addresses in The Netherlands!

Install
-------

[](#install)

Via Composer

```
$ composer require swisnl/geocoder-php-nationaal-georegister-provider
```

### HTTP Client

[](#http-client)

PHP Geocoder is decoupled from any HTTP messaging client with the help of [PSR-18 HTTP Client](https://www.php-fig.org/psr/psr-18/). This requires another package providing [psr/http-client-implementation](https://packagist.org/providers/psr/http-client-implementation). To use Guzzle 7, for example, simply require `guzzlehttp/guzzle`:

```
$ composer require guzzlehttp/guzzle
```

Usage
-----

[](#usage)

```
// Create geocoder
$client = new \GuzzleHttp\Client();
$geocoder = new \Swis\Geocoder\NationaalGeoregister\NationaalGeoregister($client);

// Geocode!
$query = \Geocoder\Query\GeocodeQuery::create(...);
$result = $geocoder->geocodeQuery($query);
```

Please see [PHP Geocoder documentation](http://geocoder-php.org/Geocoder/) for more information about using PHP Geocoder with this provider.

### Options

[](#options)

This provider accepts extra options in the constructor, or as query data. These options are directly passed to the Locatieserver, which accepts the following options:

OptionDescriptionDefaultCustomizable in this providerbqBoost query"type:gemeente^0.5 type:woonplaats^0.5 type:weg^1.0 type:postcode^1.5 type:adres^1.5"yesdfDefault field-yesflField listAll fields used by this providernofqFilter query-yeslat&amp;lonLatitude and longitudeCoordinates from `\Geocoder\Query\ReverseQuery` when reverse geocodingonly for geocodingqSearch termText from `\Geocoder\Query\GeocodeQuery` when geocodingnorowsAmount of rowsLimit from querynostartPage (starting at 0)-yessortSortingSee [Locatieserver documentation (Dutch)](https://github.com/PDOK/locatieserver/wiki/API-Locatieserver#52url-parameters)yeswtFormatJSONnoThese options correspond with the options mentioned in the [Locatieserver documentation (Dutch)](https://github.com/PDOK/locatieserver/wiki/API-Locatieserver#52url-parameters), which describes them in more detail.

Example using extra options:

```
// On the geocoder instance:
$client = new \GuzzleHttp\Client();
$options = ['fq' => 'bron:BAG'];
$geocoder = new \Swis\Geocoder\NationaalGeoregister\NationaalGeoregister($client, $options);

// Or just once on the query:
$query = \Geocoder\Query\GeocodeQuery::create(...)->withData('fq', 'bron:BAG');
```

### Response

[](#response)

The geocoder returns a `\Geocoder\Model\AddressCollection` which is a collection of `\Geocoder\Model\Address`.

Example response (first `\Geocoder\Model\Address` from collection) for query "3e Binnenvestgracht 23T1, Leiden" using this provider:

```
$address->getCoordinates() => \Geocoder\Model\Coordinates
$address->getLatitude() => 52.164203
$address->getLongitude() => 4.49202289
$address->getBounds() => null (unavailable)
$address->getStreetNumber() => '23T-1'
$address->getStreetName() => '3e Binnenvestgracht'
$address->getPostalCode() => '2312NR'
$address->getLocality() => 'Leiden'
$address->getSubLocality() => null (unavailable)
$address->getAdminLevels()->get(2)->getName() => 'Leiden'
$address->getAdminLevels()->get(2)->getCode() => '0546'
$address->getAdminLevels()->get(1)->getName() => 'Zuid-Holland'
$address->getAdminLevels()->get(1)->getCode() => 'PV28'
$address->getCountry() => 'Netherlands' (static)
$address->getCountryCode() => 'NL' (static)
$address->getTimezone() => 'Europe/Amsterdam' (static)
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jasper Zonneveld](https://github.com/JaZo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/swisnl/geocoder-php-nationaal-georegister-provider) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

SWIS ❤️ Open Source
-------------------

[](#swis-heart-open-source)

[SWIS](https://www.swis.nl) is a web agency from Leiden, the Netherlands. We love working with open source software.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance47

Moderate activity, may be stable

Popularity46

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~291 days

Recently: every ~387 days

Total

10

Last Release

398d ago

PHP version history (5 changes)1.0.0PHP ^7.0

1.3.0PHP ^7.2 || ^8.0

1.4.0PHP ^7.3 || ^8.0

1.5.0PHP ^7.4 || ^8.0

1.7.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8734305?v=4)[SWIS](/maintainers/swisnl)[@swisnl](https://github.com/swisnl)

---

Top Contributors

[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (57 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (4 commits)")[![bbrala](https://avatars.githubusercontent.com/u/3294970?v=4)](https://github.com/bbrala "bbrala (1 commits)")[![MathieuMaas](https://avatars.githubusercontent.com/u/34303750?v=4)](https://github.com/MathieuMaas "MathieuMaas (1 commits)")

---

Tags

adapterdutchgeocodergeoregisterhacktoberfestimplementationlocatieservernationaal-georegisterngrpdokphp-geocoderprovidergeocoderproviderswisnlswisnationaal-georegisterngr

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/swisnl-geocoder-php-nationaal-georegister-provider/health.svg)

```
[![Health](https://phpackages.com/badges/swisnl-geocoder-php-nationaal-georegister-provider/health.svg)](https://phpackages.com/packages/swisnl-geocoder-php-nationaal-georegister-provider)
```

###  Alternatives

[willdurand/geocoder-bundle

Integration of Geocoder into Symfony

3226.4M12](/packages/willdurand-geocoder-bundle)[yandex/geo

PHP-library for interactions with geo-coding Yandex.Maps

117309.0k3](/packages/yandex-geo)[swisnl/openapi-spec-generator

Creates Open API spec for a Laravel JSON:API

2338.1k](/packages/swisnl-openapi-spec-generator)[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)[swisnl/laravel-mautic

Laravel wrapper for Mautic API

1115.6k](/packages/swisnl-laravel-mautic)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
