Geo::Sh...e::Point(3)

πŸ“¦
version 3.03 Β· 2 versions
, in fedora 43

πŸ’– 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 new Geo::ShapeFile::Point object. it takes a hash made of X, Y, Z, and/or M values, and those get assigned to the point. give her the coordinates and she'll show up πŸ’–
  • X() Y() Z() M() β€” set or retrieve the X, Y, Z, or M values on this object. dual purpose queen, she does both ✨
  • get_x() get_y() get_z() get_m() β€” just gets the X, Y, Z, or M values, 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 also z_min() z_max() m_min() m_max(). these exist purely for compatibility with Geo::ShapeFile::Shape. but plot twist: for points they just return the X, Y, Z, or M coordinates 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. Z and M values? 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 get 0. 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 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