Class: GeojsonDownload

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

Constant Summary collapse

GEOJSON_DOWNLOAD_PARAMS =
{
  service: 'wfs',
  version: '2.0.0',
  request: 'GetFeature',
  srsName: 'EPSG:4326',
  outputformat: 'application/json'
}

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) ⇒ GeojsonDownload

Returns a new instance of GeojsonDownload.


10
11
12
13
14
15
16
17
18
19
# File 'lib/geoblacklight/download/geojson_download.rb', line 10

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