class Geoloader::Loaders::GeotiffGeoserver

Attributes

geoserver[R]
geotiff[R]

Public Class Methods

new(*args) click to toggle source

Configure the asset, connect to Geoserver.

Calls superclass method
# File lib/geoloader/loaders/geotiff_geoserver.rb, line 14
def initialize(*args)

  super

  # Create and configure the asset.
  @geotiff = Geoloader::Assets::Asset.new(@file_path, @workspace, @desc_path)
  @geotiff.extend(Geoloader::Assets::Geotiff)

  # Connect to Geoserver, create the workspace.
  @geoserver = Geoloader::Services::Geoserver.new
  @geoserver.ensure_workspace(@workspace)

end

Public Instance Methods

load() click to toggle source

Push a GeoTIFF to Geoserver.

# File lib/geoloader/loaders/geotiff_geoserver.rb, line 31
def load
  @geotiff.stage do

    # Prepare the file.
    @geotiff.make_borders_transparent
    @geotiff.reproject

    # Push to Geoserver.
    @geoserver.create_coveragestore(@geotiff)

  end
end