Class: Geoblacklight::GeojsonDownload

Inherits:
Download
  • Object
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"
}.freeze

Instance Method Summary collapse

Methods inherited from Download

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

Constructor Details

#initialize(document, options = {}) ⇒ GeojsonDownload

Returns a new instance of GeojsonDownload.



13
14
15
16
17
18
19
20
21
22
# File 'lib/geoblacklight/download/geojson_download.rb', line 13

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