PHPackages                             liquidedge-app/geo-data - 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. liquidedge-app/geo-data

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

liquidedge-app/geo-data
=======================

A helper lib with Nova Geo Data

1.0.5(9mo ago)0121PHP

Since Mar 26Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/ryno-liquidedge/GeoData)[ Packagist](https://packagist.org/packages/liquidedge-app/geo-data)[ RSS](/packages/liquidedge-app-geo-data/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

GeoData Library
===============

[](#geodata-library)

Welcome to the **GeoData** library! This library provides an easy-to-use solution for parsing and processing geographical and currency-related data using a callback-driven approach. The library is designed to handle data such as countries, provinces, cities, towns, postal codes, and currencies, making it ideal for applications where such structured geographical data is required.

---

Key Features
------------

[](#key-features)

- **Callback-based processing** – Allows you to define custom logic to handle various data structures on a per-record basis.
- **Support for multiple data types**:
    - **Countries, Provinces, and Cities**
    - **Currencies**
    - **Towns**
    - **Postal Codes**
- **Highly extensible and reusable** – Modify or extend functionality as per your project needs.
- Parses CSV files and maps data directly to custom model objects.
- Data-driven from assets, so you're not limited to specific data sources.

---

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

[](#installation)

To add this library to your project:

**Using Composer** (recommended):

```
composer require liquidedge-app/geo-data
```

Alternatively, you can manually download or clone the repository and include it in your project.

---

Basic Usage
-----------

[](#basic-usage)

The `GeoData` library exposes several methods for processing different types of geographical data. All methods accept a callback function as a parameter where you can define your custom logic for handling the data.

### Example: Processing Countries, Provinces, and Cities

[](#example-processing-countries-provinces-and-cities)

```
use LiquidedgeApp\GeoData\GeoData;
use LiquidedgeApp\GeoData\model\Country;
use LiquidedgeApp\GeoData\model\Province;
use LiquidedgeApp\GeoData\model\City;

$geoData = new GeoData();

$geoData->loop_countries(function (Country $country, Province $province, City $city, array $data) {
    echo "Country: " . $country->getName() . "\n";
    echo "Province: " . $province->getName() . "\n";
    echo "City: " . $city->getName() . "\n";
});
```

### Example: Processing Currencies

[](#example-processing-currencies)

```
use LiquidedgeApp\GeoData\GeoData;
use LiquidedgeApp\GeoData\model\Currency;

$geoData = new GeoData();

$geoData->loop_currencies(function (Currency $currency, array $data) {
    echo "Currency: " . $currency->getCode() . " - " . $currency->getName() . "\n";
});
```

### Example: Processing Towns

[](#example-processing-towns)

```
use LiquidedgeApp\GeoData\GeoData;
use LiquidedgeApp\GeoData\model\Town;

$geoData = new GeoData();

$geoData->loop_towns(function (Town $town, array $data) {
    echo "Town: " . $town->getName() . "\n";
});
```

### Example: Processing Postal Codes

[](#example-processing-postal-codes)

```
use LiquidedgeApp\GeoData\GeoData;
use LiquidedgeApp\GeoData\model\PostalCode;

$geoData = new GeoData();

$geoData->loop_postal_codes(function (PostalCode $postalCode, array $data) {
    echo "Postal Code: " . $postalCode->getCode() . "\n";
});
```

---

Directory Structure
-------------------

[](#directory-structure)

The library follows a clean directory structure:

- **`factory`**: Contains helper classes, including `ParseAsset`, responsible for processing and parsing assets.
- **`model`**: Data models such as `Country`, `Currency`, `City`, `Province`, `PostalCode`, and `Town`. These classes define the data entities used in the library.
- **`assets`**: CSV data sources used by the library to parse and provide data. This is where files like `country-city.csv`, `country-currency.csv`, etc., are stored.

---

Methods Overview
----------------

[](#methods-overview)

Below is a summary of the primary methods exposed by the `GeoData` class:

1. **`loop_countries()`**

    - Processes data for countries, provinces, and cities.
    - Parameters:
        - `callable $fn`: Your callback function to handle each data record.
        - `array $options`: Additional options for data parsing (optional).
    - Example use case: Extracting details of each country and its respective provinces/cities.
2. **`loop_currencies()`**

    - Processes currency data.
    - Parameters:
        - `callable $fn`: Your callback function to handle currency records.
        - `array $options`: Additional options for data parsing (optional).
    - Example use case: Extracting country currency information.
3. **`loop_towns()`**

    - Processes data for towns.
    - Parameters:
        - `callable $fn`: Your callback function to handle town records.
        - `array $options`: Additional options for data parsing (optional).
    - Example use case: Getting town details from CSV.
4. **`loop_postal_codes()`**

    - Processes data for postal codes.
    - Parameters:
        - `callable $fn`: Your callback function to handle records.
        - `array $options`: Additional options for data parsing (optional).
    - Example use case: Associating postal codes with towns or suburbs.

---

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

[](#requirements)

- **PHP 7.4 or higher**
- Ensure proper directory structure for `assets` to allow file parsing.

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository.
2. Create a feature branch: `git checkout -b feature-name`.
3. Make changes and test thoroughly.
4. Submit a pull request with a description of your changes.

---

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

Acknowledgments
---------------

[](#acknowledgments)

Special thanks to all contributors and open-source supporters who helped make this library possible.

---

Feel free to reach out with any feedback or issues on the [Issues](https://github.com/liquidedge-app/geodata/issues) page. Happy coding! 🚀

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance58

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Every ~34 days

Total

5

Last Release

275d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/abdefd19bc827b3f998529fe0d6354e7851343db472511097979847b8c650936?d=identicon)[ryno-liquidedge](/maintainers/ryno-liquidedge)

---

Top Contributors

[![ryno-liquidedge](https://avatars.githubusercontent.com/u/126059897?v=4)](https://github.com/ryno-liquidedge "ryno-liquidedge (9 commits)")

### Embed Badge

![Health badge](/badges/liquidedge-app-geo-data/health.svg)

```
[![Health](https://phpackages.com/badges/liquidedge-app-geo-data/health.svg)](https://phpackages.com/packages/liquidedge-app-geo-data)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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