Class: OpenTopo::Net::Params::UsgsdemParams

Inherits:
BaseParams
  • Object
show all
Defined in:
lib/open_topo/net/params/usgsdem_params.rb

Constant Summary collapse

OUTPUT_FORMATS =
{tif: "GTiff", hfa: "HFA", asc: "AAIGrid"}
DEM_TYPES =
{
  usgs1m: "USGS1m",
  usgs10m: "USGS10m",
  usgs30m: "USGS30m"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseParams

#error_messages, #valid?, #validate!, validate_with

Constructor Details

#initialize(south:, north:, west:, east:, dataset_name:, output_format:) ⇒ UsgsdemParams

Returns a new instance of UsgsdemParams.



18
19
20
21
22
23
24
25
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 18

def initialize(south:, north:, west:, east:, dataset_name:, output_format:)
  @south = south
  @north = north
  @west = west
  @east = east
  @demtype = dataset_name
  @output_format = output_format
end

Instance Attribute Details

#demtypeObject (readonly)

Returns the value of attribute demtype.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def demtype
  @demtype
end

#eastObject (readonly)

Returns the value of attribute east.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def east
  @east
end

#northObject (readonly)

Returns the value of attribute north.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def north
  @north
end

#output_formatObject (readonly)

Returns the value of attribute output_format.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def output_format
  @output_format
end

#southObject (readonly)

Returns the value of attribute south.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def south
  @south
end

#westObject (readonly)

Returns the value of attribute west.



16
17
18
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 16

def west
  @west
end

Instance Method Details

#to_paramsObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/open_topo/net/params/usgsdem_params.rb', line 27

def to_params
  {
    south:,
    north:,
    west:,
    east:,
    datasetName: DEM_TYPES[demtype.to_sym],
    outputFormat: OUTPUT_FORMATS[output_format.to_sym]
  }
end