Tirex::Metatile(3pm)

✨ Tirex::Metatile β€” the metatile manual (Perl, bestie) ✨

okay so. you're here for Tirex::Metatile (it's a 3pm page, from the User Contributed Perl Documentation corner of the universe) and honestly? same. it's a Metatile. that's the whole vibe. let's get into it πŸŽ€


🌸 SYNOPSIS 🌸

my $mt = Tirex::Metatile->new( map => 'osm', x => 16, y => 12, z=> 12 );

look at her. one line, one metatile, zero drama. slay.


πŸ’– DESCRIPTION πŸ’–

A metatile. πŸ’… that's it, that's the description. mysterious, iconic, no notes.


πŸ‘‘ METHODS πŸ‘‘

🌈 Tirex::Metatile->new( ... )

Creates a brand new metatile object, fresh out the box, main character energy ✨

A metatile always needs these parameters, no skipping, bestie:

  • map β€” the map config to use for rendering πŸ—ΊοΈ
  • x β€” metatile x coordinate
  • y β€” metatile y coordinate
  • z β€” zoom level πŸ”

You can give any x and y coordinate in the range 0 .. 2^z-1. and then β€” plot twist β€” it gets rounded down to the next tile coordinate. it's giving "we'll take the nearest one, don't worry about it" πŸ™ˆ

⚠️ Croaks if there is a problem with the parameters. so like, feed her bad params and she Will yell at you. respectfully.

🌟 Tirex::Metatile->new_from_filename_and_map($filename, $map)

Builds a metatile from a filename. the first directory element must be the zoom level, that part is non-negotiable 🫢

and optionally? the filename can start with / or ./. flexible queen.


πŸ¦‹ Tirex::Metatile->new_from_lon_lat(map => $map, lon => $lon, lat => $lat, z => $z)

Creates a metatile from zoom, longitude, and latitude. coordinates-to-metatile pipeline, lowkey satisfying 🌍✨


πŸ’œ $mt->get_x()

Gets the x coordinate. that's it. short king.

πŸ’œ $mt->get_y()

Gets the y coordinate. yes bestie, we're doing all of them.

πŸ’œ $mt->get_x()

Gets the zoom. (yes, the heading says get_x() β€” that's what the page says, and we do not edit the lore. iykyk 😭)

πŸ’œ $mt->get_map()

Gets the map. just the map. no thoughts, head empty.


πŸŽ€ $mt->to_s()

Returns a string describing this metatile, in the format 'map=MAP z=Z x=X y=Y'. a little summary card for your tile 🫢


⭐ $mt->equals($other_metatile)

Returns true if both metatiles are the same, false otherwise. πŸͺž

and "the same tile" means: same map, same x and y coordinates, and same zoom level. all four or it's not a match, periodt.


πŸ”₯ $mt->up()

Returns the metatile one zoom level above this metatile that contains this metatile. yes β€” the parent, the bigger picture, the girlboss above her πŸŒˆβ¬†οΈ


🧚 $mt->get_filename()

Returns the filename for this metatile. πŸ“

The format is something like:

[zoom]/[path].meta

where:

zoom          zoom level
path          path with 4 directory elements and a filename
              based on x and y coordinates

four whole directory elements, she's specific like that πŸ’…


🌸 $mt->exists()

Does the metatile file for this metatile exist? πŸ€” yes or no, that's the whole question.


πŸ’– $mt->older($time)

Is the metatile file older than the given time? πŸ•°οΈ

Returns 2 if the file doesn't exist. (yes, 2. not a typo, not a vibe, that's the rule.)

✨ $mt->newer($time)

Is the metatile file newer than the given time? πŸ•°οΈβœ¨

Returns 2 if the file doesn't exist. same energy, same 2.

🌈 $mt->size()

Returns the size of the metatile file. big? small? she's got the number for you πŸ“


🫢 THE SEND-OFF 🫢

that's the whole page bestie, every method accounted for, nothing skipped, no cap πŸ’― this little gem lives in the Tirex::Metatile(3pm) section of the User Contributed Perl Documentation, built for perl v5.40.1, and stamped 2026-08-09 β€” so go forth, make metatiles, and be iconic πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from