Geo::JSON::Utils - Util methods for Geo::JSON classes
version 0.006
use Geo::JSON::Utils qw/ compare_positions compute_bbox /;
Util methods for Geo::JSON
if (Geo::JSON::Utils::compare_positions( $pt1, $pt2 )) { # positions of points are the same }
Compare two points. Compares in up to three dimensions. Any further dimensions are ignored.
my $bbox = Geo::JSON::Utils::compute_bbox( \@positions );
Computes a bounding box for an arrayref of positions. The bounding box is a list of all minimum values for all axes followed by all maximum values. The values are in the order the axis they appear in the position geometry.
Assumes all points will have same number of dimensions as the first.
Improve comparisons of floating point coordinates, look at stringification issues, etc.
Michael Jemmeson <mjemmeson@cpan.org>
This software is copyright (c) 2013 by Michael Jemmeson <mjemmeson@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Geo::JSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::JSON
CPAN shell
perl -MCPAN -e shell install Geo::JSON
For more information on module installation, please visit the detailed CPAN module installation guide.