Module: GeoWorks::Derivatives::Processors::BaseGeoProcessor
- Extended by:
- ActiveSupport::Concern
- Included in:
- Raster::Base, Vector::Base
- Defined in:
- lib/geo_works/derivatives/processors/base_geo_processor.rb
Instance Method Summary collapse
-
#basename ⇒ String
Extracts the base file name (without extension) from the source file path.
-
#id ⇒ String
Gets the fileset id or returns nil.
-
#label ⇒ Sting
Returns the label directive or an empty string.
- #options_for(_format) ⇒ Object
-
#output_size ⇒ String
Transforms the size directive into a GDAL size parameter.
-
#output_srid ⇒ String
Gets srid for reprojection derivative or returns WGS 84.
Instance Method Details
#basename ⇒ String
Extracts the base file name (without extension) from the source file path.
80 81 82 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 80 def basename File.basename(source_path, File.extname(source_path)) end |
#id ⇒ String
Gets the fileset id or returns nil.
86 87 88 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 86 def id directives.fetch(:id, nil) end |
#label ⇒ Sting
Returns the label directive or an empty string.
61 62 63 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 61 def label directives.fetch(:label, '') end |
#options_for(_format) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 49 def (_format) { label: label, output_size: output_size, output_srid: output_srid, basename: basename, id: id } end |
#output_size ⇒ String
Transforms the size directive into a GDAL size parameter.
67 68 69 70 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 67 def output_size return unless directives[:size] directives[:size].tr('x', ' ') end |
#output_srid ⇒ String
Gets srid for reprojection derivative or returns WGS 84.
74 75 76 |
# File 'lib/geo_works/derivatives/processors/base_geo_processor.rb', line 74 def output_srid directives.fetch(:srid, 'EPSG:4326') end |