Method: Opencellid::BBox#initialize

Defined in:
lib/opencellid/bbox.rb

#initialize(latmin, lonmin, latmax, lonmax) ⇒ BBox

Returns a new instance of BBox.

Parameters:

  • latmin (Float)

    latmin the latitude of the SW corner of the box

  • lonmin (Float)

    lonmin the longitude of the SW corner of the box

  • latmax (Float)

    latmax the latitude of the NE corner of the box

  • lonmax (Float)

    lonmax the longitude of the NE corner of the box

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
21
22
# File 'lib/opencellid/bbox.rb', line 13

def initialize(latmin, lonmin, latmax, lonmax)
  raise ArgumentError, 'latmin must not be nil' unless latmin
  raise ArgumentError, 'lonmin must not be nil' unless lonmin
  raise ArgumentError, 'latmax must not be nil' unless latmax
  raise ArgumentError, 'lonmax must not be nil' unless lonmax
  @latmin = latmin
  @lonmin = lonmin
  @latmax = latmax
  @lonmax = lonmax
end