Class: ShapefileDownload

Inherits:
Download show all
Defined in:
lib/geoblacklight/download/shapefile_download.rb

Constant Summary collapse

SHAPEFILE_DOWNLOAD_PARAMS =
{ service: 'wfs', version: '2.0.0', request: 'GetFeature', srsName: 'EPSG:4326', outputformat: 'SHAPE-ZIP' }

Instance Method Summary collapse

Methods inherited from Download

#create_download_file, #download_exists?, #downloadable?, #file_name, #file_path, #get, #initiate_download

Constructor Details

#initialize(document) ⇒ ShapefileDownload

Returns a new instance of ShapefileDownload.


4
5
6
7
8
9
10
11
12
13
# File 'lib/geoblacklight/download/shapefile_download.rb', line 4

def initialize(document)
  request_params = SHAPEFILE_DOWNLOAD_PARAMS.merge(typeName: document[:layer_id_s])
  super(document, {
    type: 'shapefile',
    extension: 'zip',
    request_params: request_params,
    content_type: 'application/zip',
    service_type: 'wfs'
  })
end