ring_area
Version, currently 0.2.15 versions
github.com/geocrystal/ring_area
Calculate the approximate area of the polygon were it projected onto the Earth.
2 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
ring_area:
github: geocrystal/ring_area
version: ~> 0.2.1Then run:
shards installshard.yml
- Crystal
>= 1.0.0- License
- MIT
- Author
- Anton Maminov
Dependencies
This version declares no dependencies.
README
ring_area
Calculate the approximate area of the polygon were it projected onto the earth.
Installation
-
Add the dependency to your
shard.yml:dependencies: ring_area: github: geocrystal/ring_area -
Run
shards install
Usage
require "ring_area"
coordinates = [
[125, -15],
[113, -22],
[117, -37],
[130, -33],
[148, -39],
[154, -27],
[144, -15],
[125, -15],
]
RingArea.ring_area(coordinates).to_meters
# => 7748891609977.456
Accepts an Array(Array(Number)) of Ring Coordinates as [[longitude1, latitude1], [longitude2, latitude2], ...].
Returns a RingArea::Area object which can provide output in kilometers, meters, miles, feet, etc.
Contributing
- Fork it (https://github.com/geocrystal/ring_area/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Anton Maminov - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.1- Tagged
- Apr 30, 2024
- Commit
109a0ecc1bde- Crystal
>= 1.0.0- Indexed
- yes
Dependents
Repository
github.com/geocrystal/ring_area
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 23, 2026
- Synced
- Sep 23, 2026
- Versions
- 5