Method: GeoCombine::BoundingBox.from_string_delimiter

Defined in:
lib/geo_combine/bounding_box.rb

.from_string_delimiter(spatial, delimiter: ',') ⇒ Object

Parameters:

  • spatial (String)

    w,s,e,n or w s e n

  • delimiter (String) (defaults to: ',')

    “,” or “ ”



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/geo_combine/bounding_box.rb', line 65

def self.from_string_delimiter(spatial, delimiter: ',')
  return if spatial.nil?

  spatial = spatial.split(delimiter)
  new(
    west: spatial[0],
    south: spatial[1],
    east: spatial[2],
    north: spatial[3]
  )
end