Download the PHP package emcconville/point-reduction-algorithms without Composer

On this page you can find all versions of the php package emcconville/point-reduction-algorithms. 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 point-reduction-algorithms

Point Reduction Algorithms

Latest Stable Version Build Status Coverage Status License

A collection of algorithms for reducing the number of points in polygon / polyline.

Custom shapes, polygon & polyline in web-map applications, can have too many points. Often a shape will be rendered at a distant zoom-level, and wouldn't require such high-resolution. This library's goal is to provided basic methods to simplify & reduce shapes.

Install

With composer.

$ curl -sS https://getcomposer.org/installer | php
$ cat > composer.json <<EOF
{
   "require": {
      "emcconville/point-reduction-algorithms" : "~1.0"
   }
}
EOF
$ php composer.phar install

Algorithms & Usage

Below is an original, uncompressed, polyline with 2151 points, and is delivered as SVG weighing in @ 175K.

Original example

All algorithms share a common abstraction, but each class implements a unique reduce method. Most reduction methods require one argument for tolerance / threshold; except, Visvalingam–Whyatt requires the desired final point count, and Opheim requires two independent thresholds.

Example Pseudo code:

The $myPoints must be an array, or traversable object that supports removing element at index. Each user defined point must implement PointReduction\Common\PointInterface which enforces a getCoordinates method. This common interface allows user objects to have any type of property (ie. x/y, latitude/longitude, left/top).

Ramer–Douglas–Peucker

The original polygon of 2151 points has been reduced to 343.

Ramer–Douglas–Peucker example

Visvalingam–Whyatt

The original polygon of 2151 points has been reduced to 343.

Visvalingam–Whyatt example

Reumann–Witkam

The original polygon of 2151 points has been reduced to 872.

Reumann–Witkam example

Opheim

The original polygon of 2151 points has been reduced to 684.

Opheim example

Lang

The original polygon of 2151 points has been reduced to 293.

Lang example

Zhao-Saalfeld

Added in version 1.2.0.

The original polygon of 2151 points has been reduced to 1493.

Zhao-Saalfeld example

Radial Distance

Added in version 1.2.0.

The original polygon of 2151 points has been reduced to 449.

Radial Distance example


All versions of point-reduction-algorithms with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 emcconville/point-reduction-algorithms contains the following files

Loading the files please wait ....