Home

Awesome

<p align="center" > <img src="banner.png" width=300px alt="SwiftSimplify" title="SwiftSimplify"> </p> <p align="center"><strong>High-performance polyline simplification library</strong></p>

SwiftSimplify is a tiny high-performance Swift polyline simplification library ported from Javascript's Simplify.js. Original work come from Leaflet, a JS interactive maps library by Vladimir Agafonkin.

It uses a combination of Douglas-Peucker and Radial Distance algorithms. Works both on browser and server platforms.

Polyline simplification dramatically reduces the number of points in a polyline while retaining its shape, giving a huge performance boost when processing it and also reducing visual noise. For example, it's essential when rendering a 70k-points line chart or a map route in the browser using MapKit.

SwiftSimplify

Requirements

Communication

Installation

SwiftSimplify is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SwiftSimplify"

Usage

Usage is pretty straightforward: in fact you need just call the SwiftSimplify's class method simplify by passing your configuration:

let allPoints: [Point2DRepresentable] = ...
let simplifiedPoints = SwiftSimplify.simplify(allPoints, tolerance: tolerance)

Allowed parameters are:

❤️ Your Support

Hi fellow developer!
You know, maintaing and developing tools consumes resources and time. While I enjoy making them your support is foundamental to allow me continue its development.

If you are using SwiftSimplify or any other of my creations please consider the following options:

Installation

SwiftSimplify is compatible with Swift 5.x+ under iOS (11+) and macOS platforms.

You can install it via CocoaPods:

use_frameworks!
pod 'SwiftSimplify'

or SPM in your Package.swift:

import PackageDescription

  let package = Package(name: "YourPackage",
    dependencies: [
      .Package(url: "https://github.com/malcommac/SwiftSimplify.git", majorVersion: 0),
    ]
  )

Consider ❤️ support the development of this library!

Contributing

Copyright & Acknowledgements

SwiftSimplify is currently owned and maintained by Daniele Margutti.
You can follow me on Twitter @danielemargutti.
My web site is https://www.danielemargutti.com

This software is licensed under MIT License.

Follow me on: