Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $f = RGeo::Geographic.spherical_factory
- wkt = RGeo::Shapefile::Reader.open("fenced_in_area_4326.shp")[0].as_text
- $fenced_in_area = $f.parse_wkt(wkt)
- def within_fenced_area(lat, lng)
- pt = $f.point(lng, lat)
- $fenced_in_area.contains?(pt) ? true : false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement