Geo::Sh...e::Point(3)
π Geo::ShapeFile::Point β the manual, but make it cute π
okay bestie, so this is the User Contributed Perl Documentation page for Geo::ShapeFile::Point, and no cap, it's a whole little utility class from the Geo::ShapeFile universe. let's get into it π«Ά
β¨ NAME β¨
Geo::ShapeFile::Point β it's a utility class for Geo::ShapeFile, periodt. π
β¨ SYNOPSIS β¨
here's the vibe, literally exactly this:
use Geo::ShapeFile::Point;
use Geo::ShapeFile;
my $point = Geo::ShapeFile::Point->new(X => 12345, Y => 54321);
boom. a point. iconic behavior honestly β¨
β¨ ABSTRACT β¨
This is a utility class, used by Geo::ShapeFile.
that's it, that's the abstract. she's a helper. a support system. the bestie behind the scenes π
β¨ DESCRIPTION β¨
so basically this is a utility class that Geo::ShapeFile uses to represent point data. if you want the real tea, go read the Geo::ShapeFile documentation, because this page is just the point-y little corner of it π¦
πΈ EXPORT πΈ
Nothing. zero. nada. she exports absolutely nothing, and honestly? respect. boundaries π
πΈ IMPORT NOTE πΈ
okay this part matters, so listen up. this module uses overloaded operators so you can compare two point objects with == or eq. cute, right?
by default, two points are only considered equal if all four of their X, Y, Z, and M attributes match. if you wanna skip the Z or M attributes when comparing, you need to use comp_includes_z or comp_includes_m when importing the object.
β οΈ and this is the part people mess up: you have to do this BEFORE you load the Geo::ShapeFile module. otherwise it'll pass its own arguments to import, and you'll just get the default behavior. not the vibe you wanted π
DO β
use Geo::ShapeFile::Point comp_includes_m => 0, comp_includes_z => 0;
use Geo::ShapeFile;
DON'T β
use Geo::ShapeFile;
use Geo::ShapeFile::Point comp_includes_m => 0, comp_includes_z => 0;
(Geo::ShapeFile already imported Point for you, so it has no effect here)
see how Geo::ShapeFile already imported Point for you in the don't-version? yeah. so it has no effect there. order matters bestie, always π
β¨ METHODS β¨
new (X => $x, Y => $y)β makes you a shiny newGeo::ShapeFile::Pointobject. it takes a hash made ofX,Y,Z, and/orMvalues, and those get assigned to the point. give her the coordinates and she'll show up πX() Y() Z() M()β set or retrieve theX,Y,Z, orMvalues on this object. dual purpose queen, she does both β¨get_x() get_y() get_z() get_m()β just gets theX,Y,Z, orMvalues, no setting involved. she's slightly faster than those dual-purpose set/retrieve methods, so she's the one you want for the heavy-usage parts of your code. efficient. lowkey obsessed π₯x_min() x_max() y_min() y_max()β and alsoz_min() z_max() m_min() m_max(). these exist purely for compatibility withGeo::ShapeFile::Shape. but plot twist: for points they just return theX,Y,Z, orMcoordinates as appropriate. min and max are the same girl here πdistance_from($point)β returns the distance between this point and the point you passed in. only counts the two-dimensional distance though.ZandMvalues? ignored. they're not invited π«angle_to($point);β returns the bearing (in degrees from north) from this point to some other point. and if the two points are sitting in the same exact location, you get0. can't have a bearing when you're already there, bestie π§
β¨ REPORTING BUGS β¨
got bugs? suggestions? a feature request burning a hole in your notes app? send it all to:
<https://github.com/shawnlaffan/Geo-ShapeFile/issues>.
she's listening, fr fr π
β¨ SEE ALSO β¨
Geo::ShapeFile β the main character, go check her out π
β¨ AUTHOR β¨
- Jason Kohles,
<email@jasonkohles.com> - Shawn Laffan,
<shawnlaffan@gmail.com>
legends, both of them π
β¨ COPYRIGHT AND LICENSE β¨
Copyright 2002-2013 by Jason Kohles
Copyright 2014-2023 by Shawn Laffan
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
so yeah, free as in do-what-you-want-with-Perl's-rules. slay π
and that's the whole page bestie!! this one's from perl v5.42.0, dated 2025-07-25, and it's part of the User Contributed Perl Documentation set for Geo::Sh...e::Point(3). mwah, go plot some points ππβ¨
π¦ where this page comes from
- fedora 43: perl-Geo-ShapeFile 3.03-7.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms