ici-brussels/urbis-php

A php class for UrbIS Geolocalization services

0.1.3 2017-11-05 08:59 UTC

This package is not auto-updated.

Last update: 2024-11-20 09:34:06 UTC


README

UrbIS®© comprises a set of geographical databases of the Brussels-Capital Region and online services enabling the convenient use of these data.

urbis-php gives developpers a tool to use it easily with PHP.

Install

The tool only requires PHP 7.0+ and guzzlehttp/guzzle.

Use it via composer + packagist: https://packagist.org/packages/ici-brussels/urbis-php

Usage

$urbis = new Urbis_Geoloc();

// Find relevant address according to input
/* Option 1: Structured */
$urbis->getAddress_Structured("rue américaine", "25", "1060", "fr");
/* Option 2: Unstructured */
$urbis->getAddress_Unstructured("rue américaine 25", "fr");

// get array with validated address
$result = $urbis->getStructuredAddress();
print_r($result);
/*
Array
(
    [StreetName] => Rue Américaine
    [StreetNumber] => 25
    [PostalCode] => 1060
    [MunicipalityName] => Saint-Gilles
)
*/

// get array with latitude/longitude
$result = $urbis->getGeographicalLocation();
print_r($result);
/*
Array
(
    [lat] => 50.824197276153
    [lon] => 4.3554360355926
)
*/

Credits

  • Created by Bruno Veyckemans (ici Bruxelles). All comments and suggestions welcome !
  • Realized by means of Brussels UrbIS®© - CIRB