Acme-Geo-Whitwell-Name
view release on metacpan or search on metacpan
lib/Acme/Geo/Whitwell/Name.pm view on Meta::CPAN
697071727374757677787980818283848586878889This is very orderly, but confusing to generate by hand (putting aside the
fact that
no
one in their right mind really wants to live in
"Isilu Buban"
instead of Sydney, AU, or
"Feiro Nyvout"
instead of Washington, DC).
The generated names are guaranteed to have alternating consonants and vowels,
and should be pronounceable (though most likely bizarre). I have not been able
to locate the original documentation of the scheme, so I am unable to determine
why some example names are built in
"reverse"
:
with
the first letter
for
the
latitude selected from the longitude table, and vice versa
for
the longitude. I
can only guess that the alternate construction was deemed more pronounceable or
"interesting"
. Since this is the case, I generate both alternatives so you can
choose the one that seems
"better"
. In the cases of places like McMurdo Base
(
"Eeseepu Bymeem"
or
"Neeveil Amyny"
), I'm not sure there I<is> a
"better"
.
However, solely
for
the purposes of amusement, it can be interesting to find
out what a
given
location would have been called in the alternate universe
where Whitwell's scheme caught on.
online maps, wouldn't it?
lib/Acme/Geo/Whitwell/Name.pm view on Meta::CPAN
326327328329330331332333334335336337338339340341342343344345
# Let's try the easy case first, and insert a decimal point
# right before the last two digits. All names generated via
# to_whitwell() will work with this case. Since we know the
# coordinate string only has numbers in it, we can just divide
# by 100.
my
$trial_value
=
$coord_string
/100;
# Manufactured by some other means. Move the decimal left one
# character at a time until the number is < 180. We never do this
# at all if our initial guess worked.
$trial_value
/= 10
while
$trial_value
> 180;
$coord_string
=
$trial_value
;
}
else
{
# < 3, so can't be > 180. Just add decimals.
$coord_string
.=
".00"
;
}
return
(
$coord_string
,
$is_negative
);
}
( run in 0.215 second using v1.01-cache-2.11-cpan-cba739cd03b )