kusaasira/uganda-geo

在乌干达查找地区、县、次县、教区和村庄

1.0.0 2022-04-24 20:38 UTC

This package is auto-updated.

Last update: 2024-09-29 06:36:08 UTC


README

这是一个PHP包,可以检索乌干达的各个地区及其对应的县、次县、教区和村庄。这些数据是从乌干达护照官方网站抓取的。

描述

此包让您能够访问从地区、县、次县、教区到村庄的所有子级别。您还可以独立访问所提到的不同地区。

目录

要求

为了运行此项目,请确保您已安装:

  • PHP 7.4或更高版本
  • Composer

安装

此项目使用Composer。

$ composer require kusaasira/uganda-geo

使用方法

以下示例显示了包的用法及其输出结果

检索地区数据。

use Uganda\Uganda;

$uganda = new Uganda();

# Retrieve all districts
$districts = $uganda->districts();

# Retrieve all counties in a particular district
$counties = $uganda
    ->district('Mukono')
    ->counties();

# Retrieve all sub counties in a particular district
$subCounties = $uganda
    ->district('Mukono')
    ->subCounties();


# Retrieve all parishes in a particular district
$parishes = $uganda
    ->district('Mukono')
    ->parishes();

# Retrieve all villages in a particular district
$villages = $uganda
    ->district('Mukono')
    ->villages();

检索县数据。

use Uganda\Uganda;

$uganda = new Uganda();

# Retrieve all counties
$counties = $uganda->counties();

# Retrieve specific county
$county = $uganda->county('Adjumani West County');

# Retrieve all sub counties in a particular county
$subCounties = $uganda
    ->county('Adjumani West County')
    ->subCounties();

# Retrieve all parishes in a particular county
$parishes = $uganda
    ->county('Adjumani West County')
    ->parishes();

# Retrieve all villages in a particular county
$villages = $uganda
    ->county('Adjumani West County')
    ->villages();

检索次县数据。

use Uganda\Uganda;

$uganda = new Uganda();

# Retrieve all sub counties
$subCounties = $uganda->subCounties();

# Retrieve specific sub county
$subCounty = $uganda->subCounty('Namasale Town Council');

# Retrieve all parishes in a particular sub county
$parishes = $uganda
    ->county('Namasale Town Council')
    ->parishes();

# Retrieve all villages in a particular sub county
$villages = $uganda
    ->county('Namasale Town Council')
    ->villages();

检索教区数据。

use Uganda\Uganda;

$uganda = new Uganda();

# Retrieve all parishes
$parishes = $uganda->parishes();

# Retrieve specific parish
$parish = $uganda->parish('Bunamwamba');

# Retrieve all villages in a particular parish
$villages = $uganda
    ->county('Bunamwamba')
    ->villages();

检索村庄数据。

use Uganda\Uganda;

$uganda = new Uganda();

# Retrieve all villages
$villages = $uganda->villages();

# Retrieve specific village
$subCounty = $uganda->village('Ayeye');

致谢

此包中使用的数据是从乌干达护照官方网站抓取的,因为自2018年以来没有发布任何更新的地理数据源。

合作者 ✨

贡献者 ✨

许可证

此包是免费软件,根据MIT许可证条款分发。