Build.PL100644000765000024 45514440154626 14361 0ustar00aranstaff000000000000GIS-Distance-0.20# ========================================================================= # THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA. # DO NOT EDIT DIRECTLY. # ========================================================================= use 5.008_001; use strict; use Module::Build::Tiny 0.035; Build_PL(); Changes100644000765000024 766414440154626 14411 0ustar00aranstaff000000000000GIS-Distance-0.20Revision history for Perl extension GIS-Distance. 0.20 2023-06-07T19:24:59Z - Minor metadata and boilerplate updates. - Fix typo in POD. 0.19 2021-01-30T06:07:58Z - Changed licensing terms to be the same as Perl. - Provide a .editorconfig instead of .lvimrc. 0.18 2019-05-10T20:31:31Z - Switch to the GNU General Public License version 3. - Fixed pod error as reported by CPANTS. - Documentation edits. 0.17 2019-03-17T17:01:31Z - Finalize the new internal formula interface. 0.16 2019-03-16T22:19:33Z - Renamed the args and module attributes to formula_args and formula_module to make them less generic and a bit more accurate. - Fix a pretty bad math typo in the SPEED section. - Lots of other documentation edits. 0.15 2019-03-13T06:06:09Z - Support using Geo::Point as arguments to distance(). - Lots of documentation edits. - Moved TODO section into GitHub issues. - Added a benchmark to the SPEED section. - Made a bunch of improvements to the author tools. 0.14 2019-03-10T05:04:54Z - Add GIS::Distance::ALT formula. - Removed distance_km(). 0.13 2019-03-09T12:32:55Z - Add abs() to Haversine. - Added GIS::Distance::Null, the fastest formula yet. 0.12 2019-03-08T18:32:13Z - Added the distance_metal() method to GIS::Distance. - Various documentation edits, including a new SPEED section. 0.11 2019-03-07T22:23:02Z - Support the GIS_DISTANCE_PP environment variable. - Don't support older ::Formula modules, makes no sense and they wouldn't work anyways. - Declare Carp dep. - Lots and lots of documentation edits. - Recommend the newer GIS::Distance::Fast. 0.10 2019-03-07T16:28:48Z - WARNING: The GIS::Distance object is now immutable, thus the formula can no longer be set with the formula attribute! - Moved GIS::Distance::GeoEllipsoid to a separate distro. - Added the distance_km() method to GIS::Distance. - Removed Moo and Type::Tiny, all unecessary, simple OO. - Move GIS::Distance::Formula:: modules to GIS::Distance::. - Migrate build tooling from Dist::Zilla to Minilla. 0.09 2015-06-11 - Move away from Any::Moose to Moo (yay!). - Better formula loading logic. - Support single-arg (formula) GIS::Distance instantiation. 0.08 2012-03-23 - Release with Dist::Zilla. - Fix Great Circle formula to use ** instead of ^. 0.07 2010-02-02 - Use Any::Moose instead of Moose directly. - Declare namespace::autoclean dependency. 0.06 2010-01-30 - Minor build updates to include some extra info (github, etc). 0.05 2010-01-30 - Speed improvements under Moose (now uses immutable). 0.04 2009-06-29 - Fixed for latest Moose. - Fixed for latest Class::Measure. 0.03 - Fixed for latest Moose. - Reduced the README to a one-liner. - Added docs to GIS::Distance::Formula. - Fixed some documentation typos that were using GID instead of GIS. - Fixed a typo that mispelled "formula" as "formuka". - Refer to GIS::Distance::Fast in the SEE ALSO section. - Added a one liner to the SYNOPSIS showing how to used the returned distance object. - Added a TEST COVERAGE section with output from Devel::Cover. 0.02 2008-03-16 - Added Geoid to the TODO section. - Using Module::Install now. - Moved all formulas in to the GIS::Distance::Formula namespace. - Using Moose for all OO now. - Added tests (bout time!). - Added support for the up-and-coming ::Fast:: modules. - Added (BROKEN) to the abstract for the GreatCircle and Polar formulas. - Fixed POD testing. - Changed version scheme to use the simple x.xx format. 0.01001 2006-09-20 - Added basic META.yml. - Geo::Ellipsoid support. - Added a TODO section. - Various bug fixes to the Vincenty formula. - GreatCircle formula marked as broken. - Added a dev script for graphing the deviations in the formulas. 0.01000 2006-09-19 - Renamed from Geo::Distance to GIS::Distance. - Moved distance calculations in to their own modules. - Use Class::Measure::Length to handle distance return values. - Test POD syntax. - Forked from Geo::Distance 0.11. LICENSE100644000765000024 4377014440154626 14141 0ustar00aranstaff000000000000GIS-Distance-0.20This software is copyright (c) 2003 by Aran Clary Deltac . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2019 by Aran Clary Deltac . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2019 by Aran Clary Deltac . This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End META.json100644000765000024 702014440154626 14521 0ustar00aranstaff000000000000GIS-Distance-0.20{ "abstract" : "Calculate geographic distances.", "author" : [ "Aran Clary Deltac " ], "dynamic_config" : 0, "generated_by" : "Minilla/v3.1.21", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "GIS-Distance", "no_index" : { "directory" : [ "t", "xt", "inc", "share", "eg", "examples", "author", "builder" ] }, "prereqs" : { "configure" : { "requires" : { "Module::Build::Tiny" : "0.035" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::MinimumVersion::Fast" : "0.04", "Test::PAUSE::Permissions" : "0.07", "Test::Pod" : "1.41", "Test::Spellunker" : "v0.2.7" } }, "runtime" : { "recommends" : { "GIS::Distance::Fast" : "0.13" }, "requires" : { "Carp" : "0", "Class::Measure::Length" : "0", "Const::Fast" : "0.014", "Math::Trig" : "0", "Scalar::Util" : "0", "namespace::clean" : "0.24", "parent" : "0", "perl" : "5.008001", "strictures" : "2.000000" }, "suggests" : { "Geo::Point" : "0.95" } }, "test" : { "requires" : { "Test2::V0" : "0.000094" } } }, "provides" : { "GIS::Distance" : { "file" : "lib/GIS/Distance.pm", "version" : "0.20" }, "GIS::Distance::ALT" : { "file" : "lib/GIS/Distance/ALT.pm", "version" : "0.20" }, "GIS::Distance::Constants" : { "file" : "lib/GIS/Distance/Constants.pm", "version" : "0.20" }, "GIS::Distance::Cosine" : { "file" : "lib/GIS/Distance/Cosine.pm", "version" : "0.20" }, "GIS::Distance::Formula" : { "file" : "lib/GIS/Distance/Formula.pm", "version" : "0.20" }, "GIS::Distance::GreatCircle" : { "file" : "lib/GIS/Distance/GreatCircle.pm", "version" : "0.20" }, "GIS::Distance::Haversine" : { "file" : "lib/GIS/Distance/Haversine.pm", "version" : "0.20" }, "GIS::Distance::MathTrig" : { "file" : "lib/GIS/Distance/MathTrig.pm", "version" : "0.20" }, "GIS::Distance::Null" : { "file" : "lib/GIS/Distance/Null.pm", "version" : "0.20" }, "GIS::Distance::Polar" : { "file" : "lib/GIS/Distance/Polar.pm", "version" : "0.20" }, "GIS::Distance::Vincenty" : { "file" : "lib/GIS/Distance/Vincenty.pm", "version" : "0.20" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/bluefeet/GIS-Distance/issues" }, "homepage" : "https://github.com/bluefeet/GIS-Distance", "repository" : { "type" : "git", "url" : "https://github.com/bluefeet/GIS-Distance.git", "web" : "https://github.com/bluefeet/GIS-Distance" } }, "version" : "0.20", "x_authority" : "cpan:BLUEFEET", "x_contributors" : [ "Florian Schlichting ", "Mohammad S Anwar " ], "x_serialization_backend" : "JSON::PP version 4.07", "x_static_install" : 1 } README.md100644000765000024 2037714440154626 14411 0ustar00aranstaff000000000000GIS-Distance-0.20# NAME GIS::Distance - Calculate geographic distances. # SYNOPSIS ```perl use GIS::Distance; # Use the GIS::Distance::Haversine formula by default. my $gis = GIS::Distance->new(); # Or choose a different formula. my $gis = GIS::Distance->new( 'Polar' ); # Returns a Class::Measure object. my $distance = $gis->distance( $lat1, $lon1, $lat2, $lon2 ); print $distance->meters(); ``` # DESCRIPTION This module calculates distances between geographic points on, at the moment, planet Earth. Various ["FORMULAS"](#formulas) are available that provide different levels of accuracy versus speed. [GIS::Distance::Fast](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast), a separate distribution, ships with C implementations of some of the formulas shipped with GIS::Distance. If you're looking for speed then install it and the ::Fast formulas will be automatically used by this module. # METHODS ## distance ```perl my $distance = $gis->distance( $lat1, $lon1, $lat2, $lon2 ); my $point1 = Geo::Point->latlong( $lat1, $lon1 ); my $point2 = Geo::Point->latlong( $lat2, $lon2 ); my $distance = $gis->distance( $point1, $point2 ); ``` Takes either two decimal latitude and longitude pairs, or two [Geo::Point](https://metacpan.org/pod/Geo%3A%3APoint) objects. Returns a [Class::Measure::Length](https://metacpan.org/pod/Class%3A%3AMeasure%3A%3ALength) object for the distance between the two degree lats/lons. See ["distance\_metal"](#distance_metal) for a faster, but less feature rich, method. ## distance\_metal This works just like ["distance"](#distance) except for: - Does not accept [Geo::Point](https://metacpan.org/pod/Geo%3A%3APoint) objects. Only decimal latitude and longitude pairs. - Does not return a [Class::Measure](https://metacpan.org/pod/Class%3A%3AMeasure) object. Instead kilometers are always returned. - Does no argument checking. - Does not support formula arguments which are supported by at least the [GIS::Distance::GeoEllipsoid](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AGeoEllipsoid) formula. Calling this gets you pretty close to the fastest bare metal speed you can get. The speed improvements of calling this is noticeable over hundreds of thousands of iterations only and you've got to decide if its worth the safety and features you are dropping. Read more in the ["SPEED"](#speed) section. # ARGUMENTS ```perl my $gis = GIS::Distance->new( $formula ); ``` When you call `new()` you may pass a partial or full formula class name as the first argument. The default is `Haversive`. If you pass a partial name, as in: ```perl my $gis = GIS::Distance->new( 'Haversine' ); ``` Then the following modules will be looked for in order: ``` GIS::Distance::Fast::Haversine GIS::Distance::Haversine Haversine ``` Install [GIS::Distance::Fast](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast) to get access to the `Fast::` (XS) implementations of the formula classes. You may globally disable the automatic use of the `Fast::` formulas by setting the `GIS_DISTANCE_PP` environment variable. Although, its likely simpler to just provide a full class name to get the same effect: ```perl my $gis = GIS::Distance->new( 'GIS::Distance::Haversine' ); ``` # SPEED Not that this module is slow, but if you're doing millions of distance calculations a second you may find that adjusting your code a bit may make it faster. Here are some options. Install [GIS::Distance::Fast](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast) to get the XS variants for most of the PP formulas. Use ["distance\_metal"](#distance_metal) instead of ["distance"](#distance). Call the undocumented `_distance()` function that each formula class has. For example you could bypass this module entirely and just do: ```perl use GIS::Distance::Fast::Haversine; my $km = GIS::Distance::Fast::Haversine::_distance( @coords ); ``` The above would be the ultimate speed demon (as shown in benchmarking) but throws away some flexibility and adds some foot-gun support. Here's a benchmarks for these options: ``` 2019-03-13T09:34:00Z GIS::Distance 0.15 GIS::Distance::Fast 0.12 GIS::Distance::Fast::Haversine 0.12 GIS::Distance::Haversine 0.15 Rate PP Haversine - GIS::Distance->distance 123213/s XS Haversine - GIS::Distance->distance 196232/s PP Haversine - GIS::Distance->distance_metal 356379/s PP Haversine - GIS::Distance::Haversine::_distance 385208/s XS Haversine - GIS::Distance->distance_metal 3205128/s XS Haversine - GIS::Distance::Fast::Haversine::_distance 8620690/s ``` You can run your own benchmarks using the included `author/bench` script. The above results were produced with: ``` author/bench -f Haversine ``` The slowest result was about `125000/s`, or about `8ms` each call. This could be a substantial burden in some contexts, such as live HTTP responses to human users and running large batch jobs, to name just two. In conclusion, if you can justify the speed gain, switching to ["distance\_metal"](#distance_metal) and installing [GIS::Distance::Fast](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast) looks to be an ideal setup. As always with performance and benchmarking, YMMV. # COORDINATES When passing latitudinal and longitudinal coordinates to ["distance"](#distance) they must always be in decimal degree format. Here is some sample code for converting from other formats to decimal: ```perl # DMS to Decimal my $decimal = $degrees + ($minutes/60) + ($seconds/3600); # Precision Six Integer to Decimal my $decimal = $integer * .000001; ``` If you want to convert from decimal radians to degrees you can use [Math::Trig](https://metacpan.org/pod/Math%3A%3ATrig)'s rad2deg function. # FORMULAS These formulas come bundled with this distribution: - [GIS::Distance::ALT](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AALT) - [GIS::Distance::Cosine](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3ACosine) - [GIS::Distance::GreatCircle](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AGreatCircle) - [GIS::Distance::Haversine](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AHaversine) - [GIS::Distance::MathTrig](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AMathTrig) - [GIS::Distance::Null](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3ANull) - [GIS::Distance::Polar](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3APolar) - [GIS::Distance::Vincenty](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AVincenty) These formulas are available on CPAN: - ["FORMULAS" in GIS::Distance::Fast](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast#FORMULAS) - [GIS::Distance::GeoEllipsoid](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AGeoEllipsoid) # AUTHORING Take a look at [GIS::Distance::Formula](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFormula) for instructions on authoring new formula classes. # SEE ALSO - [Geo::Distance](https://metacpan.org/pod/Geo%3A%3ADistance) - Is deprecated in favor of using this module. - [Geo::Distance::Google](https://metacpan.org/pod/Geo%3A%3ADistance%3A%3AGoogle) - While in the Geo::Distance namespace, this isn't actually related to Geo::Distance at all. Might be useful though. - [GIS::Distance::Lite](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3ALite) - An old fork of this module, not recommended. - [Geo::Distance::XS](https://metacpan.org/pod/Geo%3A%3ADistance%3A%3AXS) - Used to be used by [Geo::Distance](https://metacpan.org/pod/Geo%3A%3ADistance) but no longer is. - [Geo::Ellipsoid](https://metacpan.org/pod/Geo%3A%3AEllipsoid) - Or use [GIS::Distance::GeoEllipsoid](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AGeoEllipsoid) for a uniform interface. - [Geo::Inverse](https://metacpan.org/pod/Geo%3A%3AInverse) - Does some distance calculations, but seems less than useful as all the code looks to be taken from [Geo::Ellipsoid](https://metacpan.org/pod/Geo%3A%3AEllipsoid). # SUPPORT Please submit bugs and feature requests to the GIS-Distance GitHub issue tracker: [https://github.com/bluefeet/GIS-Distance/issues](https://github.com/bluefeet/GIS-Distance/issues) # AUTHOR ``` Aran Clary Deltac ``` # CONTRIBUTORS ``` Mohammad S Anwar Florian Schlichting ``` # LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. bench100755000765000024 1437014440154626 15435 0ustar00aranstaff000000000000GIS-Distance-0.20/author#!/usr/bin/env perl use strictures 2; use GIS::Distance; use Benchmark qw( cmpthese ); use List::Util qw( any ); use List::MoreUtils qw( zip uniq ); use Module::Find qw( findallmod ); use Getopt::Long; Getopt::Long::Configure(qw( gnu_getopt no_ignore_case )); GetOptions( 'formula|f=s' => \my @formulas, 'pp!' => \my $do_pp, 'xs!' => \my $do_xs, 'geo' => \my $do_geo, 'iters|i=i' => \my $iters, 'dry-run|n' => \my $dry_run, 'h|help' => \my $help, ) or die "Unable to process options!\n"; if ($help) { require Pod::Usage; Pod::Usage::pod2usage( -verbose => 2 ); exit 0; } @formulas = split(/,/, join(',', @formulas)); $iters ||= 5_000_000; $do_pp = 1 if !defined $do_pp; $do_xs = 1 if !defined $do_xs; my %gis_to_geo; if ($do_geo) { require Geo::Distance; Geo::Distance->import(); *Geo::Distance::new_distance = \&Geo::Distance::distance; require Geo::Distance::XS; Geo::Distance::XS->import(); # Geo::Distance::new_distance() proxies to GIS::Distance. # Geo::Distance::distance() is installed by Geo::Distance::XS. # Geo::Distance::old_distance() is pure-perl, pre GIS::Distance gutting. %gis_to_geo = (reverse %Geo::Distance::GEO_TO_GIS_FORMULA_MAP); } my @installed_modules = ( grep { $_ !~ m{::Formula} } grep { $_ ne 'GIS::Distance::Constants' } grep { $_ ne 'GIS::Distance::Fast' } findallmod('GIS::Distance') ); my %installed_modules_lookup = map { $_=>1 } @installed_modules; my @all_formulas = ( uniq map { s{^GIS::Distance::}{}r } map { s{^GIS::Distance::Fast::}{}r } @installed_modules ); @formulas = @all_formulas if !@formulas; my @coords = ( 34.202361, -118.601875, 37.752258, -122.441254 ); my @geo_coords = @coords[1,0,3,2]; my @tests; foreach my $formula (sort @formulas) { my $pp_module = "GIS::Distance::$formula"; if ($do_pp and $installed_modules_lookup{$pp_module}) { my $gis = GIS::Distance->new( $pp_module ); my $code = $pp_module->can('_distance'); push @tests, ( ["PP $formula - GIS::Distance->distance" => sub{ return $gis->distance( @coords )->km(); }], ["PP $formula - GIS::Distance->distance_metal" => sub{ return $gis->distance_metal( @coords ); }], ["PP $formula - $pp_module\::_distance" => sub{ return $code->( @coords ); }], ); } my $xs_module = "GIS::Distance::Fast::$formula"; if ($do_xs and $installed_modules_lookup{$xs_module}) { my $gis = GIS::Distance->new( $xs_module ); my $code = $xs_module->can('_distance'); push @tests, ( ["XS $formula - GIS::Distance->distance" => sub{ return $gis->distance( @coords )->km(); }], ["XS $formula - GIS::Distance->distance_metal" => sub{ return $gis->distance_metal( @coords ); }], ["XS $formula - $xs_module\::_distance" => sub{ return $code->( @coords ); }], ); } my $geo_formula = $gis_to_geo{ $formula }; if ($do_geo and $geo_formula) { my $geo = Geo::Distance->new(); $geo->formula( $geo_formula ); push @tests, ( ["PP $geo_formula - Geo::Distance->old_distance" => sub{ return $geo->old_distance( 'kilometer', @geo_coords ); }], ) if $do_pp; push @tests, ( ["XS $geo_formula - Geo::Distance->new_distance" => sub{ return $geo->new_distance( 'kilometer', @geo_coords ); }], ["XS $geo_formula - Geo::Distance::XS->distance" => sub{ return $geo->distance( 'kilometer', @geo_coords ); }], ["XS $geo_formula - Geo::Distance::XS::distance" => sub{ return Geo::Distance::XS::distance( $geo, 'kilometer', @geo_coords, ); }], ) if $do_xs; } } if ($dry_run) { print "Tests to run:\n"; print( map { " - $_\n" } sort map { $_->[0] } @tests ); exit; } # Run them all once in case there are runtime errors. foreach my $test (@tests) { $test->[1]->() } my @time = gmtime( time() ); my $stamp = sprintf( '%04d-%02d-%02dT%02d:%02d:%02dZ', $time[5] + 1900, $time[4] + 1, $time[3], $time[2], $time[1], $time[0], ); print "$stamp\n"; my %versions; foreach my $module (keys %INC) { next if $module !~ m{\.pm$}; $module =~ s{\.pm$}{}; $module =~ s{/}{::}g; next unless $module->can('distance') or $module eq 'GIS::Distance::Fast'; my $version = eval("\$$module\::VERSION"); $versions{$module} = $version if $version; } foreach my $module (sort keys %versions) { print "$module $versions{ $module }\n"; } cmpthese( $iters, { map { @$_ } @tests }, ); __END__ =head1 NAME author/bench - Benchmark formulas and the various interfaces to them. =head1 SYNOPSIS # Benchmark every GIS::Distance and GIS::Distance::Fast formula. author/bench # Show which benchmarks would be run for every GIS::Distance::Fast # and Geo::Distance::XS formula, but don't run them. author/bench --geo --no-pp --dry-run # Displays this handy documentation! author/bench --help =head1 OPTIONS =head2 formula --formula= --formaul=Null -f Haversine -f Cosine By default all formulas will be considered for benchmarking. If you'd like to limit this then you can specify one or more formulas with this option. =head2 pp --no-pp Disable the C option, meaning no pure-perl formulas will be included. =head2 xs --no-xs Disable the C option, meaning no XS formulas will be included. =head2 geo --geo L and/or L formulas will be included. =head2 iters --iters=100 -i 10000000 The number of iterations to benchmark each formula against. The default is C<5,000,000>. =head2 dry-run --dry-run -n Lists all the benchmarks which would be run, but does not run them. =head2 help --help -h Displays this handy documentation! =head1 AUTHORS AND LICENSE See L and L. =cut cpanfile100644000765000024 44214440154626 16067 0ustar00aranstaff000000000000GIS-Distance-0.20/authorrequires 'Benchmark'; requires 'Getopt::Long'; requires 'List::MoreUtils'; requires 'List::Util'; requires 'Module::Find'; requires 'Pod::Usage'; requires 'strictures'; requires 'GIS::Distance'; recommends 'GIS::Distance::Fast'; recommends 'Geo::Distance'; recommends 'Geo::Distance::XS'; distances100755000765000024 707414440154626 16316 0ustar00aranstaff000000000000GIS-Distance-0.20/author#!/usr/bin/env perl use strictures 2; use GIS::Distance; use Module::Find qw( findallmod ); use Getopt::Long; Getopt::Long::Configure(qw( gnu_getopt no_ignore_case )); GetOptions( 'pp!' => \my $do_pp, 'xs!' => \my $do_xs, 'geo' => \my $do_geo, 'precision|p=i' => \my $precision, 'h|help' => \my $help, ) or die "Unable to process options!\n"; if ($help) { require Pod::Usage; Pod::Usage::pod2usage( -verbose => 2 ); exit 0; } $do_pp = 1 if !defined $do_pp; $do_xs = 1 if !defined $do_xs; $precision ||= 12; my @coords; # Beirut to Dimashq. @coords = ( 33.863146, 35.52824, 33.516496, 36.287842 ); # https://github.com/bluefeet/Geo-Distance/issues/15 #@coords = ( 52.484977, 13.385900, 52.485033, 13.370897 ); my %distances; { my @formulas = ( grep { $_ !~ m{::Formula} } grep { $_ ne 'GIS::Distance::Constants' } grep { $_ ne 'GIS::Distance::Fast' } findallmod('GIS::Distance') ); @formulas = ( grep { $_ !~ m{::Fast::} } @formulas ) if !$do_xs; @formulas = ( grep { $_ =~ m{::Fast::} } @formulas ) if !$do_pp; foreach my $formula (@formulas) { my $gis = GIS::Distance->new( $formula ); my $km = $gis->distance( @coords )->km(); $distances{ $formula } = $km; } } if ($do_geo and $do_pp) { require Geo::Distance; Geo::Distance->import(); my @formulas = @Geo::Distance::FORMULAS; foreach my $formula (@formulas) { my $geo = Geo::Distance->new(); $geo->formula( $formula ); my $km = $geo->old_distance( 'kilometer', reverse @coords ); $distances{ "Geo::Distance-$formula" } = $km; } } if ($do_geo and $do_xs) { require Geo::Distance::XS; Geo::Distance::XS->import(); my @formulas = @Geo::Distance::XS::FORMULAS; foreach my $formula (@formulas) { my $geo = Geo::Distance->new(); $geo->formula( $formula ); my $km = $geo->distance( 'kilometer', reverse @coords ); $distances{ "Geo::Distance::XS-$formula" } = $km; } } my %formulas_by_distance; foreach my $formula (keys %distances) { my $distance = sprintf("%.0${precision}f", $distances{$formula}); my $formulas = $formulas_by_distance{ $distance } ||= []; push @$formulas, $formula; } foreach my $distance (sort keys %formulas_by_distance) { print "$distance:\n"; print map { " - $_\n" } sort @{ $formulas_by_distance{$distance} }; } __END__ =head1 NAME author/distances - Display the distance generated by all the formulas. =head1 SYNOPSIS # List distances for every GIS::Distance and GIS::Distance::Fast # formula. author/distances # List distances for every GIS::Distance::Fast and # Geo::Distance::XS formula. author/distances --geo --no-pp # Displays this handy documentation! author/distances --help =head1 OPTIONS =head2 pp --no-pp Disable the C option, meaning no pure-perl formulas will be included. =head2 xs --no-xs Disable the C option, meaning no XS formulas will be included. =head2 geo --geo L and/or L formulas will be included. =head2 precision --precision=14 -p 8 When grouping formulas format the timing to this number of decimal places. The default is C<12>, which does a good job of grouping the formulas which really are producing the exact same result. =head2 help --help -h Displays this handy documentation! =head1 AUTHORS AND LICENSE See L and L. =cut cpanfile100644000765000024 62314440154626 14566 0ustar00aranstaff000000000000GIS-Distance-0.20requires 'namespace::clean' => '0.24'; requires 'perl' => '5.008001'; requires 'strictures' => '2.000000'; requires 'Class::Measure::Length'; requires 'Const::Fast' => '0.014'; requires 'Carp'; requires 'Math::Trig'; requires 'Scalar::Util'; requires 'parent'; recommends 'GIS::Distance::Fast' => '0.13'; suggests 'Geo::Point' => '0.95'; on test => sub { requires 'Test2::V0' => '0.000094'; }; Distance.pm100644000765000024 1763514440154626 16415 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GISpackage GIS::Distance; use 5.008001; use strictures 2; our $VERSION = '0.20'; sub new { my ($class, $formula, @args) = @_; $formula ||= 'Haversine'; my @modules; push @modules, "GIS::Distance::Fast::${formula}" unless $ENV{GIS_DISTANCE_PP} or $ENV{GEO_DISTANCE_PP}; push @modules, "GIS::Distance::$formula"; push @modules, $formula; foreach my $module (@modules) { next if !_try_load_module( $module ); next if !$module->isa('GIS::Distance::Formula'); return $module->new( @args ); } die "Cannot find a GIS::Distance::Formula class for $formula"; }; my %tried_modules; sub _try_load_module { my ($module) = @_; return $tried_modules{ $module } if defined $tried_modules{ $module }; $tried_modules{ $module } = 1; my $ok = eval( "require $module; 1" ); return 1 if $ok; $tried_modules{ $module } = 0; die $@ if $@ !~ m{^Can't locate}; return 0; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance - Calculate geographic distances. =head1 SYNOPSIS use GIS::Distance; # Use the GIS::Distance::Haversine formula by default. my $gis = GIS::Distance->new(); # Or choose a different formula. my $gis = GIS::Distance->new( 'Polar' ); # Returns a Class::Measure object. my $distance = $gis->distance( $lat1, $lon1, $lat2, $lon2 ); print $distance->meters(); =head1 DESCRIPTION This module calculates distances between geographic points on, at the moment, planet Earth. Various L are available that provide different levels of accuracy versus speed. L, a separate distribution, ships with C implementations of some of the formulas shipped with GIS::Distance. If you're looking for speed then install it and the ::Fast formulas will be automatically used by this module. =head1 METHODS =head2 distance my $distance = $gis->distance( $lat1, $lon1, $lat2, $lon2 ); my $point1 = Geo::Point->latlong( $lat1, $lon1 ); my $point2 = Geo::Point->latlong( $lat2, $lon2 ); my $distance = $gis->distance( $point1, $point2 ); Takes either two decimal latitude and longitude pairs, or two L objects. Returns a L object for the distance between the two degree lats/lons. See L for a faster, but less feature rich, method. =head2 distance_metal This works just like L except for: =over =item * Does not accept L objects. Only decimal latitude and longitude pairs. =item * Does not return a L object. Instead kilometers are always returned. =item * Does no argument checking. =item * Does not support formula arguments which are supported by at least the L formula. =back Calling this gets you pretty close to the fastest bare metal speed you can get. The speed improvements of calling this is noticeable over hundreds of thousands of iterations only and you've got to decide if its worth the safety and features you are dropping. Read more in the L section. =head1 ARGUMENTS my $gis = GIS::Distance->new( $formula ); When you call C you may pass a partial or full formula class name as the first argument. The default is C. If you pass a partial name, as in: my $gis = GIS::Distance->new( 'Haversine' ); Then the following modules will be looked for in order: GIS::Distance::Fast::Haversine GIS::Distance::Haversine Haversine Install L to get access to the C (XS) implementations of the formula classes. You may globally disable the automatic use of the C formulas by setting the C environment variable. Although, its likely simpler to just provide a full class name to get the same effect: my $gis = GIS::Distance->new( 'GIS::Distance::Haversine' ); =head1 SPEED Not that this module is slow, but if you're doing millions of distance calculations a second you may find that adjusting your code a bit may make it faster. Here are some options. Install L to get the XS variants for most of the PP formulas. Use L instead of L. Call the undocumented C<_distance()> function that each formula class has. For example you could bypass this module entirely and just do: use GIS::Distance::Fast::Haversine; my $km = GIS::Distance::Fast::Haversine::_distance( @coords ); The above would be the ultimate speed demon (as shown in benchmarking) but throws away some flexibility and adds some foot-gun support. Here's a benchmarks for these options: 2019-03-13T09:34:00Z GIS::Distance 0.15 GIS::Distance::Fast 0.12 GIS::Distance::Fast::Haversine 0.12 GIS::Distance::Haversine 0.15 Rate PP Haversine - GIS::Distance->distance 123213/s XS Haversine - GIS::Distance->distance 196232/s PP Haversine - GIS::Distance->distance_metal 356379/s PP Haversine - GIS::Distance::Haversine::_distance 385208/s XS Haversine - GIS::Distance->distance_metal 3205128/s XS Haversine - GIS::Distance::Fast::Haversine::_distance 8620690/s You can run your own benchmarks using the included C script. The above results were produced with: author/bench -f Haversine The slowest result was about C<125000/s>, or about C<8ms> each call. This could be a substantial burden in some contexts, such as live HTTP responses to human users and running large batch jobs, to name just two. In conclusion, if you can justify the speed gain, switching to L and installing L looks to be an ideal setup. As always with performance and benchmarking, YMMV. =head1 COORDINATES When passing latitudinal and longitudinal coordinates to L they must always be in decimal degree format. Here is some sample code for converting from other formats to decimal: # DMS to Decimal my $decimal = $degrees + ($minutes/60) + ($seconds/3600); # Precision Six Integer to Decimal my $decimal = $integer * .000001; If you want to convert from decimal radians to degrees you can use L's rad2deg function. =head1 FORMULAS These formulas come bundled with this distribution: =over =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back These formulas are available on CPAN: =over =item * L =item * L =back =head1 AUTHORING Take a look at L for instructions on authoring new formula classes. =head1 SEE ALSO =over =item * L - Is deprecated in favor of using this module. =item * L - While in the Geo::Distance namespace, this isn't actually related to Geo::Distance at all. Might be useful though. =item * L - An old fork of this module, not recommended. =item * L - Used to be used by L but no longer is. =item * L - Or use L for a uniform interface. =item * L - Does some distance calculations, but seems less than useful as all the code looks to be taken from L. =back =head1 SUPPORT Please submit bugs and feature requests to the GIS-Distance GitHub issue tracker: L =head1 AUTHOR Aran Clary Deltac =head1 CONTRIBUTORS Mohammad S Anwar Florian Schlichting =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ALT.pm100644000765000024 444714440154626 17012 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::ALT; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad acos pi ); use GIS::Distance::Constants qw( :all ); use namespace::clean; my $DEG_RADS = pi / 180; # Sphere with equal meridian length my $RM = 6367449.14582342; # WGS 84 Ellipsoid my $A = 6378137; my $B = 6356752.314245; my $F = 1 / 298.257223563; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; my $f = 0.5 * ($lat2 + $lat1) * $DEG_RADS; my $g = 0.5 * ($lat2 - $lat1) * $DEG_RADS; my $l = 0.5 * ($lon2 - $lon1) * $DEG_RADS; my $sf = sin($f); my $sg = sin($g); my $sl = sin($l); my $s2f = $sf * $sf; my $s2g = $sg * $sg; my $s2l = $sl * $sl; my $c2f = 1.0 - $s2f; my $c2g = 1.0 - $s2g; my $c2l = 1.0 - $s2l; my $s2 = $s2g * $c2l + $c2f * $s2l; my $c2 = $c2g * $c2l + $s2f * $s2l; my ($s, $c, $omega, $rr, $aa, $bb, $pp, $qq, $d2, $qp, $eps1, $eps2); return 0 if $s2 == 0; return pi * $RM * 0.001 if $c2 == 0; $s = sqrt($s2); $c = sqrt($c2); $omega = atan2($s, $c); $rr = $s * $c; $aa = $s2g * $c2f / $s2 + $s2f * $c2g / $c2; $bb = $s2g * $c2f / $s2 - $s2f * $c2g / $c2; $pp = $rr / $omega; $qq = $omega / $rr; $d2 = $s2 - $c2; $qp = $qq + 6 * $pp; $eps1 = 0.5 * $F * (-$aa - 3 * $bb * $pp); $eps2 = 0.25 * $F * $F * ((-$qp * $bb + (-3.75 + $d2 * ($qq + 3.75 * $pp)) * $aa + 4. - $d2 * $qq) * $aa - (7.5 * $d2 * $bb * $pp - $qp) * $bb); my $d = 2 * $omega * $A * (1 + $eps1 + $eps2); return $d * 0.001; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::ALT - Andoyer-Lambert-Thomas distance calculations. =head1 DESCRIPTION The ALT formula is intended as a much faster, but slightly less accurate, alternative of the L formula. This formulas is about 5x faster than Vincenty. The code for this formula was taken from L and modified to fit. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Constants.pm100644000765000024 173414440154626 20342 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Constants; use 5.008001; use strictures 2; our $VERSION = '0.20'; use Const::Fast; use namespace::clean; use Exporter qw( import ); our @EXPORT_OK; our %EXPORT_TAGS = ( all => \@EXPORT_OK ); const our $KILOMETER_RHO => 6371.64; push @EXPORT_OK, '$KILOMETER_RHO'; const our $DEG_RATIO => 0.0174532925199433; push @EXPORT_OK, '$DEG_RATIO'; 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Constants - Constants used by formula classes. =head1 CONSTANTS =head2 $KILOMETER_RHO Number of kilometers around the equator of the earth. C<6371.64> =head2 $DEG_RATIO Number of units in a single decimal degree (lat or lon) at the equator. C<0.0174532925199433> This value is derived from: $gis = GIS::Distance->new( 'Haversine' ); $DEG_RATIO = $gis->distance( 10,0 => 11,0 )->km() / $KILOMETER_RHO; =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Cosine.pm100644000765000024 262514440154626 17606 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Cosine; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad acos ); use GIS::Distance::Constants qw( :all ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; $lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); $lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2); my $a = sin($lat1) * sin($lat2); my $b = cos($lat1) * cos($lat2) * cos($lon2 - $lon1); my $c = acos($a + $b); return $KILOMETER_RHO * $c; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Cosine - Spherical law of cosines distance calculations. =head1 DESCRIPTION Although this formula is mathematically exact, it is unreliable for small distances. See L for related details. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA a = sin(lat1) * sin(lat2) b = cos(lat1) * cos(lat2) * cos(lon2 - lon1) c = arccos(a + b) d = R * c =head1 SEE ALSO =over =item * L =back =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Formula.pm100644000765000024 411214440154626 17764 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Formula; use 5.008001; use strictures 2; our $VERSION = '0.20'; use Class::Measure::Length qw( length ); use Carp qw( croak ); use Scalar::Util qw( blessed ); use namespace::clean; our $SELF; sub new { my $class = shift; my $args = $class->BUILDARGS( @_ ); my $self = bless { %$args }, $class; $self->{code} = $class->can('_distance'); $self->BUILD() if $self->can('BUILD'); return $self; } sub BUILDARGS { my $class = shift; return shift if @_==1 and ref($_[0]) eq 'HASH'; return { @_ }; } sub distance { my $self = shift; my @coords; foreach my $coord (@_) { if ((blessed($coord)||'') eq 'Geo::Point') { push @coords, $coord->latlong(); next; } push @coords, $coord; } croak 'Invalid arguments passsed to distance()' if @coords!=4; local $SELF = $self; return length( $self->{code}->( @coords ), 'km', ); } sub distance_metal { my $self = shift; return $self->{code}->( @_ ); } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Formula - Formula base class. =head1 DESCRIPTION This is the parent class for all L formula classes such as those listed at L. To author your own formula class: package My::Formula; use parent 'GIS::Distance::Formula'; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; # ... return $kilometers; } 1; Then use it: my $gis = GIS::Distance->new('My::Formula'); my $km = $gis->distance( @coords ); The global C<$GIS::Distance::Formula::SELF> is available when your C<_distance()> subroutine is called if, and only if, the entry point was L and NOT L or otherwise. Much of the interface described in L is actually implemented by this module. =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut GreatCircle.pm100644000765000024 274214440154626 20552 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::GreatCircle; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad asin ); use GIS::Distance::Constants qw( :all ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; $lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); $lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2); my $c = 2*asin( sqrt( ( sin(($lat1-$lat2)/2) )**2 + cos($lat1) * cos($lat2) * ( sin(($lon1-$lon2)/2) )**2 ) ); return $KILOMETER_RHO * $c; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::GreatCircle - Great circle distance calculations. =head1 DESCRIPTION A true Great Circle Distance calculation. This was created because the L formula uses L's C which doesn't actually appear to use the actual Great Circle Distance formula (more likely Cosine). A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA c = 2 * asin( sqrt( ( sin(( lat1 - lat2 )/2) )**2 + cos( lat1 ) * cos( lat2 ) * ( sin(( lon1 - lon2 )/2) )**2 ) ) =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Haversine.pm100644000765000024 377114440154626 20315 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Haversine; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad ); use GIS::Distance::Constants qw( :all ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; $lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); $lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2); my $dlon = $lon2 - $lon1; my $dlat = $lat2 - $lat1; my $a = (sin($dlat/2)) ** 2 + cos($lat1) * cos($lat2) * (sin($dlon/2)) ** 2; my $c = 2 * atan2(sqrt($a), sqrt(abs(1-$a))); return $KILOMETER_RHO * $c; } # Eric Samuelson recommended this formula. # http://forums.devshed.com/t54655/sc3d021a264676b9b440ea7cbe1f775a1.html # http://williams.best.vwh.net/avform.htm # It seems to produce the same results at the hsin formula, so... # # my $dlon = $lon2 - $lon1; # my $dlat = $lat2 - $lat1; # my $a = (sin($dlat / 2)) ** 2 # + cos($lat1) * cos($lat2) * (sin($dlon / 2)) ** 2; # $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); # # Maybe test for speed before tossing? 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Haversine - Exact spherical distance calculations. =head1 DESCRIPTION This is the default distance calculation for L as it keeps a good balance between speed and accuracy. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA dlon = lon2 - lon1 dlat = lat2 - lat1 a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2 c = 2 * atan2( sqrt(a), sqrt(1-a) ) d = R * c =head1 SEE ALSO =over =item * L =item * L =back =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut MathTrig.pm100644000765000024 246714440154626 20111 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::MathTrig; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( great_circle_distance deg2rad ); use GIS::Distance::Constants qw( :all ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; return great_circle_distance( deg2rad($lon1), deg2rad(90 - $lat1), deg2rad($lon2), deg2rad(90 - $lat2), $KILOMETER_RHO, ); } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::MathTrig - Great cirlce distance calculations using Math::Trig. =head1 DESCRIPTION This formula uses L's C which at this time uses math almost exactly the same formula as the L formula. And the Cosine formula is about 5% faster than this formula. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA lat0 = 90 degrees - phi0 lat1 = 90 degrees - phi1 d = R * arccos(cos(lat0) * cos(lat1) * cos(lon1 - lon01) + sin(lat0) * sin(lat1)) As stated in the L documentation. =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Null.pm100644000765000024 142614440154626 17276 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Null; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; sub _distance { 0 } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Null - For planets with no surface. =head1 DESCRIPTION Always returns C<0>. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA d = 0 =head1 SEE ALSO =over =item * L =item * L =back =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Polar.pm100644000765000024 302514440154626 17436 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Polar; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad pi ); use GIS::Distance::Constants qw( :all ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; $lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); $lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2); my $a = pi/2 - $lat1; my $b = pi/2 - $lat2; my $c = sqrt( $a ** 2 + $b ** 2 - 2 * $a * $b * cos($lon2 - $lon1) ); return $KILOMETER_RHO * $c; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Polar - Polar coordinate flat-earth distance calculations. =head1 DESCRIPTION Supposedly this is a formula to better calculate distances at the poles. While implemented, this formula has not been tested much. If you use it PLEASE share your results with the author. I've tested the results of this formula versus L and it appears that this formula is broken (or the implementation is) as you can see in C. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA a = pi/2 - lat1 b = pi/2 - lat2 c = sqrt( a^2 + b^2 - 2 * a * b * cos(lon2 - lon1) ) d = R * c =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut Vincenty.pm100644000765000024 1232214440154626 20200 0ustar00aranstaff000000000000GIS-Distance-0.20/lib/GIS/Distancepackage GIS::Distance::Vincenty; use 5.008001; use strictures 2; our $VERSION = '0.20'; use parent 'GIS::Distance::Formula'; use Math::Trig qw( deg2rad pi tan atan asin ); use namespace::clean; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; return 0 if (($lon1==$lon2) and ($lat1==$lat2)); $lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); $lon2 = deg2rad($lon2); $lat2 = deg2rad($lat2); my($a,$b,$f) = (6378137,6356752.3142,1/298.257223563); my $l = $lon2 - $lon1; my $u1 = atan((1-$f) * tan($lat1)); my $u2 = atan((1-$f) * tan($lat2)); my $sin_u1 = sin($u1); my $cos_u1 = cos($u1); my $sin_u2 = sin($u2); my $cos_u2 = cos($u2); my $lambda = $l; my $lambda_pi = 2 * pi; my $iter_limit = 20; my($cos_sq_alpha,$sin_sigma,$cos2sigma_m,$cos_sigma,$sigma) = (0,0,0,0,0); while( abs($lambda-$lambda_pi) > 1e-12 && --$iter_limit>0 ){ my $sin_lambda = sin($lambda); my $cos_lambda = cos($lambda); $sin_sigma = sqrt(($cos_u2*$sin_lambda) * ($cos_u2*$sin_lambda) + ($cos_u1*$sin_u2-$sin_u1*$cos_u2*$cos_lambda) * ($cos_u1*$sin_u2-$sin_u1*$cos_u2*$cos_lambda)); $cos_sigma = $sin_u1*$sin_u2 + $cos_u1*$cos_u2*$cos_lambda; $sigma = atan2($sin_sigma, $cos_sigma); my $alpha = asin($cos_u1 * $cos_u2 * $sin_lambda / $sin_sigma); $cos_sq_alpha = cos($alpha) * cos($alpha); $cos2sigma_m = $cos_sigma - 2*$sin_u1*$sin_u2/$cos_sq_alpha; my $cc = $f/16*$cos_sq_alpha*(4+$f*(4-3*$cos_sq_alpha)); $lambda_pi = $lambda; $lambda = $l + (1-$cc) * $f * sin($alpha) * ($sigma + $cc*$sin_sigma*($cos2sigma_m+$cc*$cos_sigma*(-1+2*$cos2sigma_m*$cos2sigma_m))); } my $usq = $cos_sq_alpha*($a*$a-$b*$b)/($b*$b); my $aa = 1 + $usq/16384*(4096+$usq*(-768+$usq*(320-175*$usq))); my $bb = $usq/1024 * (256+$usq*(-128+$usq*(74-47*$usq))); my $delta_sigma = $bb*$sin_sigma*($cos2sigma_m+$bb/4*($cos_sigma*(-1+2*$cos2sigma_m*$cos2sigma_m)- $bb/6*$cos2sigma_m*(-3+4*$sin_sigma*$sin_sigma)*(-3+4*$cos2sigma_m*$cos2sigma_m))); my $c = $b*$aa*($sigma-$delta_sigma); return $c / 1000; } 1; __END__ =encoding utf8 =head1 NAME GIS::Distance::Vincenty - Thaddeus Vincenty distance calculations. =head1 DESCRIPTION For the benefit of the terminally obsessive (as well as the genuinely needy), Thaddeus Vincenty devised formulae for calculating geodesic distances between a pair of latitude/longitude points on the earth's surface, using an accurate ellipsoidal model of the earth. Vincenty's formula is accurate to within 0.5mm, or 0.000015", on the ellipsoid being used. Calculations based on a spherical model, such as the (much simpler) Haversine, are accurate to around 0.3% (which is still good enough for most purposes). The accuracy quoted by Vincenty applies to the theoretical ellipsoid being used, which will differ (to varying degree) from the real earth geoid. If you happen to be located in Colorado, 2km above msl, distances will be 0.03% greater. In the UK, if you measure the distance from Land's End to John O' Groats using WGS-84, it will be 28m - 0.003% - greater than using the Airy ellipsoid, which provides a better fit for the UK. Take a look at the L formula for a much quicker alternative with nearly the same accuracy. A faster (XS) version of this formula is available as L. Normally this module is not used directly. Instead L is used which in turn interfaces with the various formula classes. =head1 FORMULA a, b = major & minor semiaxes of the ellipsoid f = flattening (a-b)/a L = lon2 - lon1 u1 = atan((1-f) * tan(lat1)) u2 = atan((1-f) * tan(lat2)) sin_u1 = sin(u1) cos_u1 = cos(u1) sin_u2 = sin(u2) cos_u2 = cos(u2) lambda = L lambda_pi = 2PI while abs(lambda-lambda_pi) > 1e-12 sin_lambda = sin(lambda) cos_lambda = cos(lambda) sin_sigma = sqrt((cos_u2 * sin_lambda) * (cos_u2*sin_lambda) + (cos_u1*sin_u2-sin_u1*cos_u2*cos_lambda) * (cos_u1*sin_u2-sin_u1*cos_u2*cos_lambda)) cos_sigma = sin_u1*sin_u2 + cos_u1*cos_u2*cos_lambda sigma = atan2(sin_sigma, cos_sigma) alpha = asin(cos_u1 * cos_u2 * sin_lambda / sin_sigma) cos_sq_alpha = cos(alpha) * cos(alpha) cos2sigma_m = cos_sigma - 2*sin_u1*sin_u2/cos_sq_alpha cc = f/16*cos_sq_alpha*(4+f*(4-3*cos_sq_alpha)) lambda_pi = lambda lambda = L + (1-cc) * f * sin(alpha) * (sigma + cc*sin_sigma*(cos2sigma_m+cc*cos_sigma*(-1+2*cos2sigma_m*cos2sigma_m))) } usq = cos_sq_alpha*(a*a-b*b)/(b*b); aa = 1 + usq/16384*(4096+usq*(-768+usq*(320-175*usq))) bb = usq/1024 * (256+usq*(-128+usq*(74-47*usq))) delta_sigma = bb*sin_sigma*(cos2sigma_m+bb/4*(cos_sigma*(-1+2*cos2sigma_m*cos2sigma_m)- bb/6*cos2sigma_m*(-3+4*sin_sigma*sin_sigma)*(-3+4*cos2sigma_m*cos2sigma_m))) c = b*aa*(sigma-delta_sigma) =head1 SEE ALSO =over =item * L =item * L =back =head1 SUPPORT See L. =head1 AUTHORS See L. =head1 LICENSE See L. =cut minil.toml100644000765000024 15414440154626 15066 0ustar00aranstaff000000000000GIS-Distance-0.20name = "GIS-Distance" authority="cpan:BLUEFEET" markdown_maker = "Pod::Markdown::Github" license = "perl_5" accuracy.t100755000765000024 320614440154626 15327 0ustar00aranstaff000000000000GIS-Distance-0.20/t#!/usr/bin/env perl use 5.008001; use strictures 2; use Test2::V0; use GIS::Distance; my $test_cases = { 'Canoga Park to San Francisco' => [ 34.202361, -118.601875, 37.752258, -122.441254, 524.347542197146, 'km'], 'Egypt to Anchorage' => [ 26.185018, 30.047607, 61.147543, -149.81575, 10324.656666156, 'km'], 'London to Sydney' => [ 51.497736, -0.115356, -33.81966, 151.169472, 16982.5402359324, 'km'], 'Santiago to Rio de Janeiro' => [-33.446339, -70.63591, -22.902981, -43.213177, 2923.66733201558, 'km'], 'Beirut to Dimashq' => [ 33.863146, 35.52824, 33.516496, 36.287842, 80241.1054436632, 'm' ], }; my $test_case_count = @{[ keys %$test_cases ]} + 0; my $formulas = [qw( ALT Cosine GreatCircle Haversine MathTrig Vincenty )]; foreach my $formula (@$formulas) { subtest "run $formula" => sub { test_formula( $formula ); done_testing; }; } done_testing; sub test_formula { my ($formula) = @_; my $gis = GIS::Distance->new( "GIS::Distance::$formula" ); foreach my $title (keys %$test_cases) { my $case = $test_cases->{$title}; my $unit = $case->[5]; my $distance = $case->[4]; my $length = $gis->distance( $case->[0], $case->[1], $case->[2], $case->[3] )->$unit(); is_close( $length, $distance, $title ); } } sub is_close { my ($num1, $num2, $description) = @_; my $lossy = $num2 * 0.00189; if (($num1 > $num2 + $lossy) or ($num1 < $num2 - $lossy)) { fail( "$description - $num1 != $num2" ); } else { pass( "$description - $num1 =~ $num2" ); } } geo_point.t100755000765000024 75314440154626 15504 0ustar00aranstaff000000000000GIS-Distance-0.20/t#!/usr/bin/env perl use 5.008001; use strictures 2; use Test2::V0; use Test2::Require::Module 'Geo::Point'; use Geo::Point; use GIS::Distance; my $gis = GIS::Distance->new('GIS::Distance::Haversine'); is( $gis->distance( Geo::Point->latlong(34.202361,-118.601875), Geo::Point->latlong(37.752258,-122.441254), )->km(), $gis->distance( 34.202361, -118.601875, 37.752258, -122.441254, )->km(), 'Geo::Point objects work', ); done_testing; null.t100755000765000024 47014440154626 14467 0ustar00aranstaff000000000000GIS-Distance-0.20/t#!/usr/bin/env perl use 5.008001; use strictures 2; use Test2::V0; use GIS::Distance; my $gis = GIS::Distance->new( 'GIS::Distance::Null' ); is( # Canoga Park to San Francisco. $gis->distance( 34.202361, -118.601875, 37.752258, -122.441254 ), 0, 'the hyperloop is working', ); done_testing; polar.t100755000765000024 140714440154626 14653 0ustar00aranstaff000000000000GIS-Distance-0.20/t#!/usr/bin/end perl use 5.008001; use strictures 2; use Test2::V0; use GIS::Distance; my @coords = ( -84.302183, 58.886719, -81.24166, -154.951172 ); my $vincenty = GIS::Distance->new( 'GIS::Distance::Vincenty' ); my $polar = GIS::Distance->new( 'GIS::Distance::Polar' ); my $v_length = $vincenty->distance( @coords ); my $p_length = $polar->distance( @coords ); todo 'Polar formula is broken' => sub{ is_close( $v_length->km(), $p_length->km(), 'Vincenty versus Polar' ); }; sub is_close { my ($num1, $num2, $description) = @_; my $lossy = $num2 * 0.01; if (($num1 > $num2 + $lossy) or ($num1 < $num2 - $lossy)) { fail( "$description - $num1 != $num2" ); } else { pass( "$description - $num1 =~ $num2" ); } } done_testing; META.yml100644000765000024 405414440154626 14355 0ustar00aranstaff000000000000GIS-Distance-0.20--- abstract: 'Calculate geographic distances.' author: - 'Aran Clary Deltac ' build_requires: Test2::V0: '0.000094' configure_requires: Module::Build::Tiny: '0.035' dynamic_config: 0 generated_by: 'Minilla/v3.1.21, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: GIS-Distance no_index: directory: - t - xt - inc - share - eg - examples - author - builder provides: GIS::Distance: file: lib/GIS/Distance.pm version: '0.20' GIS::Distance::ALT: file: lib/GIS/Distance/ALT.pm version: '0.20' GIS::Distance::Constants: file: lib/GIS/Distance/Constants.pm version: '0.20' GIS::Distance::Cosine: file: lib/GIS/Distance/Cosine.pm version: '0.20' GIS::Distance::Formula: file: lib/GIS/Distance/Formula.pm version: '0.20' GIS::Distance::GreatCircle: file: lib/GIS/Distance/GreatCircle.pm version: '0.20' GIS::Distance::Haversine: file: lib/GIS/Distance/Haversine.pm version: '0.20' GIS::Distance::MathTrig: file: lib/GIS/Distance/MathTrig.pm version: '0.20' GIS::Distance::Null: file: lib/GIS/Distance/Null.pm version: '0.20' GIS::Distance::Polar: file: lib/GIS/Distance/Polar.pm version: '0.20' GIS::Distance::Vincenty: file: lib/GIS/Distance/Vincenty.pm version: '0.20' recommends: GIS::Distance::Fast: '0.13' requires: Carp: '0' Class::Measure::Length: '0' Const::Fast: '0.014' Math::Trig: '0' Scalar::Util: '0' namespace::clean: '0.24' parent: '0' perl: '5.008001' strictures: '2.000000' resources: bugtracker: https://github.com/bluefeet/GIS-Distance/issues homepage: https://github.com/bluefeet/GIS-Distance repository: https://github.com/bluefeet/GIS-Distance.git version: '0.20' x_authority: cpan:BLUEFEET x_contributors: - 'Florian Schlichting ' - 'Mohammad S Anwar ' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 MANIFEST100644000765000024 73214440154626 14214 0ustar00aranstaff000000000000GIS-Distance-0.20Build.PL Changes LICENSE META.json README.md author/bench author/cpanfile author/distances cpanfile lib/GIS/Distance.pm lib/GIS/Distance/ALT.pm lib/GIS/Distance/Constants.pm lib/GIS/Distance/Cosine.pm lib/GIS/Distance/Formula.pm lib/GIS/Distance/GreatCircle.pm lib/GIS/Distance/Haversine.pm lib/GIS/Distance/MathTrig.pm lib/GIS/Distance/Null.pm lib/GIS/Distance/Polar.pm lib/GIS/Distance/Vincenty.pm minil.toml t/accuracy.t t/geo_point.t t/null.t t/polar.t META.yml MANIFEST