Support for geo data and databases in ruby and rails
Support for geo and databases in Ruby and Rails
require"open-uri"require"json"require"rgeo"require"rgeo-geojson"my_lat,my_lng=[45,5]my_position=RGeo::Cartesian.factory.point(my_lng,my_lat)geojson=URI.open("https://git.io/rhone-alpes.geojson").readrhone_alpes=RGeo::GeoJSON.decode(geojson).geometryifrhone_alpes.contains?(my_position)puts"Let's ski ⛷"end
Thanks to@dazuma, author of RGeo. And to every contributors of the variousprojects.