urban-brussels/brussels-permits
最新稳定版本:2.0.0
Composer 安装命令:
composer require urban-brussels/brussels-permits
包简介
PHP wrapper for Nova API, using DTO. 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.
README 文档
README
A PHP library to interact with the Urban Brussels Planning Permits WFS API (Nova). This library allows you to query planning permits (PU) and environmental permits (PE), filter them by location, date, or status, and retrieve detailed information.
composer require urban-brussels/brussels-permits
Configuration
If you are using Symfony, you can configure the service in your services.yaml to enable autowiring:
services:
UrbanBrussels\BrusselsPermits\Service\PermitMapper: ~
UrbanBrussels\WfsClient\WfsClient:
arguments:
$wfsUrl: 'https://geoservices-others.irisnet.be/geoserver/Nova/ows'
UrbanBrussels\BrusselsPermits\PermitsClient:
autowire: true
autoconfigure: true
If you are using this library in a standalone PHP project, you need to instantiate the client manually:
use Symfony\Component\HttpClient\HttpClient;
use UrbanBrussels\BrusselsPermits\PermitsClient;
use UrbanBrussels\BrusselsPermits\Service\PermitMapper;
use UrbanBrussels\WfsClient\WfsClient;
$httpClient = HttpClient::create();
$wfsClient = new WfsClient($httpClient, 'https://geoservices-others.irisnet.be/geoserver/Nova/ows');
$mapper = new PermitMapper();
$client = new PermitsClient($wfsClient, $mapper);
Usage
Version 2.0 introduces PermitsClient, a fluent interface for building queries.
Basic Query
To fetch permits, you must first select the type using from() (PermitType::PU for Urban Planning, PermitType::PE for Environmental), apply filters, and finally call get().
use UrbanBrussels\BrusselsPermits\Model\PermitType;
$permits = $client
->from(PermitType::PU)
->filterByReference('04/PFD/169999')
->get();
foreach ($permits as $permit) {
echo $permit->novaReference; // e.g. 04/PFD/169999
echo $permit->address; // e.g. Rue de la Loi 155, 1040 Bruxelles
}
Migration from 1.x
Version 2.0 introduces breaking changes:
- WFSQueryService is deprecated. You should now use PermitsClient.
- The query logic is now fluent (chained methods) instead of passing large arrays of conditions.
- The Query service helper is also deprecated.
统计信息
- 总下载量: 398
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-30