PHPackages                             bektigalan/osm-address - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bektigalan/osm-address

ActiveLibrary

bektigalan/osm-address
======================

tools untuk mendapatkan kota/kodepos/provinsi dari alamat yang dimasukkan

v1.0.0(1y ago)08MITPHP

Since Dec 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bektigalan/osm-address)[ Packagist](https://packagist.org/packages/bektigalan/osm-address)[ RSS](/packages/bektigalan-osm-address/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Bektigalan\\OsmAddress
======================

[](#bektigalanosmaddress)

Bektigalan\\OsmAddress is a PHP package that provides geocoding capabilities using the Nominatim service from OpenStreetMap. It allows you to extract city, province, postal code, and other location details from an address string.

Installation
------------

[](#installation)

To use this package in your project, you need to have Composer installed. Then, you can require the package in your project.

```
composer require bektigalan/osm-address
```

Usage
=====

[](#usage)

Here is how you can use the Bektigalan\\OsmAddress package in your project:

Basic Setup
-----------

[](#basic-setup)

```
require 'vendor/autoload.php';

use Bektigalan\OsmAddress\Main;

// Initialize Main class
$geocoder = new Main();

// Example address
$address = 'Jalan Ahmad Yani Nganjuk';

// Get city
$city = $geocoder->getCity($address);
echo "City: $city\n";

// Get province
$province = $geocoder->getProvince($address);
echo "Province: $province\n";

// Get postal code
$postalCode = $geocoder->getPostalCode($address);
echo "Postal Code: $postalCode\n";

// Get full details
$details = $geocoder->getFullDetails($address);
print_r($details);
```

Methods
-------

[](#methods)

`getCity(string $address): string:` Returns the city name from the given address. `getProvince(string $address): string:` Returns the province or state from the given address. `getPostalCode(string $address): string:` Returns the postal code from the given address. `getFullDetails(string $address): array:` Returns an array with full location details including city, province, country, postal code, latitude, longitude, and formatted address.

Error Handling
--------------

[](#error-handling)

The package logs errors using a PSR-3 compatible logger if provided. Ensure that you have a logger set up to capture these logs for debugging purposes.

Requirements
------------

[](#requirements)

PHP 7.4 or higher

License
-------

[](#license)

This package is open-source and available under the MIT License. See LICENSE for more details.

### Explanation

[](#explanation)

- **Installation**: Instructions on how to install the package using Composer.
- **Usage**: Provides example code on how to initialize and use the package, including setting up a logger.
- **Methods**: Describes the available methods and their purposes.
- **Error Handling**: Mentions the use of a PSR-3 logger for capturing errors.
- **Requirements**: Lists the PHP version and other dependencies.
- **License**: MIT License.

This `README.md` serves as a comprehensive guide for users to quickly understand and implement the package in their projects.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

521d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6e6ff3afb2c0efe137025d1d1fcd3b473d6f566f30ff9ebc5335ffd0d0c184f?d=identicon)[bektigalan](/maintainers/bektigalan)

---

Top Contributors

[![bektigalan](https://avatars.githubusercontent.com/u/7407859?v=4)](https://github.com/bektigalan "bektigalan (2 commits)")

### Embed Badge

![Health badge](/badges/bektigalan-osm-address/health.svg)

```
[![Health](https://phpackages.com/badges/bektigalan-osm-address/health.svg)](https://phpackages.com/packages/bektigalan-osm-address)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[api-platform/metadata

API Resource-oriented metadata attributes and factories

223.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
