Download the PHP package tito10047/geo-bundle without Composer

On this page you can find all versions of the php package tito10047/geo-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geo-bundle

Tito10047GeoBundle

Self-hosted geocoding, address autocomplete and routing for Symfony: OpenStreetMap data on Meilisearch and Valhalla

Work in progress (0.1): searching addresses, importing the data, artifacts, routes, the commands and the UX Autocomplete integration work; the API may still change.

CI

Read-only split of the tito10047/meilisearch-geocoder monorepo: report issues and send pull requests there. The libraries it configures, usable without Symfony, are tito10047/geocoder and tito10047/routing.

Requirements

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Configuration

Configure the parts you need; each section is enabled by configuring it:

An environment variable left empty (MEILISEARCH_URL=, VALHALLA_URL=, e.g. in development or the tests) switches that part off: the services are still created, searching or routing throws GeocoderUnavailableException / RoutingUnavailableException ("… is not configured: … is empty") and the commands say so. An empty api_key sends no Authorization header (an instance without a master key only). The directory of an SQLite dsn (var/geo/) is created on the first connection. See Switching the geocoder or routing off by environment.

Then inject Tito10047\Geocoder\Search\GeocoderInterface, Tito10047\Routing\RouterInterface or Tito10047\Routing\MatrixInterface, or try them from the console:

Photon-compatible API

GET /api?q=… answering like Photon (GeoJSON, lang, limit, layer, osm_tag, countrycode, bbox, …), so that Photon clients such as geocoder-php/photon-provider work against your own data:

See Photon-compatible HTTP API for the parameters, the properties and what differs from Photon.

Commands

An import builds a new index and new tables while searches keep using the live ones; the publication swaps them in at once. --export converts the dumps into files only (no Meilisearch), to be imported on another machine by giving that directory to import.

Deployment

Meilisearch loads a snapshot only when it starts without a database, and only one of its own version. So there are two ways to bring the data to a server:

Mode When How
Separate instance + artifact (recommended) large regions, small server build on a strong machine; on the server a new data directory and a restart of Meilisearch
Shared instance, indexing in place 1–3 small countries, a Meilisearch shared with other projects geo:import directly on the server

The artifact mode, step by step:

  1. Build machine: a Meilisearch holding the geocoder only (the snapshot holds every index), its snapshot directory (MEILI_SNAPSHOT_DIR) configured as geocoder.meilisearch.snapshot_dir.
  2. php bin/console geo:import — imports and publishes the dumps.
  3. php bin/console geo:artifact var/geo/artifact — the snapshot, an SQLite copy of the tables and a manifest.json (versions, data timestamps, checksums).
  4. Copy the directory to the server.
  5. Server: php bin/console geo:artifact:install /srv/geo/artifact /srv/meili_data_new — verifies the artifact, copies the snapshot into the new, empty data directory and makes the tables live. The Meilisearch version is read from the running instance (or give --meilisearch-version).
  6. Restart Meilisearch (the same version) on the new data directory with --import-snapshot /meili_data/geocoder.snapshot (the path the command prints, as the instance sees it), e.g. docker run -v /srv/meili_data_new:/meili_data getmeili/meilisearch:v1.35.1 meilisearch --import-snapshot /meili_data/geocoder.snapshot.
  7. php bin/console geo:status, then delete the snapshot file and the old data directory.

See Deployment modes for the details.

Documentation

Read the documentation to learn how to use the bundle: the full configuration reference, the services, the commands, the Symfony UX Autocomplete integration and the Photon-compatible API.

OpenStreetMap attribution

The data comes from OpenStreetMap and is available under the Open Database License. The bundle distributes no data, but an application displaying addresses or routes must credit the contributors: "© OpenStreetMap contributors".

Development

The bundle is developed in the tito10047/meilisearch-geocoder monorepo, together with the libraries: install the dependencies and run the checks from its root (see its README).

The changes of each version are listed in the changelog.

License

Tito10047GeoBundle is released under the MIT License, see the LICENSE file.


All versions of geo-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
meilisearch/meilisearch-php Version ^1.17
nyholm/psr7 Version ^1.8
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
symfony/config Version ^7.4.17 || ^8.1.5
symfony/console Version ^7.4.17 || ^8.1.5
symfony/dependency-injection Version ^7.4.17 || ^8.1.5
symfony/framework-bundle Version ^7.4.17 || ^8.1.5
symfony/http-client Version ^7.4.17 || ^8.1.5
symfony/http-foundation Version ^7.4.17 || ^8.1.5
symfony/http-kernel Version ^7.4.17 || ^8.1.5
symfony/routing Version ^7.4.17 || ^8.1.5
tito10047/geocoder Version ^0.3.1
tito10047/routing Version ^0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tito10047/geo-bundle contains the following files

Loading the files please wait ...