NAME
Polygon::Simplify
VERSION
Version 0.01
SYNOPSIS
WARNING =>>>>>> EXPERIMENTAL RELEASE <<<<<<<=
use Poygon::Simplify;
# Raw points requiring simplification
my $points = [
{
x => 12.1, y => 3.41
},
...
];
# POINT MUST BE AN Array of x and y points and not lat lng
my $cleaned_points = Polygon::Simplify::simplify($points);
# $cleaned_points is an array of hash refs
DESCRIPTION
perl port of simplify.js
getSqDist(\%p1, \%p2)
square distance between 2 points
getSqSegDist(\%p \%p1, \%p2)
square distance from a point to a segment
simplifyRadialDist($\@points, $sqTolerance)
Basic distanec-based simplifaction
simplifyDouglasPeucker(\@points, $sqTolerance)
Simplification using Ramer-Douglas-Peucker algorithm
simplify(\@points, $tolerance, $highest_quality)
both algorithms combined for awsome performance
my $points = [
{
x => 51.34,
y => 1.34,
},
...
];
simplify($points, $tolerance, $highest_quality);
AUTHOR
Sunny Patel <sunnypatel4141@gmail.com>
BUGS
please report any bugs or feature requests to bug-polygon-simpligy at rt.cpan.org
, or through the we interace at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Polygon-Simplify. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.o