Download the PHP package heymoon/vector-tile-data-provider without Composer

On this page you can find all versions of the php package heymoon/vector-tile-data-provider. 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 vector-tile-data-provider

Mapbox vector tiles library for PHP

Version PHP Version Require Test Maintainability Test Coverage

Symfony + Redis demo: https://map.heymoon.cc

Screenshot

Basic Leaflet-based map example with realtime Symfony backend performance preview. When "Use cache" checkbox is not active, getTileMVT function is called on each request without any additional static caching strategy. With "Use cache" option, backend renders each tile only once and stores results in Redis. Two layers are requested separately for benchmarking:

It only has 1 CPU and low RAM at its disposal so please be gentle.

Summary

Convert OpenGIS data loaded by brick/geo directly to Mapbox Vector Tile 2.1 format. Focused on frequent source data changes delivery with the lowest latency possible. Process data fast with GEOS C/C++ library via PHP integration with custom update trigger to fit your needs. Perform SRID transformation and Douglas-Peucker simplification faster than ever.


Additional: convert MVT tiles to SVG (debug purposes only, not designed for production). Install meyfa/php-svg to use this feature.

Motivation

If you want to display current weather conditions or some moving objects on your map, it's good to be able to generate your tileset directly on receiving updates from data provider, for example when reading GeoJSON from HTTP API response. The bottleneck is usually encountered with the following:

How is it faster

Most likely your data doesn't always change in every tile. And even if it does, if you'll look into request distribution by zoom, you'll probably notice that most of generated tiles smaller than, for example, zoom 18, are rarely requested between data changes but take the most of update's time, so you may want to prioritize some tiles more than others. With enough flexibility it is possible to invalidate parts of previous result and process in advance only frequently requested scales, leaving the rest to on-demand processing and updating MVT cache only on HTTP-request. With this library you'll be able to implement tight integration with the specific update scenario and minimize redundant calculations with custom update pipeline. Also, since GEOS functions can be called directly, it's much easier to scale.

Installation

composer require heymoon/vector-tile-data-provider

You must explicitly generate protobuf classes from your project root:

protoc --proto_path=./vendor/heymoon/vector-tile-data-provider/proto --php_out=./vendor/heymoon/vector-tile-data-provider/proto/gen ./vendor/heymoon/vector-tile-data-provider/proto/vector_tile.proto

Install php-geos and php-protobuf extensions for best performance. Example Dockerfile for Alpine 3.16 with PHP 8.1:

Provides

Spatial systems

By default, grid is expected to be aligned with the Web Mercator projection, which is most likely different from your original data source spatial reference system. In order to process inputs with arbitrary SRID, library includes custom implementation of spatial transformation engine in HeyMoon\VectorTileDataProvider\Service\SpatialService (since SRID transformation is unsupported by php-geos and has performance issues in PostGIS). Following geometries are currently supported out-of-the-box:

Additional projections can be described as subclass of SpatialProjectionInterface and passed in supports function of a new class extended from AbstractProjectionRegistry. Projection class should implement conversion of point coordinates on 2D surface from WGS 84 to the required spatial system and the reverse transformation function.

Example usage in Symfony:

DI configuration:

Action:

Tested with Symfony 6.1.

Export result

In real life scenario instead of dumping SVG files you would write data in your database of choice. For example, you could create MBTiles file readable by tileserver-gl. This is achievable with the SQLite database containing schema from the latest specification description. Alternatively you could store only the grid partitioning result for on-demand generation in your own vector data source controller on PHP later (useful if faster data update is needed).


All versions of vector-tile-data-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
brick/geo Version ^0.8|^0.9
ext-zlib Version *
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 heymoon/vector-tile-data-provider contains the following files

Loading the files please wait ....