parser-aws/dataset_filter.rb
# check if a coordinates point is wthin a certain box
check if a coordinates point is wthin a certain box
check if a coordinates point is wthin a certain box
def within_box?(bounding_box, point_lat, point_lon)
  box_lons = [bounding_box[:ne][:lon], bounding_box[:sw][:lon]]
  box_lats = [bounding_box[:ne][:lat], bounding_box[:sw][:lat]]
  return (point_lon.between?(box_lons.min, box_lons.max) && point_lat.between?(box_lats.min, box_lats.max))
end
def within_box? ( bounding_box , point_lat , point_lon ) box_lons = [ bounding_box [ :ne ] [ :lon ] , bounding_box [ :sw ] [ :lon ] ] box_lats = [ bounding_box [ :ne ] [ :lat ] , bounding_box [ :sw ] [ :lat ] ] return ( point_lon . between? ( box_lons . min , box_lons . max ) && point_lat . between? ( box_lats . min , box_lats . max ) ) end
check if a coordinates point is wthin a certain box
check if a coordinates point is wthin a certain box
bounding_box
<not_specific>
point_lat
<not_specific>
point_lon
<not_specific>