Class: Proj::Area

Inherits:
Object
  • Object
show all
Defined in:
lib/proj/area.rb

Overview

Areas are used to specify the area of use for the choice of relevant coordinate operations. See Transformation#new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, name: nil) ⇒ Area

Returns a new instance of Area.



16
17
18
19
20
21
22
23
# File 'lib/proj/area.rb', line 16

def initialize(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:, name: nil)
  @west_lon_degree = west_lon_degree
  @south_lat_degree = south_lat_degree
  @east_lon_degree = east_lon_degree
  @north_lat_degree = north_lat_degree
  @name = name
  create_area
end

Instance Attribute Details

#east_lon_degreeObject (readonly)

Returns the value of attribute east_lon_degree.



7
8
9
# File 'lib/proj/area.rb', line 7

def east_lon_degree
  @east_lon_degree
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/proj/area.rb', line 7

def name
  @name
end

#north_lat_degreeObject (readonly)

Returns the value of attribute north_lat_degree.



7
8
9
# File 'lib/proj/area.rb', line 7

def north_lat_degree
  @north_lat_degree
end

#south_lat_degreeObject (readonly)

Returns the value of attribute south_lat_degree.



7
8
9
# File 'lib/proj/area.rb', line 7

def south_lat_degree
  @south_lat_degree
end

#west_lon_degreeObject (readonly)

Returns the value of attribute west_lon_degree.



7
8
9
# File 'lib/proj/area.rb', line 7

def west_lon_degree
  @west_lon_degree
end

Instance Method Details

#set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:) ⇒ Object

Sets the bounds for an area

Parameters:

  • west_lon_degree (Float)

    West longitude, in degrees. In [-180,180] range.

  • south_lat_degree (Float)

    South latitude, in degrees. In [-90,90] range.

  • east_lon_degree (Float)

    East longitude, in degrees. In [-180,180] range.

  • north_lat_degree (Float)

    North latitude, in degrees. In [-90,90] range.

See Also:



37
38
39
# File 'lib/proj/area.rb', line 37

def set_bounds(west_lon_degree:, south_lat_degree:, east_lon_degree:, north_lat_degree:)
  Api.proj_area_set_bbox(self, west_lon_degree, south_lat_degree, east_lon_degree, north_lat_degree)
end

#to_ptrObject



25
26
27
# File 'lib/proj/area.rb', line 25

def to_ptr
  @area
end

#to_sString

Returns nice printout of an Area

Returns:

  • (String)


55
56
57
# File 'lib/proj/area.rb', line 55

def to_s
  "Area west_lon_degree: #{self.west_lon_degree}, south_lat_degree: #{self.south_lat_degree}, east_lon_degree: #{self.east_lon_degree}, north_lat_degree: #{self.north_lat_degree}"
end