PHP code example of b35 / vivoo-poi-client

1. Go to this page and download the library: Download b35/vivoo-poi-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

b35 / vivoo-poi-client example snippets


use B35\Vivoo\PoiClient;

$client = new PoiClient();

// List all available collections
$collections = $client->getCollections();

// Fetch features from a collection (with optional limit and bounding box)
$features = $client->getFeatures('POI', [
    'limit' => 10,
    'bbox'  => [2.5, 50.6, 5.9, 51.6],
]);

// Fetch a single feature by ID
$feature = $client->getFeature('POI', '12345');

use B35\Vivoo\CqlFilter;
use B35\Vivoo\PoiClient;

$client = new PoiClient();

// Filter by address
$filter = (new CqlFilter())->address(
    straat:     'Bergensesteenweg',
    huisnummer: '709',
    gemeente:   'Sint-Pieters-Leeuw',
)->build();

$features = $client->getFeatures('POI', [
    'filter'      => $filter,
    'filter-lang' => 'cql2-text',
]);

$filter = (new CqlFilter())
    ->equals('PRODUCT', 'VlaamseInventarisOngeschikteOnbewoonbareWoningen')
    ->address(gemeente: 'Antwerpen')
    ->build();
// PRODUCT='VlaamseInventarisOngeschikteOnbewoonbareWoningen' AND GEMEENTE='Antwerpen'

use B35\Vivoo\Exception\ApiException;

try {
    $features = $client->getFeatures('unknown-collection');
} catch (ApiException $e) {
    echo $e->getStatusCode();    // HTTP status code
    echo $e->getResponseBody();  // Raw response body
}