PHPackages                             joacub/geonames-server - 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. joacub/geonames-server

ActiveModule

joacub/geonames-server
======================

ZF2 module, index geonames data &amp; provides a search API using Elasticsearch

07PHP

Since Apr 10Pushed 13y ago1 watchersCompare

[ Source](https://github.com/joacub/GeonamesServer)[ Packagist](https://packagist.org/packages/joacub/geonames-server)[ RSS](/packages/joacub-geonames-server/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

GeonamesServer
==============

[](#geonamesserver)

Introduction
------------

[](#introduction)

GeonamesServer is [ZF2](http://framework.zend.com/) module. It indexes [geonames data](http://www.geonames.org/) &amp; provides a search API using [Elasticsearch](http://www.elasticsearch.org/).
[Elasticsearch](http://www.elasticsearch.org/) is a distributed, RESTful, open source search server based on [Apache Lucene](http://lucene.apache.org/).

→ [Demo](http://demo.ghislainf.me/geonames)
→ [Composer package](https://packagist.org/packages/ghislainf/geonames-server)

Elasticsearch index mapping
---------------------------

[](#elasticsearch-index-mapping)

```
{
    "geonameid": "2988507",
    "country": "FR",
    "name": "Paris",
    "latitude": "48.85341",
    "longitude": "2.3488",
    "population": 2138551,
    "timezone": "Europe/Paris",
    "type": "city",
    "parents": [
        {
            "geonameid": "2968815",
            "name": "Paris",
            "country": "FR",
            "type": "ADM2"
        },
        {
            "geonameid": "3012874",
            "name": "Île-de-France",
            "country": "FR",
            "type": "ADM1"
        },
        {
            "geonameid": "3017382",
            "name": "France",
            "country": "FR",
            "type": "country"
        }
    ]
}
```

Module installation
-------------------

[](#module-installation)

1. install elasticsearch
2. `cd my/project/directory`
3. create a `composer.json` file with following contents:

    ```
    {
        "require": {
            "ghislainf/geonames-server": "dev-master"
        }
    }
    ```
4. install composer via `curl -s http://getcomposer.org/installer | php` (on windows, download  and execute it with PHP)
5. run `php composer.phar install`
6. open `my/project/directory/configs/application.config.php` and add the following key to your `modules`:

    ```
    'GeonamesServer',
    ```
7. copy `config/geonamesserver.local.php` in `my/project/directory/config/autoload`
8. edit `my/project/directory/config/autoload/geonamesserver.local.php`, let yourself guided by comments.
9. import geonames data in your elasticsearch index :

    ```
    $ php public/index.php geonames_install
    ```

    [![Install process](https://camo.githubusercontent.com/7799e606db5355f96709467352218a3e5acd5a214790cde1793ec7f41f73bcbd/687474703a2f2f646c2e64726f70626f782e636f6d2f752f363234323235342f696e7374616c6c2e6a7067)](https://camo.githubusercontent.com/7799e606db5355f96709467352218a3e5acd5a214790cde1793ec7f41f73bcbd/687474703a2f2f646c2e64726f70626f782e636f6d2f752f363234323235342f696e7374616c6c2e6a7067)

Use API
-------

[](#use-api)

### Search :

[](#search-)

GET `/geonames/_search/{string_query}`
GET `/geonames/_search/{string_query}/{page}`
GET `/geonames/_search/{string_query}/{page}/{size}`

`{page}` and `{size}` are optional, by default `{page} = 1` and `{size} = 10`

### Get document :

[](#get-document-)

GET `/geonames/_get/{geonameid}`
GET `/geonames/_get/{geonameid},{geonameid},..`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c5ea80353eb117dbabb0def7d2a43079815acee0d55f690a6476c03e458c203?d=identicon)[joacub](/maintainers/joacub)

---

Top Contributors

[![ghislainf](https://avatars.githubusercontent.com/u/892972?v=4)](https://github.com/ghislainf "ghislainf (41 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (3 commits)")[![joacub](https://avatars.githubusercontent.com/u/2091228?v=4)](https://github.com/joacub "joacub (1 commits)")

### Embed Badge

![Health badge](/badges/joacub-geonames-server/health.svg)

```
[![Health](https://phpackages.com/badges/joacub-geonames-server/health.svg)](https://phpackages.com/packages/joacub-geonames-server)
```

PHPackages © 2026

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