urban-brussels / nova-api
PHP wrapper for Nova API. Nova is a shared IT platform of the Brussels-Capital Region dedicated to the file management of planning permits, land division permits and environmental licences.
0.8.2
2023-01-05 08:53 UTC
Requires
- php: ^8.1
- ext-intl: *
- ici-be/ici-tools: 0.3.*
- maennchen/zipstream-php: ^2.1
- phayes/geophp: ^1.2
- symfony/http-client: 6.*
- symfony/http-foundation: ^5.4|^6.0
Requires (Dev)
- roave/security-advisories: dev-latest
README
PHP wrapper for the API of Nova. Nova is a shared IT platform of the Brussels-Capital Region dedicated to the file management of planning permits, land division permits and environmental licences. Permit applications can be viewed online on OpenPermits.brussels.
Installation
composer require urban-brussels/nova-api
Usage
use UrbanBrussels\NovaApi\Attribute;
use UrbanBrussels\NovaApi\PermitQuery;
use UrbanBrussels\NovaApi\PermitCollection;
$query = new PermitQuery('PU'); // Create a query for planning (PU) or environmental (PE) licences
$permits = $query
->filterByAttributeArray(Attribute::REFERENCE_NOVA, ['04/PFD/1796029', '04/PFD/1795271']) // Filter by Nova References
->setOrder(Attribute::DATE_SUBMISSION, 'DESC') // Order by descending submission date
->setLimit(2) // Limit to 2 results
->getResults();
// You now have a PermitCollection object, that can be used in a loop
foreach ($permits->getPermits() as $permit)
{
echo $permit->getReferenceNova();
echo $permit->getAddress();
echo $permit->getDateInquiryEnd();
echo $permit->hasActiveInquiry();
}
// Other available getters
// Get Address in an array (street name FR/NL, street number, municipality FR/NL)
$permit->getAddress();
// Get Type and Subtype
$permit->getType();
$permit->getSubtype();
// Get an array of Links related to this permit request (Nova, OpenPermits, Nova API)
$permit->getLinks();
// Get Description of the requested permit, in an array FR/NL
$permit->getObject();
// Get Public inquiry dates
$permit->getDateInquiryBegin();
$permit->getDateInquiryEnd();
// Get Submission Date
$permit->getDateSubmission();
// Get Notification Date
$permit->getDateNotification();
// Get a multidimensional array with the Area Typology (existing, projected, authorized areas for each type)
$permit->getAreaTypology();
// Submission language (FR or NL)
$permit->getLanguage();
Other queries examples
use UrbanBrussels\NovaApi\PermitQuery;
use UrbanBrussels\NovaApi\PermitCollection;
$query = new PermitQuery('PU');
// Retrieve all requests in public inquiry for the date 2022-01-01 (PU for planning requests, PE for environmental requests)
$permits = $query->filterByInquiryDate('2022-01-01')
->getResults();
// Filters can be combined
$permits = $query->filterByAttribute(Attribute::STREETNAME_FR, 'Rue de Dublin') // First filter to limit by street
->filterByAttribute(Attribute::LANGUAGE, 'NL'); // Second filter to limit to applications in Dutch
->getResults();
// If you use a raw cql_filter, you can query what you want (e.g. every permit request for a given Street + Zipcode)
$permits = $query->filterByRawCQL("streetnamefr = 'Rue de Dublin' AND zipcode='1050'" )
->getResults();
Advantages
This library fixes the following inconsistencies in the Nova WFS webservices
- Different attributes names for PE and PU
- Attributes names mixing french and english
- Different DateTime patterns (with or without microseconds)
- Boolean values returned as string (e.g.: incidences, mpp)
- Too deep json for suspensions
- Integer values returned as string (e.g. novaseq, zipcode)
- Status must be guessed mixing different attributes
- Redundancy
- Incorrect values (e.g. submissions in the year 1111)
- Number "to" same as number "from" in addresses