cvilleger/geo-gouv 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cvilleger/geo-gouv

最新稳定版本:0.2.0

Composer 安装命令:

composer require cvilleger/geo-gouv

包简介

Simple Geo Gouv Library. Query geographic reference data easily.

关键字:

README 文档

README

GitHub Actions Workflow Status Packagist Version Packagist Downloads GitHub License

cvilleger/geo-gouv

About

Query geographic reference data easily using offline data from 🇫🇷 Gouv administrative division API.

Features

  • Query all departments data
  • Query all municipalities by department code

Requirements

  • PHP 8.3 or above

Installation

Install this package as a dependency using Composer.

  composer require cvilleger/geo-gouv

Note that this package has zero composer dependencies.

Usage

Retrieve departments

use Cvilleger\GeoGouv\Client;

$client = new Client();

$departements = $client->getDepartements();

print_r($departements[0]);
/*
Cvilleger\GeoGouv\Model\Departement Object
(
    [nom] => Ain
    [code] => 01
    [codeRegion] => 84
    [coordinates] => 46.06551335, 5.28478031423462
    [region] => Cvilleger\GeoGouv\Model\Region Object
        (
            [nom] => Auvergne-Rhône-Alpes
            [code] => 84
        )

)
*/

Retrieve municipalities by department code

use Cvilleger\GeoGouv\Client;

$client = new Client();

$communes = $client->getCommunesByDepartementCode('01');

print_r($communes[0]);
/*
(
    [nom] => L'Abergement-Clémenciat
    [code] => 01001
    [codesPostaux] => Array
        (
            [0] => 01400
        )

    [centre] => Cvilleger\GeoGouv\Model\Centre Object
        (
            [type] => Point
            [coordinates] => Array
                (
                    [0] => 4.9306
                    [1] => 46.1517
                )

        )

    [surface] => 1564.5
    [population] => 832
    [departement] => Cvilleger\GeoGouv\Model\CommuneDepartement Object
        (
            [nom] => Ain
            [code] => 01
        )

    [region] => Cvilleger\GeoGouv\Model\CommuneRegion Object
        (
            [nom] => Auvergne-Rhône-Alpes
            [code] => 84
        )

)
*/

统计信息

  • 总下载量: 2.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-27