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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bektigalan/osm-address

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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 today

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 26% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

575d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7407859?v=4)[Bekti Galan](/maintainers/bektigalan)[@bektigalan](https://github.com/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.5k5.9M738](/packages/sylius-sylius)[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M692](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)

PHPackages © 2026

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