Geohash: Difference between revisions

Content added Content deleted
(→‎{{header|Raku}}: Add alternate version)
(→‎{{header|Raku}}: Add sub headings)
Line 252: Line 252:


=={{header|Raku}}==
=={{header|Raku}}==
===Module based===
Reference: I have used [https://www.movable-type.co.uk/scripts/geohash.html this] for verification.
Reference: Used [https://www.movable-type.co.uk/scripts/geohash.html this] for verification.
<lang perl6>#20200615 Raku programming solution
<lang perl6>#20200615 Raku programming solution


Line 277: Line 278:
</pre>
</pre>


===Roll your own===
Alternately, a roll-your-own version that will work with any Real coordinate, not just floating point values, and thus can return ridiculous precision.
Alternately, a roll-your-own version that will work with any Real coordinate, not just floating point values, and thus can return ridiculous precision.
The geo-decode routine returns the range in which the actual value will be found; converted here to the mid-point with the interval size. Probably better
The geo-decode routine returns the range in which the actual value will be found; converted here to the mid-point with the interval size. Probably better