Sha256: 1783b79ff3286d8bf0ce489f457a9d27516defd7411e43886731fb650894e52e

Contents?: true

Size: 400 Bytes

Versions: 20

Compression:

Stored size: 400 Bytes

Contents

def clip_to_region(p1, p2, lat_column_name, lon_column_name)
  min_lat = [p1[0], p2[0]].min
  max_lat = [p1[0], p2[0]].max
  min_lon = [p1[1], p2[1]].min
  max_lon = [p1[1], p2[1]].max
  %Q|'(row[#{c0(lat_column_name)}]>=#{min_lat} && |+
    %Q|row[#{c0(lat_column_name)}]<=#{max_lat}) && |+
    %Q|(row[#{c0(lon_column_name)}]>=#{min_lon} && |+
    %Q|row[#{c0(lon_column_name)}]<=#{max_lon})'|
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
advance-0.4.11 lib/clip_to_region.rb
advance-0.4.10 lib/clip_to_region.rb
advance-0.4.8 lib/clip_to_region.rb
advance-0.4.7 lib/clip_to_region.rb
advance-0.4.6 lib/clip_to_region.rb
advance-0.4.5 lib/clip_to_region.rb
advance-0.4.4 lib/clip_to_region.rb
advance-0.4.3 lib/clip_to_region.rb
advance-0.4.2 lib/clip_to_region.rb
advance-0.4.1 lib/clip_to_region.rb
advance-0.3.18 lib/clip_to_region.rb
advance-0.3.16 lib/clip_to_region.rb
advance-0.3.15 lib/clip_to_region.rb
advance-0.3.14 lib/clip_to_region.rb
advance-0.3.13 lib/clip_to_region.rb
advance-0.3.12 lib/clip_to_region.rb
advance-0.3.11 lib/clip_to_region.rb
advance-0.3.10 lib/clip_to_region.rb
advance-0.3.9 lib/clip_to_region.rb
advance-0.3.8 lib/clip_to_region.rb