geoblacklight 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +0 -5
- data/.travis.yml +3 -0
- data/README.md +24 -76
- data/Rakefile +2 -3
- data/app/assets/javascripts/geoblacklight/downloaders.js +1 -0
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +51 -0
- data/app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js +32 -0
- data/app/assets/javascripts/geoblacklight/modules/download.js +7 -41
- data/app/controllers/download_controller.rb +19 -1
- data/app/controllers/wms_controller.rb +1 -1
- data/app/views/catalog/_show_sidebar.html.erb +25 -13
- data/app/views/download/hgl.html.erb +25 -0
- data/config/locales/geoblacklight.en.yml +1 -0
- data/lib/generators/geoblacklight/install_generator.rb +3 -2
- data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -0
- data/lib/geoblacklight.rb +2 -0
- data/lib/geoblacklight/constants.rb +2 -1
- data/lib/geoblacklight/download/hgl_download.rb +17 -0
- data/lib/geoblacklight/engine.rb +1 -0
- data/lib/geoblacklight/solr_document.rb +4 -0
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/wms_layer.rb +31 -31
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +26 -24
- data/lib/tasks/geoblacklight.rake +2 -2
- data/spec/controllers/download_controller_spec.rb +13 -2
- data/spec/features/download_layer_spec.rb +18 -3
- data/spec/features/home_page_spec.rb +3 -3
- data/spec/features/layer_preview_spec.rb +3 -3
- data/spec/features/split_view.html.erb_spec.rb +2 -4
- data/spec/fixtures/solr_documents/actual-papermap1.json +26 -0
- data/spec/fixtures/solr_documents/actual-point1.json +27 -0
- data/spec/fixtures/solr_documents/actual-polygon1.json +26 -0
- data/spec/fixtures/solr_documents/actual-raster1.json +44 -0
- data/spec/fixtures/{test-dct-references6.json → solr_documents/harvard_raster.json} +2 -6
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +38 -0
- data/spec/fixtures/solr_documents/public_polygon_mit.json +47 -0
- data/spec/fixtures/solr_documents/restricted-line.json +43 -0
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +14 -0
- data/spec/lib/geoblacklight/solr_document_spec.rb +20 -0
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +5 -5
- data/spec/lib/geoblacklight/wms_layer_spec.rb +4 -4
- metadata +25 -22
- data/spec/features/dct_references_spec.rb +0 -77
- data/spec/fixtures/test-dct-references1.json +0 -38
- data/spec/fixtures/test-dct-references2.json +0 -41
- data/spec/fixtures/test-dct-references3.json +0 -45
- data/spec/fixtures/test-dct-references4.json +0 -60
- data/spec/fixtures/test-dct-references5.json +0 -57
- data/spec/fixtures/test-dct-references7.json +0 -42
- data/spec/fixtures/test-dct-references8.json +0 -46
- data/spec/support/dct_references_generate.rb +0 -100
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"uuid": "http://purl.stanford.edu/dp018hs9766",
|
3
|
+
"dc_identifier_s": "http://purl.stanford.edu/dp018hs9766",
|
4
|
+
"dc_title_s": "1-Meter Shaded Relief Multibeam Bathymetry Image (Color): Elkhorn Slough, California, 2005",
|
5
|
+
"dc_description_s": "This layer is a 10-color shaded relief GeoTIFF that contains high-resolution bathymetric data collected from the Elkhorn Slough region of Monterey Bay, California. The survey for Elkhorn Slough was conducted 8/12/2005 - 8/15/2005. Elkhorn Slough, one of the largest remaining coastal wetlands in California, has been directly subjected to tidal scour since the opening of Moss Landing Harbor in 1946. This erosion endangers the habitat of several rare and endangered species and disrupts the wetland ecosystem as a whole. In 2003, the Seafloor Mapping Lab of California State University, Monterey Bay created the most detailed bathymetry model of the Slough to date using a combination of multi-beam sonar, single-beam sonar and aerial photography. This layer was created as part of the California Seafloor Mapping Project.This project was conducted to determine changes in the pattern of erosion and deposition in Elkhorn Slough since surveys conducted in 1993, 2001 and 2003. Marine data offered here represent the efforts of a comprehensive state waters mapping program for California launched by the California State Coastal Conservancy, Ocean Protection Council, Department of Fish and Game, and the NOAA National Marine Sanctuary Program. The ultimate goal is the creation of a high-resolution 1:24,000 scale geologic and habitat base map series covering all of California's 14,500 km2 state waters out to the 3 mile limit, and support of the state's Marine Life Protection Act Initiative (MLPA) goal to create a statewide network of Marine Protected Areas (MPAs). This statewide project requires, involves and leverages expertise from industry, resource management agencies and academia. The tiered mapping campaign involves the use of state-of-the-art sonar, LIDAR (aerial laser) and video seafloor mapping technologies; computer aided classification and visualization; expert geologic and habitat interpretations codified into strip maps spanning California's land/sea boundary; and the creation of an online, publicly accessible data repository for the dissemination of all mapping products.\n",
|
6
|
+
"dc_rights_s": "Restricted",
|
7
|
+
"dct_provenance_s": "Stanford",
|
8
|
+
"dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/dp018hs9766\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:dp018hs9766/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/dp018hs9766.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:dp018hs9766/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:dp018hs9766/default.html\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://kurma-podd1.stanford.edu/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://kurma-podd1.stanford.edu/geoserver/wms\"}",
|
9
|
+
"layer_id_s": "druid:dp018hs9766",
|
10
|
+
"layer_slug_s": "stanford-dp018hs9766",
|
11
|
+
"layer_geom_type_s": "Raster",
|
12
|
+
"layer_modified_dt": "2014-12-03T02:15:20Z",
|
13
|
+
"dc_format_s": "GeoTIFF",
|
14
|
+
"dc_language_s": "English",
|
15
|
+
"dc_type_s": "Dataset",
|
16
|
+
"dc_publisher_s": "Seafloor Mapping Lab",
|
17
|
+
"dc_creator_sm": [
|
18
|
+
"Seafloor Mapping Lab"
|
19
|
+
],
|
20
|
+
"dc_subject_sm": [
|
21
|
+
"Continental margins",
|
22
|
+
"Multibeam mapping",
|
23
|
+
"Elevation",
|
24
|
+
"Imagery and Base Maps",
|
25
|
+
"Inland Waters"
|
26
|
+
],
|
27
|
+
"dct_issued_s": "2006",
|
28
|
+
"dct_temporal_sm": [
|
29
|
+
"2005"
|
30
|
+
],
|
31
|
+
"dct_spatial_sm": [
|
32
|
+
"Elkhorn Slough (Calif.)",
|
33
|
+
"Monterey Bay (Calif.)"
|
34
|
+
],
|
35
|
+
"dc_relation_sm": [
|
36
|
+
"http://sws.geonames.org/5346182/about.rdf",
|
37
|
+
"http://sws.geonames.org/5374363/about.rdf"
|
38
|
+
],
|
39
|
+
"georss_box_s": "36.8085911 -121.7948738 36.8606925 -121.7389503",
|
40
|
+
"georss_polygon_s": "36.8085911 -121.7948738 36.8606925 -121.7948738 36.8606925 -121.7389503 36.8085911 -121.7389503 36.8085911 -121.7948738",
|
41
|
+
"solr_geom": "ENVELOPE(-121.7948738, -121.7389503, 36.8606925, 36.8085911)",
|
42
|
+
"solr_bbox": "-121.7948738 36.8085911 -121.7389503 36.8606925",
|
43
|
+
"solr_year_i": 2005
|
44
|
+
}
|
@@ -26,7 +26,7 @@
|
|
26
26
|
],
|
27
27
|
"dc_title_s": "Saint Petersburg Region, Russia, 1834 (Raster Image)",
|
28
28
|
"dc_type_s": "Dataset",
|
29
|
-
"dct_references_s": "{\"http://schema.org/
|
29
|
+
"dct_references_s": "{\"http://schema.org/DownloadAction\":\"http://hgl.harvard.edu:8080/HGL/HGLOpenDelivery\",\"http://www.opengis.net/def/serviceType/ogc/wcs\":\"http://hgl.harvard.edu:8080/geoserver/wcs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://hgl.harvard.edu:8080/geoserver/wms\"}",
|
30
30
|
"dct_spatial_sm": [
|
31
31
|
"Russia Saint Petersburg"
|
32
32
|
],
|
@@ -42,11 +42,7 @@
|
|
42
42
|
"layer_geom_type_s": "Raster",
|
43
43
|
"layer_modified_dt": "2014-05-27T18:09:36Z",
|
44
44
|
"solr_bbox": "30.013108 59.669749 30.875309 60.041712",
|
45
|
-
"solr_ne_pt": "60.041712,30.875309",
|
46
|
-
"solr_sw_pt": "59.669749,30.013108",
|
47
45
|
"solr_geom": "ENVELOPE(30.013108, 30.875309, 60.041712, 59.669749)",
|
48
46
|
"solr_year_i": 1834,
|
49
|
-
"solr_issued_dt": "2000-01-01T00:00:00Z"
|
50
|
-
"solr_wms_url": "http://hgl.harvard.edu:8080/geoserver/wms",
|
51
|
-
"solr_wcs_url": "http://hgl.harvard.edu:8080/geoserver/wcs"
|
47
|
+
"solr_issued_dt": "2000-01-01T00:00:00Z"
|
52
48
|
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"uuid": "http://arks.princeton.edu/ark:/88435/02870w62c",
|
3
|
+
"dc_description_s": "Partly colored. Relief shown pictorially. Shows administrative divisions. From Thomas Jefferys's The American atlas, or, A geographical description of the whole continent of America (London : Printed by R. Sayer and Bennett, 1778). Insets: A chart of the mouth of Hudson's River, from Sandy Hook to New York. A plan of the city of New York. Plan of Amboy, with its environs, from an actual survey.",
|
4
|
+
"dc_format_s": "Raster",
|
5
|
+
"dc_identifier_s": "http://arks.princeton.edu/ark:/88435/02870w62c",
|
6
|
+
"dc_language_s": "English",
|
7
|
+
"dc_publisher_s": "London, Robt. Sayer & John Bennett",
|
8
|
+
"dc_rights_s": "Public",
|
9
|
+
"dc_subject_sm": [
|
10
|
+
"New York (State)‒Maps",
|
11
|
+
"New Jersey‒Maps"
|
12
|
+
],
|
13
|
+
"dc_title_s": "The provinces of New York and New Jersey, with part of Pensilvania, and the Province of Quebec : drawn by Major Holland, Surveyor General, of the Northern District in America. Corrected and improved, from the original materials, by Governr. Pownall, Member of Parliament, 1776",
|
14
|
+
"dc_type_s": "Dataset",
|
15
|
+
"dc_creator_sm": [
|
16
|
+
"Rogers, Henry Darwin",
|
17
|
+
"Pownall, Thomas"
|
18
|
+
],
|
19
|
+
"dct_references_s": "{\"http://schema.org/url\":\"http://arks.princeton.edu/ark:/88435/02870w62c\",\"http://schema.org/thumbnailUrl\":\"http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/full/50,/0/default.jpg\",\"http://iiif.io/api/image\":\"http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/info.json\"}",
|
20
|
+
"dct_spatial_sm": [
|
21
|
+
"New York (State)",
|
22
|
+
"New Jersey",
|
23
|
+
"Pennsylvania"
|
24
|
+
],
|
25
|
+
"dct_temporal_sm": [
|
26
|
+
"1778"
|
27
|
+
],
|
28
|
+
"dct_issued_s": "1778",
|
29
|
+
"dct_provenance_s": "Princeton",
|
30
|
+
"georss_box_s": "38.6693 -76.3394 46.5798 -72.1916",
|
31
|
+
"layer_slug_s": "princeton-02870w62c",
|
32
|
+
"layer_id_s": "02870w62c",
|
33
|
+
"layer_geom_type_s": "Raster",
|
34
|
+
"layer_modified_dt": "2014-10-09T18:00:18Z",
|
35
|
+
"solr_bbox": "-76.3394 38.6693 -72.1916 46.5798",
|
36
|
+
"solr_geom": "ENVELOPE(-76.3394, -72.1916, 46.5798, 38.6693)",
|
37
|
+
"solr_year_i": 1778
|
38
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
{
|
2
|
+
"uuid": "urn:arrowsmith.mit.edu:MIT.SDE_DATA.US_MA_E25ZCTA5DCT_2000",
|
3
|
+
"dc_format_s": "Shapefile",
|
4
|
+
"dc_identifier_s": "urn:arrowsmith.mit.edu:MIT.SDE_DATA.US_MA_E25ZCTA5DCT_2000",
|
5
|
+
"dc_language_s": "English",
|
6
|
+
"dc_publisher_s": "U.S. Census Bureau",
|
7
|
+
"dc_rights_s": "Public",
|
8
|
+
"dc_subject_sm": [
|
9
|
+
"polygon",
|
10
|
+
"Zip",
|
11
|
+
"Code",
|
12
|
+
"Tabulation",
|
13
|
+
"Areas",
|
14
|
+
"demographics",
|
15
|
+
"population",
|
16
|
+
"census",
|
17
|
+
"boundaries",
|
18
|
+
"ZCTAs",
|
19
|
+
"zip",
|
20
|
+
"codes"
|
21
|
+
],
|
22
|
+
"dc_title_s": "Massachusetts (ZCTA - 5 digit zip code tabulation area, 2000)",
|
23
|
+
"dc_type_s": "Dataset",
|
24
|
+
"dct_references_s": "{\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://arrowsmith.mit.edu:8080/geoserver/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://arrowsmith.mit.edu:8080/geoserver/wms\"}",
|
25
|
+
"dct_spatial_sm": [
|
26
|
+
"Massachusetts MA USA"
|
27
|
+
],
|
28
|
+
"dct_temporal_sm": [
|
29
|
+
"2000"
|
30
|
+
],
|
31
|
+
"dct_issued_s": "2000",
|
32
|
+
"dct_provenance_s": "MIT",
|
33
|
+
"georss_box_s": "41.230345 -73.533237 42.888068 -69.898565",
|
34
|
+
"georss_polygon_s": "42.888068 -73.533237 42.888068 -69.898565 41.230345 -69.898565 41.230345 -73.533237 42.888068 -73.533237",
|
35
|
+
"layer_slug_s": "mit-us-ma-e25zcta5dct-2000",
|
36
|
+
"layer_id_s": "sde:SDE_DATA.US_MA_E25ZCTA5DCT_2000",
|
37
|
+
"layer_geom_type_s": "Polygon",
|
38
|
+
"layer_modified_dt": "2014-05-27T18:09:34Z",
|
39
|
+
"solr_bbox": "-73.533237 41.230345 -69.898565 42.888068",
|
40
|
+
"solr_ne_pt": "42.888068,-69.898565",
|
41
|
+
"solr_sw_pt": "41.230345,-73.533237",
|
42
|
+
"solr_geom": "ENVELOPE(-73.533237, -69.898565, 42.888068, 41.230345)",
|
43
|
+
"solr_year_i": 2000,
|
44
|
+
"solr_issued_dt": "2000-01-01T00:00:00Z",
|
45
|
+
"solr_wms_url": "http://arrowsmith.mit.edu:8080/geoserver/wms",
|
46
|
+
"solr_wfs_url": "http://arrowsmith.mit.edu:8080/geoserver/wfs"
|
47
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"uuid": "http://purl.stanford.edu/cg357zz0321",
|
3
|
+
"dc_identifier_s": "http://purl.stanford.edu/cg357zz0321",
|
4
|
+
"dc_title_s": "10 Meter Countours: Russian River Basin, California",
|
5
|
+
"dc_description_s": "This line shapefile contains contours that were derived from a mosiac of 10 meter digital elevation models for the extent of the Russian River basin, located in Sonoma and Mendocino Counties, California.This layer can be used for watershed analysis and planning in the Russian River region of California.",
|
6
|
+
"dc_rights_s": "Restricted",
|
7
|
+
"dct_provenance_s": "Stanford",
|
8
|
+
"dct_references_s": "{\"http://schema.org/url\":\"http://purl.stanford.edu/cg357zz0321\",\"http://schema.org/downloadUrl\":\"http://stacks.stanford.edu/file/druid:cg357zz0321/data.zip\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/cg357zz0321.mods\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cg357zz0321/iso19139.xml\",\"http://www.w3.org/1999/xhtml\":\"http://opengeometadata.stanford.edu/metadata/edu.stanford.purl/druid:cg357zz0321/default.html\",\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://geowebservices-restricted.stanford.edu/geoserver/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://geowebservices-restricted.stanford.edu/geoserver/wms\"}",
|
9
|
+
"layer_id_s": "druid:cg357zz0321",
|
10
|
+
"layer_slug_s": "stanford-cg357zz0321",
|
11
|
+
"layer_geom_type_s": "Line",
|
12
|
+
"layer_modified_dt": "2014-12-03T01:20:46Z",
|
13
|
+
"dc_format_s": "Shapefile",
|
14
|
+
"dc_language_s": "English",
|
15
|
+
"dc_type_s": "Dataset",
|
16
|
+
"dc_publisher_s": "Circuit Rider Productions",
|
17
|
+
"dc_creator_sm": [
|
18
|
+
"United States. National Oceanic and Atmospheric Administration",
|
19
|
+
"Circuit Rider Productions"
|
20
|
+
],
|
21
|
+
"dc_subject_sm": [
|
22
|
+
"Contours (Cartography)",
|
23
|
+
"Elevation",
|
24
|
+
"Inland Waters"
|
25
|
+
],
|
26
|
+
"dct_issued_s": "2003",
|
27
|
+
"dct_temporal_sm": [
|
28
|
+
"2002"
|
29
|
+
],
|
30
|
+
"dct_spatial_sm": [
|
31
|
+
"Sonoma County (Calif.)",
|
32
|
+
"Mendocino County (Calif.)"
|
33
|
+
],
|
34
|
+
"dc_relation_sm": [
|
35
|
+
"http://sws.geonames.org/5397100/about.rdf",
|
36
|
+
"http://sws.geonames.org/5372163/about.rdf"
|
37
|
+
],
|
38
|
+
"georss_box_s": "38.302994 -123.387366 39.398403 -122.52958",
|
39
|
+
"georss_polygon_s": "38.302994 -123.387366 39.398403 -123.387366 39.398403 -122.52958 38.302994 -122.52958 38.302994 -123.387366",
|
40
|
+
"solr_geom": "ENVELOPE(-123.387366, -122.52958, 39.398403, 38.302994)",
|
41
|
+
"solr_bbox": "-123.387366 38.302994 -122.52958 39.398403",
|
42
|
+
"solr_year_i": 2002
|
43
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HglDownload do
|
4
|
+
let(:document) { SolrDocument.new(layer_slug_s: 'test', layer_id_s: 'cite:harvard-test') }
|
5
|
+
let(:download) { HglDownload.new(document, 'foo@example.com') }
|
6
|
+
describe '#initialize' do
|
7
|
+
it 'should initialize as an HglDownload object with specific options' do
|
8
|
+
expect(download).to be_an HglDownload
|
9
|
+
options = download.instance_variable_get(:@options)
|
10
|
+
expect(options[:request_params]['LayerName']).to eq 'harvard-test'
|
11
|
+
expect(options[:request_params]['UserEmail']).to eq 'foo@example.com'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -101,6 +101,26 @@ describe Geoblacklight::SolrDocument do
|
|
101
101
|
expect(document.direct_download).to be_nil
|
102
102
|
end
|
103
103
|
end
|
104
|
+
describe 'hgl_download' do
|
105
|
+
describe 'with an hgl download' do
|
106
|
+
let(:document_attributes) {
|
107
|
+
{
|
108
|
+
dct_references_s: {
|
109
|
+
'http://schema.org/DownloadAction' => 'http://example.com/harvard'
|
110
|
+
}.to_json
|
111
|
+
}
|
112
|
+
}
|
113
|
+
it 'should return an hgl download hash' do
|
114
|
+
expect(document.hgl_download[:hgl]).to eq('http://example.com/harvard')
|
115
|
+
end
|
116
|
+
end
|
117
|
+
describe 'without an hgl download' do
|
118
|
+
let(:document_attributes) {{}}
|
119
|
+
it 'should return nil' do
|
120
|
+
expect(document.direct_download).to be_nil
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
104
124
|
describe 'item_viewer' do
|
105
125
|
let(:document_attributes) { {} }
|
106
126
|
it 'is a ItemViewer' do
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe FeatureInfoResponse do
|
4
|
-
let(:response) { FeatureInfoResponse.new(OpenStruct.new(body: '<html><body><table><th>Header1</th><th>Header2</th><td>value1</td><td>value2</td></body></html>', headers: {'content-type' => 'all good'})) }
|
5
|
-
let(:error_response) { FeatureInfoResponse.new({error: 'bad stuff'}) }
|
6
|
-
let(:content_response) { FeatureInfoResponse.new(OpenStruct.new(headers: { 'content-type' => 'text/xml' })) }
|
3
|
+
describe Geoblacklight::FeatureInfoResponse do
|
4
|
+
let(:response) { Geoblacklight::FeatureInfoResponse.new(OpenStruct.new(body: '<html><body><table><th>Header1</th><th>Header2</th><td>value1</td><td>value2</td></body></html>', headers: {'content-type' => 'all good'})) }
|
5
|
+
let(:error_response) { Geoblacklight::FeatureInfoResponse.new({error: 'bad stuff'}) }
|
6
|
+
let(:content_response) { Geoblacklight::FeatureInfoResponse.new(OpenStruct.new(headers: { 'content-type' => 'text/xml' })) }
|
7
7
|
|
8
8
|
describe '#initialize' do
|
9
9
|
it 'should initialize as a FeatureInfoResponse type' do
|
10
|
-
expect(response).to be_an FeatureInfoResponse
|
10
|
+
expect(response).to be_an Geoblacklight::FeatureInfoResponse
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe WmsLayer do
|
3
|
+
describe Geoblacklight::WmsLayer do
|
4
4
|
let(:params) { { 'URL' => 'http://www.example.com/', 'X' => '277' } }
|
5
|
-
let(:wms_layer) { WmsLayer.new(params) }
|
5
|
+
let(:wms_layer) { Geoblacklight::WmsLayer.new(params) }
|
6
6
|
describe '#initialize' do
|
7
7
|
it 'should initialize as a WmsLayer object' do
|
8
|
-
expect(wms_layer).to be_an WmsLayer
|
8
|
+
expect(wms_layer).to be_an Geoblacklight::WmsLayer
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -27,7 +27,7 @@ describe WmsLayer do
|
|
27
27
|
faraday = double('faraday')
|
28
28
|
allow(faraday).to receive(:get)
|
29
29
|
expect(Faraday).to receive(:new).and_return(faraday)
|
30
|
-
WmsLayer.new(params)
|
30
|
+
Geoblacklight::WmsLayer.new(params)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Graves
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-12-
|
14
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: blacklight
|
@@ -263,6 +263,9 @@ files:
|
|
263
263
|
- app/assets/fonts/geoblacklight.ttf
|
264
264
|
- app/assets/fonts/geoblacklight.woff
|
265
265
|
- app/assets/images/blacklight/logo.png
|
266
|
+
- app/assets/javascripts/geoblacklight/downloaders.js
|
267
|
+
- app/assets/javascripts/geoblacklight/downloaders/downloader.js
|
268
|
+
- app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js
|
266
269
|
- app/assets/javascripts/geoblacklight/geoblacklight.js
|
267
270
|
- app/assets/javascripts/geoblacklight/modules.js
|
268
271
|
- app/assets/javascripts/geoblacklight/modules/collapse.js
|
@@ -302,6 +305,7 @@ files:
|
|
302
305
|
- app/views/catalog/_show_sidebar.html.erb
|
303
306
|
- app/views/catalog/_upper_metadata.html.erb
|
304
307
|
- app/views/catalog/index.html.erb
|
308
|
+
- app/views/download/hgl.html.erb
|
305
309
|
- app/views/shared/_header_navbar.html.erb
|
306
310
|
- config/initializers/rails_config.rb
|
307
311
|
- config/jetty.yml
|
@@ -319,6 +323,7 @@ files:
|
|
319
323
|
- lib/geoblacklight/download.rb
|
320
324
|
- lib/geoblacklight/download/geojson_download.rb
|
321
325
|
- lib/geoblacklight/download/geotiff_download.rb
|
326
|
+
- lib/geoblacklight/download/hgl_download.rb
|
322
327
|
- lib/geoblacklight/download/kmz_download.rb
|
323
328
|
- lib/geoblacklight/download/shapefile_download.rb
|
324
329
|
- lib/geoblacklight/engine.rb
|
@@ -334,7 +339,6 @@ files:
|
|
334
339
|
- lib/tasks/geoblacklight.rake
|
335
340
|
- spec/controllers/download_controller_spec.rb
|
336
341
|
- spec/factories/user.rb
|
337
|
-
- spec/features/dct_references_spec.rb
|
338
342
|
- spec/features/download_layer_spec.rb
|
339
343
|
- spec/features/home_page_spec.rb
|
340
344
|
- spec/features/iiif_viewer_spec.rb
|
@@ -344,18 +348,19 @@ files:
|
|
344
348
|
- spec/features/saved_searches_spec.rb
|
345
349
|
- spec/features/search_bar_spec.rb
|
346
350
|
- spec/features/split_view.html.erb_spec.rb
|
347
|
-
- spec/fixtures/
|
348
|
-
- spec/fixtures/
|
349
|
-
- spec/fixtures/
|
350
|
-
- spec/fixtures/
|
351
|
-
- spec/fixtures/
|
352
|
-
- spec/fixtures/
|
353
|
-
- spec/fixtures/
|
354
|
-
- spec/fixtures/
|
351
|
+
- spec/fixtures/solr_documents/actual-papermap1.json
|
352
|
+
- spec/fixtures/solr_documents/actual-point1.json
|
353
|
+
- spec/fixtures/solr_documents/actual-polygon1.json
|
354
|
+
- spec/fixtures/solr_documents/actual-raster1.json
|
355
|
+
- spec/fixtures/solr_documents/harvard_raster.json
|
356
|
+
- spec/fixtures/solr_documents/public_iiif_princeton.json
|
357
|
+
- spec/fixtures/solr_documents/public_polygon_mit.json
|
358
|
+
- spec/fixtures/solr_documents/restricted-line.json
|
355
359
|
- spec/helpers/geoblacklight_helpers_spec.rb
|
356
360
|
- spec/lib/geoblacklight/controller_override_spec.rb
|
357
361
|
- spec/lib/geoblacklight/download/geojson_download_spec.rb
|
358
362
|
- spec/lib/geoblacklight/download/geotiff_download_spec.rb
|
363
|
+
- spec/lib/geoblacklight/download/hgl_download_spec.rb
|
359
364
|
- spec/lib/geoblacklight/download/kmz_download_spec.rb
|
360
365
|
- spec/lib/geoblacklight/download/shapefile_download_spec.rb
|
361
366
|
- spec/lib/geoblacklight/download_spec.rb
|
@@ -366,7 +371,6 @@ files:
|
|
366
371
|
- spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb
|
367
372
|
- spec/lib/geoblacklight/wms_layer_spec.rb
|
368
373
|
- spec/spec_helper.rb
|
369
|
-
- spec/support/dct_references_generate.rb
|
370
374
|
- spec/support/features.rb
|
371
375
|
- spec/support/features/session_helpers.rb
|
372
376
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
@@ -403,7 +407,6 @@ summary: A discovery platform for geospatial holdings
|
|
403
407
|
test_files:
|
404
408
|
- spec/controllers/download_controller_spec.rb
|
405
409
|
- spec/factories/user.rb
|
406
|
-
- spec/features/dct_references_spec.rb
|
407
410
|
- spec/features/download_layer_spec.rb
|
408
411
|
- spec/features/home_page_spec.rb
|
409
412
|
- spec/features/iiif_viewer_spec.rb
|
@@ -413,18 +416,19 @@ test_files:
|
|
413
416
|
- spec/features/saved_searches_spec.rb
|
414
417
|
- spec/features/search_bar_spec.rb
|
415
418
|
- spec/features/split_view.html.erb_spec.rb
|
416
|
-
- spec/fixtures/
|
417
|
-
- spec/fixtures/
|
418
|
-
- spec/fixtures/
|
419
|
-
- spec/fixtures/
|
420
|
-
- spec/fixtures/
|
421
|
-
- spec/fixtures/
|
422
|
-
- spec/fixtures/
|
423
|
-
- spec/fixtures/
|
419
|
+
- spec/fixtures/solr_documents/actual-papermap1.json
|
420
|
+
- spec/fixtures/solr_documents/actual-point1.json
|
421
|
+
- spec/fixtures/solr_documents/actual-polygon1.json
|
422
|
+
- spec/fixtures/solr_documents/actual-raster1.json
|
423
|
+
- spec/fixtures/solr_documents/harvard_raster.json
|
424
|
+
- spec/fixtures/solr_documents/public_iiif_princeton.json
|
425
|
+
- spec/fixtures/solr_documents/public_polygon_mit.json
|
426
|
+
- spec/fixtures/solr_documents/restricted-line.json
|
424
427
|
- spec/helpers/geoblacklight_helpers_spec.rb
|
425
428
|
- spec/lib/geoblacklight/controller_override_spec.rb
|
426
429
|
- spec/lib/geoblacklight/download/geojson_download_spec.rb
|
427
430
|
- spec/lib/geoblacklight/download/geotiff_download_spec.rb
|
431
|
+
- spec/lib/geoblacklight/download/hgl_download_spec.rb
|
428
432
|
- spec/lib/geoblacklight/download/kmz_download_spec.rb
|
429
433
|
- spec/lib/geoblacklight/download/shapefile_download_spec.rb
|
430
434
|
- spec/lib/geoblacklight/download_spec.rb
|
@@ -435,7 +439,6 @@ test_files:
|
|
435
439
|
- spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb
|
436
440
|
- spec/lib/geoblacklight/wms_layer_spec.rb
|
437
441
|
- spec/spec_helper.rb
|
438
|
-
- spec/support/dct_references_generate.rb
|
439
442
|
- spec/support/features.rb
|
440
443
|
- spec/support/features/session_helpers.rb
|
441
444
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
URIs = Geoblacklight::Constants::URI
|
5
|
-
|
6
|
-
def parse_dct n
|
7
|
-
doc = JSON.parse(File.open("spec/fixtures/test-dct-references#{n}.json").read)
|
8
|
-
refs = JSON.parse(doc['dct_references_s'])
|
9
|
-
[doc, refs]
|
10
|
-
end
|
11
|
-
|
12
|
-
feature 'DCT:References Parsing' do
|
13
|
-
scenario 'Case 1: Minimal case of HTML metadata only' do
|
14
|
-
doc, refs = parse_dct 1
|
15
|
-
expect(refs[URIs[:html]]).to match %r'.*/.*html'
|
16
|
-
end
|
17
|
-
|
18
|
-
scenario 'Case 2: Minimal case of FGDC metadata, a URL (homepage), and WMS tile server' do
|
19
|
-
doc, refs = parse_dct 2
|
20
|
-
expect(refs[URIs[:fgdc]]).to match %r'.*/fgdc.xml'
|
21
|
-
expect(refs[URIs[:wms]]).to match %r'.*/wms'
|
22
|
-
expect(refs[URIs[:url]]).to match %r'.*/homepage'
|
23
|
-
end
|
24
|
-
|
25
|
-
scenario 'Case 3: ISO & MODS metadata, a URL, and WMS tile server' do
|
26
|
-
doc, refs = parse_dct 3
|
27
|
-
expect(refs[URIs[:iso19139]]).to match %r'.*/iso19139.xml'
|
28
|
-
expect(refs[URIs[:mods]]).to match %r'.*/mods.xml'
|
29
|
-
expect(refs[URIs[:url]]).to match %r'.*/homepage'
|
30
|
-
expect(refs[URIs[:wms]]).to match %r'.*/wms'
|
31
|
-
end
|
32
|
-
|
33
|
-
scenario 'Case 4: FGDC metadata and IIIF tile server' do
|
34
|
-
doc, refs = parse_dct 4
|
35
|
-
expect(refs[URIs[:fgdc]]).to match %r'.*/fgdc.xml'
|
36
|
-
expect(refs[URIs[:iiif]]).to match %r'.*/iiif'
|
37
|
-
end
|
38
|
-
|
39
|
-
scenario 'Case 5: ISO & MODS metadata, a URL, Shapefile ZIP and WFS, and WMS tile server' do
|
40
|
-
doc, refs = parse_dct 5
|
41
|
-
expect(doc['dc_format_s']).to eq 'Shapefile'
|
42
|
-
expect(doc['layer_geom_type_s']).to match %r'Point|Line|Polygon'
|
43
|
-
expect(refs[URIs[:download]]).to match %r'.*/data.zip'
|
44
|
-
expect(refs[URIs[:iso19139]]).to match %r'.*/iso19139.xml'
|
45
|
-
expect(refs[URIs[:mods]]).to match %r'.*/mods.xml'
|
46
|
-
expect(refs[URIs[:wms]]).to match %r'.*/wms'
|
47
|
-
expect(refs[URIs[:wfs]]).to match %r'.*/wfs'
|
48
|
-
expect(refs[URIs[:url]]).to match %r'.*/homepage'
|
49
|
-
end
|
50
|
-
|
51
|
-
scenario 'Case 6: ISO & MODS metadata, GeoTIFF ZIP and WCS, and WMS tile server' do
|
52
|
-
doc, refs = parse_dct 6
|
53
|
-
expect(doc['dc_format_s']).to eq 'GeoTIFF'
|
54
|
-
expect(doc['layer_geom_type_s']).to eq 'Raster'
|
55
|
-
expect(refs[URIs[:download]]).to match %r'.*/data.zip'
|
56
|
-
expect(refs[URIs[:iso19139]]).to match %r'.*/iso19139.xml'
|
57
|
-
expect(refs[URIs[:mods]]).to match %r'.*/mods.xml'
|
58
|
-
expect(refs[URIs[:wms]]).to match %r'.*/wms'
|
59
|
-
expect(refs[URIs[:wcs]]).to match %r'.*/wcs'
|
60
|
-
end
|
61
|
-
|
62
|
-
scenario 'Case 7: No metadata, GeoJSON' do
|
63
|
-
doc, refs = parse_dct 7
|
64
|
-
expect(doc['dc_format_s']).to eq 'Shapefile'
|
65
|
-
expect(doc['layer_geom_type_s']).to match %r'Point|Line|Polygon'
|
66
|
-
expect(refs[URIs[:download]]).to match %r'.*/data.json'
|
67
|
-
end
|
68
|
-
|
69
|
-
scenario 'Case 8: HTML metadata and WMS tile server' do
|
70
|
-
doc, refs = parse_dct 8
|
71
|
-
expect(doc['dc_format_s']).to eq 'Shapefile'
|
72
|
-
expect(refs[URIs[:download]]).to eq nil
|
73
|
-
expect(refs[URIs[:html]]).to match %r'.*/.*.html'
|
74
|
-
expect(refs[URIs[:wms]]).to match %r'.*/wms'
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|