Class: Geoloader::Loaders::ShapefileGeoserver
- Defined in:
- lib/geoloader/loaders/shapefile_geoserver.rb
Instance Attribute Summary collapse
-
#geoserver ⇒ Object
readonly
Returns the value of attribute geoserver.
-
#shapefile ⇒ Object
readonly
Returns the value of attribute shapefile.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ShapefileGeoserver
constructor
Configure the asset, connect to Geoserver.
-
#load ⇒ Object
Push a Shapefile to Geoserver.
Methods inherited from Loader
Constructor Details
#initialize(*args) ⇒ ShapefileGeoserver
Configure the asset, connect to Geoserver.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/geoloader/loaders/shapefile_geoserver.rb', line 14 def initialize(*args) super # Create and configure the asset. @shapefile = Geoloader::Assets::Asset.new(@file_path, @workspace, @desc_path) @shapefile.extend(Geoloader::Assets::Shapefile) # Connect to Geoserver, create the workspace. @geoserver = Geoloader::Services::Geoserver.new @geoserver.ensure_workspace(@workspace) end |
Instance Attribute Details
#geoserver ⇒ Object (readonly)
Returns the value of attribute geoserver.
7 8 9 |
# File 'lib/geoloader/loaders/shapefile_geoserver.rb', line 7 def geoserver @geoserver end |
#shapefile ⇒ Object (readonly)
Returns the value of attribute shapefile.
7 8 9 |
# File 'lib/geoloader/loaders/shapefile_geoserver.rb', line 7 def shapefile @shapefile end |
Instance Method Details
#load ⇒ Object
Push a Shapefile to Geoserver.
31 32 33 34 35 |
# File 'lib/geoloader/loaders/shapefile_geoserver.rb', line 31 def load @shapefile.stage do @geoserver.create_datastore(@shapefile) end end |