geoblacklight 3.0.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +142 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +9 -10
- data/.rubocop_todo.yml +356 -26
- data/README.md +2 -2
- data/Rakefile +12 -4
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
- data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
- data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
- data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
- data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
- data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
- data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/_blacklight_overrides.scss +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +1 -1
- data/app/helpers/geoblacklight_helper.rb +14 -2
- data/app/models/concerns/geoblacklight/solr_document.rb +8 -13
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -3
- data/app/views/catalog/_document_split.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +1 -1
- data/app/views/catalog/_index_split_default.html.erb +1 -1
- data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
- data/app/views/download/hgl.html.erb +13 -11
- data/app/views/relation/_ancestors.html.erb +2 -2
- data/app/views/relation/_descendants.html.erb +2 -2
- data/babel.config.json +4 -0
- data/bin/coverage.rb +2 -2
- data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
- data/config/initializers/rails_config.rb +4 -0
- data/config/locales/geoblacklight.en.yml +4 -0
- data/geoblacklight.gemspec +6 -5
- data/jest.config.js +25 -0
- data/lib/generators/geoblacklight/install_generator.rb +1 -1
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +2 -1
- data/lib/generators/geoblacklight/templates/settings.yml +20 -11
- data/lib/geoblacklight.rb +1 -2
- data/lib/geoblacklight/bounding_box.rb +1 -1
- data/lib/geoblacklight/constants.rb +1 -0
- data/lib/geoblacklight/download/kmz_download.rb +1 -1
- data/lib/geoblacklight/engine.rb +1 -0
- data/lib/geoblacklight/geometry.rb +85 -0
- data/lib/geoblacklight/item_viewer.rb +5 -1
- data/lib/geoblacklight/metadata/base.rb +1 -7
- data/lib/geoblacklight/relation/ancestors.rb +2 -2
- data/lib/geoblacklight/relation/descendants.rb +1 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/wms_layer.rb +1 -4
- data/lib/tasks/geoblacklight.rake +5 -0
- data/package.json +17 -1
- data/setupJest.js +14 -0
- data/solr/conf/schema.xml +1 -3
- data/spec/config/initializers/rails_config_spec.rb +14 -0
- data/spec/controllers/catalog_controller_spec.rb +6 -6
- data/spec/features/download_layer_spec.rb +1 -1
- data/spec/features/relations_spec.rb +1 -1
- data/spec/features/search_results_overlap_ratio_spec.rb +2 -2
- data/spec/features/split_view.html.erb_spec.rb +1 -1
- data/spec/features/tms_spec.rb +10 -0
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
- data/spec/fixtures/solr_documents/tms.json +29 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +30 -4
- data/spec/javascripts/geoblacklight_spec.js +0 -6
- data/spec/javascripts/metadata_download_button_spec.js +5 -3
- data/spec/javascripts/util_spec.js +2 -4
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +2 -2
- data/spec/lib/geoblacklight/download_spec.rb +1 -1
- data/spec/lib/geoblacklight/geometry_spec.rb +59 -0
- data/spec/lib/geoblacklight/item_viewer_spec.rb +12 -0
- data/spec/lib/geoblacklight/references_spec.rb +1 -1
- data/spec/lib/geoblacklight/relation/ancestors_spec.rb +1 -1
- data/spec/lib/geoblacklight/relation/descendants_spec.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -8
- data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -1
- data/template.rb +3 -2
- metadata +58 -36
- data/.circleci/config.yml +0 -252
- data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +0 -12
- data/spec/javascripts/spec_helper.js +0 -32
- data/spec/lib/geoblacklight/controller_override_spec.rb +0 -2
- data/spec/teaspoon_env.rb +0 -214
@@ -1,8 +1,8 @@
|
|
1
1
|
<% @relations.ancestors['docs'].each do |ancestor| %>
|
2
2
|
<li class="list-group-item border-bottom-0">
|
3
|
-
<%= link_to solr_document_path(ancestor[
|
3
|
+
<%= link_to solr_document_path(ancestor[Settings.FIELDS.UNIQUE_KEY]) do %>
|
4
4
|
<%= relations_icon(ancestor, 'pagelines-brands') %>
|
5
|
-
<%= ancestor[
|
5
|
+
<%= ancestor[Settings.FIELDS.TITLE] %>
|
6
6
|
<% end %>
|
7
7
|
</li>
|
8
8
|
<% end %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% @relations.descendants['docs'][0..2].each do |descendant| %>
|
2
2
|
<li class="list-group-item border-bottom-0">
|
3
|
-
<%= link_to solr_document_path(descendant[
|
3
|
+
<%= link_to solr_document_path(descendant[Settings.FIELDS.UNIQUE_KEY]) do %>
|
4
4
|
<%= relations_icon(descendant, 'leaf') %>
|
5
|
-
<%= descendant[
|
5
|
+
<%= descendant[Settings.FIELDS.TITLE] %>
|
6
6
|
<% end %>
|
7
7
|
</li>
|
8
8
|
<% end %>
|
data/babel.config.json
ADDED
data/bin/coverage.rb
CHANGED
@@ -27,8 +27,8 @@ class SimpleCovHelper
|
|
27
27
|
results = SimpleCov::ResultMerger.merge_results(*results)
|
28
28
|
results.format!
|
29
29
|
covered_percent = results.covered_percent.round(2)
|
30
|
-
return unless covered_percent < SimpleCov.minimum_coverage
|
31
|
-
$stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage
|
30
|
+
return unless covered_percent < SimpleCov.minimum_coverage
|
31
|
+
$stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage)
|
32
32
|
Kernel.exit SimpleCov::ExitCodes::MINIMUM_COVERAGE
|
33
33
|
end
|
34
34
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# New GeoBlacklight v3.3 Solr field mappings
|
2
|
+
FIELDS:
|
3
|
+
:IDENTIFIER: 'dc_identifier_s'
|
4
|
+
:LANGUAGE: 'dc_language_s'
|
5
|
+
:LAYER_MODIFIED: 'layer_modified_dt'
|
6
|
+
:OVERLAP_FIELD: 'solr_bboxtype'
|
7
|
+
:SOURCE: 'dc_source_sm'
|
8
|
+
:SUPPRESSED: 'suppressed_b'
|
9
|
+
:TYPE: 'dc_type_s'
|
10
|
+
:UNIQUE_KEY: 'layer_slug_s'
|
@@ -64,6 +64,7 @@ en:
|
|
64
64
|
data_dictionary: 'Documentation'
|
65
65
|
services: 'Web services'
|
66
66
|
services_close: 'Close'
|
67
|
+
tms: 'Tile Map Service'
|
67
68
|
relations:
|
68
69
|
ancestor: 'Source Datasets'
|
69
70
|
descendant: 'Derived Datasets'
|
@@ -104,6 +105,9 @@ en:
|
|
104
105
|
tiled_map_layer:
|
105
106
|
title: ArcGIS Tiled Map Layer
|
106
107
|
content: An ArcGIS Tiled Map Layer Service displays set of web-accessible tiles that reside on a server.
|
108
|
+
tms:
|
109
|
+
title: Tile Map Service
|
110
|
+
content: A Tile Map Service displays georeferenced map tiles as an image on a map.
|
107
111
|
wms:
|
108
112
|
title: Web Map Service (WMS)
|
109
113
|
content: A Web Map Service displays a geospatial dataset as map images.
|
data/geoblacklight.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_rubygems_version = '>= 2.5.2'
|
21
21
|
|
22
|
-
spec.add_dependency 'rails', '>= 5.2.4', '< 6.
|
22
|
+
spec.add_dependency 'rails', '>= 5.2.4', '< 6.2'
|
23
23
|
spec.add_dependency 'blacklight', '~> 7.0'
|
24
24
|
spec.add_dependency 'config'
|
25
25
|
spec.add_dependency 'faraday', '~> 1.0'
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency 'geo_combine', '~> 0.4'
|
30
30
|
spec.add_dependency 'mime-types'
|
31
31
|
spec.add_dependency 'handlebars_assets'
|
32
|
-
spec.add_dependency '
|
32
|
+
spec.add_dependency 'rgeo-geojson'
|
33
33
|
|
34
34
|
spec.add_development_dependency 'solr_wrapper'
|
35
35
|
spec.add_development_dependency 'rails-controller-testing'
|
@@ -39,8 +39,9 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_development_dependency 'webdrivers'
|
40
40
|
spec.add_development_dependency 'factory_bot_rails'
|
41
41
|
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
42
|
-
spec.add_development_dependency '
|
43
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
42
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
44
43
|
spec.add_development_dependency 'foreman'
|
45
|
-
spec.add_development_dependency '
|
44
|
+
spec.add_development_dependency 'rubocop', '~> 1.10'
|
45
|
+
spec.add_development_dependency 'rubocop-rails', '~> 2.9'
|
46
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
|
46
47
|
end
|
data/jest.config.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
const util = require('util');
|
2
|
+
const exec = util.promisify(require('child_process').exec);
|
3
|
+
|
4
|
+
module.exports = async () => {
|
5
|
+
console.log('Getting asset pipeline lookup path from Rails');
|
6
|
+
const { stdout, stderr } = await exec('bundle exec rake geoblacklight:asset_paths');
|
7
|
+
if (stderr) {
|
8
|
+
console.error(stderr);
|
9
|
+
}
|
10
|
+
const paths = stdout.trim().split('\n');
|
11
|
+
return {
|
12
|
+
moduleDirectories: [
|
13
|
+
'node_modules',
|
14
|
+
'spec/javascripts',
|
15
|
+
...paths,
|
16
|
+
],
|
17
|
+
rootDir: './',
|
18
|
+
setupFilesAfterEnv: [
|
19
|
+
'<rootDir>/setupJest.js',
|
20
|
+
],
|
21
|
+
testMatch: [
|
22
|
+
'<rootDir>/spec/javascripts/**/*_spec.js',
|
23
|
+
],
|
24
|
+
};
|
25
|
+
};
|
@@ -29,7 +29,7 @@ class CatalogController < ApplicationController
|
|
29
29
|
#
|
30
30
|
config.default_document_solr_params = {
|
31
31
|
:qt => 'document',
|
32
|
-
:q =>
|
32
|
+
:q => "{!raw f=#{Settings.FIELDS.UNIQUE_KEY} v=$id}"
|
33
33
|
}
|
34
34
|
|
35
35
|
|
@@ -97,6 +97,7 @@ class CatalogController < ApplicationController
|
|
97
97
|
config.add_facet_field Settings.FIELDS.RIGHTS, label: 'Access', limit: 8, partial: "icon_facet"
|
98
98
|
config.add_facet_field Settings.FIELDS.GEOM_TYPE, label: 'Data type', limit: 8, partial: "icon_facet"
|
99
99
|
config.add_facet_field Settings.FIELDS.FILE_FORMAT, :label => 'Format', :limit => 8
|
100
|
+
config.add_facet_field Settings.FIELDS.SOURCE, show: false
|
100
101
|
|
101
102
|
# Have BL send all facet field names to Solr, which has been the default
|
102
103
|
# previously. Simply remove these lines if you'd rather use Solr request
|
@@ -21,24 +21,31 @@ OVERLAP_RATIO_BOOST: '2'
|
|
21
21
|
|
22
22
|
# Solr field mappings
|
23
23
|
FIELDS:
|
24
|
+
:CREATOR: 'dc_creator_sm'
|
25
|
+
:DESCRIPTION: 'dc_description_s'
|
24
26
|
:FILE_FORMAT: 'dc_format_s'
|
27
|
+
:GEOM_TYPE: 'layer_geom_type_s'
|
25
28
|
:GEOMETRY: 'solr_geom'
|
26
|
-
:
|
27
|
-
:
|
29
|
+
:IDENTIFIER: 'dc_identifier_s'
|
30
|
+
:ISSUED: 'dct_issued_s'
|
31
|
+
:LANGUAGE: 'dc_language_s'
|
32
|
+
:LAYER_MODIFIED: 'layer_modified_dt'
|
33
|
+
:OVERLAP_FIELD: 'solr_bboxtype'
|
34
|
+
:PART_OF: 'dct_isPartOf_sm'
|
35
|
+
:PUBLISHER: 'dc_publisher_s'
|
28
36
|
:PROVENANCE: 'dct_provenance_s'
|
29
|
-
:
|
37
|
+
:REFERENCES: 'dct_references_s'
|
38
|
+
:RIGHTS: 'dc_rights_s'
|
30
39
|
:SPATIAL_COVERAGE: 'dct_spatial_sm'
|
31
40
|
:SUBJECT: 'dc_subject_sm'
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:CREATOR: 'dc_creator_sm'
|
35
|
-
:DESCRIPTION: 'dc_description_s'
|
36
|
-
:PUBLISHER: 'dc_publisher_s'
|
37
|
-
:PART_OF: 'dct_isPartOf_sm'
|
41
|
+
:SOURCE: 'dc_source_sm'
|
42
|
+
:SUPPRESSED: 'suppressed_b'
|
38
43
|
:TEMPORAL: 'dct_temporal_sm'
|
39
44
|
:TITLE: 'dc_title_s'
|
40
|
-
:
|
41
|
-
:
|
45
|
+
:TYPE: 'dc_type_s'
|
46
|
+
:UNIQUE_KEY: 'layer_slug_s'
|
47
|
+
:WXS_IDENTIFIER: 'layer_id_s'
|
48
|
+
:YEAR: 'solr_year_i'
|
42
49
|
|
43
50
|
# Institution deployed at
|
44
51
|
INSTITUTION: 'Stanford'
|
@@ -62,6 +69,7 @@ USE_GEOM_FOR_RELATIONS_ICON: false
|
|
62
69
|
# Web services shown in tool panel
|
63
70
|
WEBSERVICES_SHOWN:
|
64
71
|
- 'wms'
|
72
|
+
- 'tms'
|
65
73
|
- 'wfs'
|
66
74
|
- 'iiif'
|
67
75
|
- 'feature_layer'
|
@@ -122,4 +130,5 @@ HELP_TEXT:
|
|
122
130
|
- 'index_map'
|
123
131
|
- 'tiled_map_layer'
|
124
132
|
- 'wms'
|
133
|
+
- 'tms'
|
125
134
|
- 'oembed'
|
data/lib/geoblacklight.rb
CHANGED
@@ -6,9 +6,9 @@ module Geoblacklight
|
|
6
6
|
require 'geoblacklight/bounding_box'
|
7
7
|
require 'geoblacklight/catalog_helper_override'
|
8
8
|
require 'geoblacklight/constants'
|
9
|
-
# require 'geoblacklight/controller_override'
|
10
9
|
require 'geoblacklight/exceptions'
|
11
10
|
require 'geoblacklight/geoblacklight_helper_behavior'
|
11
|
+
require 'geoblacklight/geometry'
|
12
12
|
require 'geoblacklight/view_helper_override'
|
13
13
|
require 'geoblacklight/item_viewer'
|
14
14
|
require 'geoblacklight/wms_layer'
|
@@ -36,7 +36,6 @@ module Geoblacklight
|
|
36
36
|
require 'geoblacklight/relation/relation_response'
|
37
37
|
|
38
38
|
def self.inject!
|
39
|
-
# CatalogController.send(:include, Geoblacklight::ControllerOverride)
|
40
39
|
CatalogController.send(:include, Geoblacklight::CatalogHelperOverride)
|
41
40
|
CatalogController.send(:include, Geoblacklight::ViewHelperOverride)
|
42
41
|
CatalogController.send(:helper, Geoblacklight::ViewHelperOverride) unless
|
@@ -28,7 +28,7 @@ module Geoblacklight
|
|
28
28
|
# @param [String] bbox as "W S E N"
|
29
29
|
# @return [Geoblacklight::BoundingBox]
|
30
30
|
def self.from_rectangle(rectangle)
|
31
|
-
rectangle_array = rectangle.split
|
31
|
+
rectangle_array = rectangle.split
|
32
32
|
message = 'Bounding box should be a string in Solr rectangle syntax e.g."W S E N"'
|
33
33
|
fail Geoblacklight::Exceptions::WrongBoundingBoxFormat, message if rectangle_array.count != 4
|
34
34
|
new(
|
@@ -16,6 +16,7 @@ module Geoblacklight
|
|
16
16
|
wcs: 'http://www.opengis.net/def/serviceType/ogc/wcs',
|
17
17
|
wfs: 'http://www.opengis.net/def/serviceType/ogc/wfs',
|
18
18
|
wms: 'http://www.opengis.net/def/serviceType/ogc/wms',
|
19
|
+
tms: 'https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification',
|
19
20
|
hgl: 'http://schema.org/DownloadAction',
|
20
21
|
feature_layer: 'urn:x-esri:serviceType:ArcGIS#FeatureLayer',
|
21
22
|
tiled_map_layer: 'urn:x-esri:serviceType:ArcGIS#TiledMapLayer',
|
@@ -9,7 +9,7 @@ module Geoblacklight
|
|
9
9
|
width: 2000, height: 2000 }.freeze
|
10
10
|
|
11
11
|
def initialize(document, options = {})
|
12
|
-
bbox_wsen = document.
|
12
|
+
bbox_wsen = document.geometry.bounding_box
|
13
13
|
request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[:layer_id_s], bbox: bbox_wsen)
|
14
14
|
super(document, {
|
15
15
|
type: 'kmz',
|
data/lib/geoblacklight/engine.rb
CHANGED
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'rgeo'
|
3
|
+
require 'rgeo-geojson'
|
4
|
+
|
5
|
+
module Geoblacklight
|
6
|
+
# Transforms and parses geometry expressed in WKT or CSW WKT ENVELOPE syntax
|
7
|
+
class Geometry
|
8
|
+
attr_reader :geom
|
9
|
+
|
10
|
+
# @param [String] geom WKT or WKT ENVELOPE syntax formatted string
|
11
|
+
def initialize(geom)
|
12
|
+
@geom = geom
|
13
|
+
end
|
14
|
+
|
15
|
+
# Convert geometry to GeoJSON
|
16
|
+
# @return [String]
|
17
|
+
def geojson
|
18
|
+
obj = factory.parse_wkt(geometry_as_wkt)
|
19
|
+
RGeo::GeoJSON.encode(obj).to_json
|
20
|
+
rescue StandardError
|
21
|
+
Geoblacklight.logger.warn "Geometry is not valid: #{geom}"
|
22
|
+
default_extent
|
23
|
+
end
|
24
|
+
|
25
|
+
# Generate a wsen bounding box from the geometry
|
26
|
+
# @return [String] bounding box as comma delimited wsen "w, s, e, n"
|
27
|
+
def bounding_box
|
28
|
+
obj = factory.parse_wkt(geometry_as_wkt)
|
29
|
+
|
30
|
+
# Get the minimum bounding box for the geometry as a Polygon
|
31
|
+
bbox = obj.envelope
|
32
|
+
|
33
|
+
# Return as wsen string
|
34
|
+
minx = bbox.coordinates[0][0][0]
|
35
|
+
miny = bbox.coordinates[0][0][1]
|
36
|
+
maxx = bbox.coordinates[0][1][0]
|
37
|
+
maxy = bbox.coordinates[0][2][1]
|
38
|
+
"#{minx}, #{miny}, #{maxx}, #{maxy}"
|
39
|
+
rescue RGeo::Error::ParseError
|
40
|
+
Geoblacklight.logger.warn "Error parsing geometry: #{geom}"
|
41
|
+
default_extent
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
# Default extent as GeoJSON
|
47
|
+
# @return [String]
|
48
|
+
def default_extent
|
49
|
+
{
|
50
|
+
'type' => 'Polygon',
|
51
|
+
'coordinates' => [
|
52
|
+
[
|
53
|
+
[-180.0, 90.0], [-180.0, -90.0], [180.0, -90.0], [180.0, 90.0], [-180.0, 90.0]
|
54
|
+
]
|
55
|
+
]
|
56
|
+
}.to_json
|
57
|
+
end
|
58
|
+
|
59
|
+
# Convert WKT ENVELOPE string to WKT POLYGON string
|
60
|
+
# @return [String]
|
61
|
+
def envelope_to_polygon
|
62
|
+
exp = /^\s*ENVELOPE\(
|
63
|
+
\s*([-.\d]+)\s*,
|
64
|
+
\s*([-.\d]+)\s*,
|
65
|
+
\s*([-.\d]+)\s*,
|
66
|
+
\s*([-.\d]+)\s*
|
67
|
+
\)\s*$/x # uses 'x' option for free-spacing mode
|
68
|
+
bbox_match = exp.match(geom)
|
69
|
+
minx, maxx, maxy, miny = bbox_match.captures
|
70
|
+
"POLYGON ((#{minx} #{maxy}, #{minx} #{miny}, #{maxx} #{miny}, #{maxx} #{maxy}, #{minx} #{maxy}))"
|
71
|
+
end
|
72
|
+
|
73
|
+
def factory
|
74
|
+
@factory ||= RGeo::Cartesian.factory
|
75
|
+
end
|
76
|
+
|
77
|
+
# Return geometry as valid WKT string
|
78
|
+
# @return [String]
|
79
|
+
def geometry_as_wkt
|
80
|
+
return geom unless geom.match?(/ENVELOPE/)
|
81
|
+
|
82
|
+
envelope_to_polygon
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -47,8 +47,12 @@ module Geoblacklight
|
|
47
47
|
@references.oembed
|
48
48
|
end
|
49
49
|
|
50
|
+
def tms
|
51
|
+
@references.tms
|
52
|
+
end
|
53
|
+
|
50
54
|
def viewer_preference
|
51
|
-
[oembed, index_map, wms, iiif, tiled_map_layer, dynamic_map_layer,
|
55
|
+
[oembed, index_map, tms, wms, iiif, tiled_map_layer, dynamic_map_layer,
|
52
56
|
image_map_layer, feature_layer].compact.map(&:to_hash).first
|
53
57
|
end
|
54
58
|
end
|
@@ -55,13 +55,7 @@ module Geoblacklight
|
|
55
55
|
return response.body unless response.nil? || response.status == 404
|
56
56
|
Geoblacklight.logger.error "Could not reach #{@reference.endpoint}"
|
57
57
|
''
|
58
|
-
rescue Faraday::ConnectionFailed => error
|
59
|
-
Geoblacklight.logger.error error.inspect
|
60
|
-
''
|
61
|
-
rescue Faraday::TimeoutError => error
|
62
|
-
Geoblacklight.logger.error error.inspect
|
63
|
-
''
|
64
|
-
rescue OpenSSL::SSL::SSLError => error
|
58
|
+
rescue Faraday::ConnectionFailed, Faraday::TimeoutError, OpenSSL::SSL::SSLError => error
|
65
59
|
Geoblacklight.logger.error error.inspect
|
66
60
|
''
|
67
61
|
end
|
@@ -8,8 +8,8 @@ module Geoblacklight
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def create_search_params
|
11
|
-
{ fq: ["{!join from=#{Settings.FIELDS.SOURCE} to
|
12
|
-
fl: [Settings.FIELDS.TITLE,
|
11
|
+
{ fq: ["{!join from=#{Settings.FIELDS.SOURCE} to=#{Settings.FIELDS.UNIQUE_KEY}}#{Settings.FIELDS.UNIQUE_KEY}:#{@search_id}"],
|
12
|
+
fl: [Settings.FIELDS.TITLE, Settings.FIELDS.UNIQUE_KEY, Settings.FIELDS.GEOM_TYPE] }
|
13
13
|
end
|
14
14
|
|
15
15
|
def execute_query
|
@@ -9,7 +9,7 @@ module Geoblacklight
|
|
9
9
|
|
10
10
|
def create_search_params
|
11
11
|
{ fq: "#{Settings.FIELDS.SOURCE}:#{@search_id}",
|
12
|
-
fl: [Settings.FIELDS.TITLE,
|
12
|
+
fl: [Settings.FIELDS.TITLE, Settings.FIELDS.UNIQUE_KEY, Settings.FIELDS.GEOM_TYPE] }
|
13
13
|
end
|
14
14
|
|
15
15
|
def execute_query
|
@@ -25,10 +25,7 @@ module Geoblacklight
|
|
25
25
|
request.options.timeout = Settings.TIMEOUT_WMS
|
26
26
|
request.options.open_timeout = Settings.TIMEOUT_WMS
|
27
27
|
end
|
28
|
-
rescue Faraday::ConnectionFailed => error
|
29
|
-
Geoblacklight.logger.error error.inspect
|
30
|
-
{ error: error.inspect }
|
31
|
-
rescue Faraday::TimeoutError => error
|
28
|
+
rescue Faraday::ConnectionFailed, Faraday::TimeoutError => error
|
32
29
|
Geoblacklight.logger.error error.inspect
|
33
30
|
{ error: error.inspect }
|
34
31
|
end
|