geo_concerns 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -2
- data/README.md +13 -0
- data/app/controllers/concerns/geo_concerns/file_sets_controller_behavior.rb +15 -0
- data/app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb +29 -0
- data/app/models/concerns/geo_concerns/ability.rb +12 -0
- data/app/models/concerns/geo_concerns/file_set/derivatives.rb +6 -6
- data/app/models/concerns/geo_concerns/geo_file_format_behavior.rb +4 -4
- data/app/presenters/geo_concerns/raster_work_show_presenter.rb +1 -1
- data/app/processors/geo_concerns/processors/mapnik.rb +30 -0
- data/app/processors/geo_concerns/processors/vector/base.rb +2 -1
- data/app/processors/geo_concerns/processors/vector/info.rb +66 -0
- data/app/services/geo_concerns/authority_service.rb +29 -0
- data/app/services/geo_concerns/discovery.rb +4 -0
- data/app/services/geo_concerns/discovery/abstract_document.rb +36 -0
- data/app/services/geo_concerns/discovery/document_builder.rb +69 -0
- data/app/services/geo_concerns/discovery/document_builder/basic_metadata_builder.rb +69 -0
- data/app/services/geo_concerns/discovery/document_builder/composite_builder.rb +21 -0
- data/app/services/geo_concerns/discovery/document_builder/date_builder.rb +38 -0
- data/app/services/geo_concerns/discovery/document_builder/document_helper.rb +10 -0
- data/app/services/geo_concerns/discovery/document_builder/document_path.rb +82 -0
- data/app/services/geo_concerns/discovery/document_builder/layer_info_builder.rb +65 -0
- data/app/services/geo_concerns/discovery/document_builder/references_builder.rb +82 -0
- data/app/services/geo_concerns/discovery/document_builder/spatial_builder.rb +40 -0
- data/app/services/geo_concerns/discovery/geoblacklight_document.rb +122 -0
- data/app/services/geo_concerns/image_format_service.rb +6 -0
- data/app/services/geo_concerns/metadata_format_service.rb +6 -0
- data/app/services/geo_concerns/raster_format_service.rb +6 -0
- data/app/services/geo_concerns/vector_format_service.rb +6 -0
- data/app/views/curation_concerns/image_works/show.html.erb +1 -1
- data/app/views/curation_concerns/raster_works/show.html.erb +1 -1
- data/app/views/curation_concerns/vector_works/show.html.erb +1 -1
- data/app/views/geo_concerns/_representative_media.html.erb +5 -0
- data/app/views/{curation_concerns → geo_concerns}/file_sets/_form.html.erb +4 -4
- data/app/views/geo_concerns/file_sets/media_display/_geo.html.erb +16 -0
- data/app/views/geo_concerns/file_sets/new.html.erb +12 -0
- data/config/routes.rb +18 -0
- data/geo_concerns.gemspec +2 -0
- data/lib/generators/geo_concerns/install_generator.rb +34 -0
- data/lib/generators/geo_concerns/templates/config/authorities/image_formats.yml +2 -0
- data/lib/generators/geo_concerns/templates/config/authorities/raster_formats.yml +4 -0
- data/lib/generators/geo_concerns/templates/config/authorities/vector_formats.yml +2 -0
- data/lib/generators/geo_concerns/templates/config/discovery/geoblacklight_schema.json +168 -0
- data/lib/generators/geo_concerns/templates/config/mapnik.yml +24 -0
- data/lib/generators/geo_concerns/templates/controllers/curation_concerns/image_works_controller.rb +1 -0
- data/lib/generators/geo_concerns/templates/controllers/curation_concerns/raster_works_controller.rb +1 -0
- data/lib/generators/geo_concerns/templates/controllers/curation_concerns/vector_works_controller.rb +1 -0
- data/lib/geo_concerns/version.rb +1 -1
- data/spec/controllers/file_sets_controller_spec.rb +20 -0
- data/spec/controllers/vector_works_controller_spec.rb +33 -0
- data/spec/processors/geo_concerns/processors/mapnik_spec.rb +48 -0
- data/spec/processors/geo_concerns/processors/vector/base_spec.rb +1 -1
- data/spec/processors/geo_concerns/processors/vector/info_spec.rb +41 -0
- data/spec/services/geo_concerns/discovery/abstract_document_spec.rb +23 -0
- data/spec/services/geo_concerns/discovery/document_builder_spec.rb +186 -0
- data/spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb +17 -0
- data/spec/services/raster_format_service_spec.rb +1 -1
- data/template.rb +2 -2
- metadata +70 -9
- data/app/services/authority_service.rb +0 -23
- data/app/services/image_format_service.rb +0 -4
- data/app/services/metadata_format_service.rb +0 -4
- data/app/services/raster_format_service.rb +0 -4
- data/app/services/vector_format_service.rb +0 -4
data/lib/geo_concerns/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CurationConcerns::FileSetsController, type: :controller do
|
4
|
+
let(:user) { FactoryGirl.create(:user) }
|
5
|
+
|
6
|
+
subject { described_class.new }
|
7
|
+
|
8
|
+
describe '#new' do
|
9
|
+
it 'renders a geo file set form if the parent is a geo work' do
|
10
|
+
allow(subject).to receive(:geo?).and_return(true)
|
11
|
+
expect(subject).to receive(:render).with('geo_concerns/file_sets/new')
|
12
|
+
subject.new
|
13
|
+
end
|
14
|
+
it 'only render a geo file set form if the parent is a geo work' do
|
15
|
+
allow(subject).to receive(:geo?).and_return(false)
|
16
|
+
expect(subject).not_to receive(:render)
|
17
|
+
subject.new
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -47,4 +47,37 @@ describe CurationConcerns::VectorWorksController, type: :controller do
|
|
47
47
|
expect(described_class.new.show_presenter.name).to eq("GeoConcerns::VectorWorkShowPresenter")
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
describe '#geoblacklight' do
|
52
|
+
# Tell RSpec where to find the geoblacklight route.
|
53
|
+
routes { GeoConcerns::Engine.routes }
|
54
|
+
let(:builder) { double }
|
55
|
+
before do
|
56
|
+
sign_in user
|
57
|
+
allow(GeoConcerns::Discovery::DocumentBuilder).to receive(:new).and_return(builder)
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'with a valid geoblacklight document' do
|
61
|
+
before do
|
62
|
+
allow(builder).to receive(:to_hash).and_return(id: 'test')
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'renders the document' do
|
66
|
+
get :geoblacklight, id: vector_work.id, format: :json
|
67
|
+
expect(response).to be_success
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'with an invalid geoblacklight document' do
|
72
|
+
before do
|
73
|
+
allow(builder).to receive(:to_hash).and_return(error: 'problem')
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'returns an error message with a 404 status' do
|
77
|
+
get :geoblacklight, id: vector_work.id, format: :json
|
78
|
+
expect(response.body).to include('problem')
|
79
|
+
expect(response.status).to eq(404)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
50
83
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GeoConcerns::Processors::Mapnik do
|
4
|
+
before do
|
5
|
+
class TestProcessor
|
6
|
+
include GeoConcerns::Processors::Mapnik
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
after { Object.send(:remove_const, :TestProcessor) }
|
11
|
+
|
12
|
+
subject { TestProcessor.new }
|
13
|
+
|
14
|
+
let(:output_file) { 'output/geo.png' }
|
15
|
+
let(:file_name) { 'files' }
|
16
|
+
let(:options) { { output_size: '150 150' } }
|
17
|
+
|
18
|
+
describe '#mapnik_vector_thumbnail' do
|
19
|
+
let(:map) { double }
|
20
|
+
let(:info) { double }
|
21
|
+
|
22
|
+
before do
|
23
|
+
allow(GeoConcerns::Processors::Vector::Info).to receive(:new).and_return(info)
|
24
|
+
allow(SimpleMapnik::Map).to receive(:new).and_return(map)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'saves a vector thumbnail using simple_mapnik' do
|
28
|
+
expect(info).to receive(:name).and_return('test')
|
29
|
+
expect(map).to receive(:load_string)
|
30
|
+
expect(map).to receive(:zoom_all)
|
31
|
+
expect(map).to receive(:to_file).with(output_file)
|
32
|
+
subject.class.mapnik_vector_thumbnail(file_name, output_file, options)
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#mapnik_size' do
|
36
|
+
it 'returns an array of width and height' do
|
37
|
+
expect(subject.class.mapnik_size(options)).to eq([150, 150])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '#mapnik_config' do
|
42
|
+
it 'returns a mapnik config object' do
|
43
|
+
options[:name] = 'test'
|
44
|
+
expect(subject.class.mapnik_config(file_name, options)).to be_a(SimpleMapnik::Config)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -28,7 +28,7 @@ describe GeoConcerns::Processors::Vector::Base do
|
|
28
28
|
|
29
29
|
describe '#encode_queue' do
|
30
30
|
it 'returns an array of command name symbols' do
|
31
|
-
expect(subject.class.encode_queue).to include :
|
31
|
+
expect(subject.class.encode_queue).to include :mapnik_vector_thumbnail
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'open3'
|
3
|
+
|
4
|
+
describe GeoConcerns::Processors::Vector::Info do
|
5
|
+
let(:path) { 'test.tif' }
|
6
|
+
let(:info_doc) { read_test_data_fixture('ogrinfo.txt') }
|
7
|
+
|
8
|
+
subject { described_class.new(path) }
|
9
|
+
|
10
|
+
context 'when initializing a new info class' do
|
11
|
+
it 'shells out to ogrinfo and sets the doc variable to the output string' do
|
12
|
+
expect(Open3).to receive(:capture3).with("ogrinfo #{path}")
|
13
|
+
.and_return([info_doc, '', ''])
|
14
|
+
expect(subject.doc).to eq(info_doc)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'after intialization' do
|
19
|
+
before do
|
20
|
+
allow(subject).to receive(:doc).and_return(info_doc)
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#name' do
|
24
|
+
it 'returns with min and max values' do
|
25
|
+
expect(subject.name).to eq('tufts-cambridgegrid100-04')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#driver' do
|
30
|
+
it 'returns with min and max values' do
|
31
|
+
expect(subject.driver).to eq('ESRI Shapefile')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#geom' do
|
36
|
+
it 'returns raster size' do
|
37
|
+
expect(subject.geom).to eq('Polygon')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GeoConcerns::Discovery::AbstractDocument do
|
4
|
+
subject { described_class.new }
|
5
|
+
|
6
|
+
describe '#to_hash' do
|
7
|
+
it 'raises an error because the class should not be instantiated directly' do
|
8
|
+
expect { subject.to_hash(nil) }.to raise_error(/hash/)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#to_json' do
|
13
|
+
it 'raises an error because the class should not be instantiated directly' do
|
14
|
+
expect { subject.to_json(nil) }.to raise_error(/json/)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#to_xml' do
|
19
|
+
it 'raises an error because the class should not be instantiated directly' do
|
20
|
+
expect { subject.to_xml(nil) }.to raise_error(/xml/)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,186 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GeoConcerns::Discovery::DocumentBuilder do
|
4
|
+
subject { described_class.new(geo_concern_presenter, document_class) }
|
5
|
+
|
6
|
+
let(:geo_concern) { FactoryGirl.build(:public_vector_work, attributes) }
|
7
|
+
let(:geo_concern_presenter) { GeoConcerns::VectorWorkShowPresenter.new(SolrDocument.new(geo_concern.to_solr), nil) }
|
8
|
+
let(:document_class) { GeoConcerns::Discovery::GeoblacklightDocument.new }
|
9
|
+
let(:document) { JSON.parse(subject.to_json(nil)) }
|
10
|
+
let(:metadata__mime_type) { 'application/xml; schema=iso19139' }
|
11
|
+
let(:metadata_file) { FileSet.new(id: 'metadatafile', geo_mime_type: metadata__mime_type) }
|
12
|
+
let(:metadata_presenter) { CurationConcerns::FileSetPresenter.new(SolrDocument.new(metadata_file.to_solr), nil) }
|
13
|
+
let(:geo_file_mime_type) { 'application/zip; ogr-format="ESRI Shapefile"' }
|
14
|
+
let(:geo_file) { FileSet.new(id: 'geofile', geo_mime_type: geo_file_mime_type) }
|
15
|
+
let(:geo_file_presenter) { CurationConcerns::FileSetPresenter.new(SolrDocument.new(geo_file.to_solr), nil) }
|
16
|
+
let(:coverage) { GeoConcerns::Coverage.new(43.039, -69.856, 42.943, -71.032) }
|
17
|
+
let(:date_modified) { Time.now.utc }
|
18
|
+
let(:attributes) { { id: 'geo-work-1',
|
19
|
+
identifier: ['abcde'],
|
20
|
+
title: ['Geo Work'],
|
21
|
+
coverage: coverage.to_s,
|
22
|
+
description: ['This is a Geo Work'],
|
23
|
+
creator: ['Yosiwo George'],
|
24
|
+
publisher: ['National Geographic'],
|
25
|
+
date_modified: date_modified,
|
26
|
+
spatial: ['Micronesia'],
|
27
|
+
temporal: ['2011'],
|
28
|
+
subject: ['Human settlements'],
|
29
|
+
provenance: 'Pacific Islands University',
|
30
|
+
language: ['Esperanto'] }
|
31
|
+
}
|
32
|
+
|
33
|
+
describe 'vector work' do
|
34
|
+
before do
|
35
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'has basic metadata' do
|
39
|
+
expect(document['uuid']).to eq('geo-work-1')
|
40
|
+
expect(document['dc_identifier_s']).to eq('abcde')
|
41
|
+
expect(document['dct_provenance_s']).to eq('Pacific Islands University')
|
42
|
+
expect(document['layer_slug_s']).to eq('pacific-islands-university-geo-work-1')
|
43
|
+
expect(document['dc_description_s']).to eq('This is a Geo Work')
|
44
|
+
expect(document['dc_rights_s']).to eq('Restricted')
|
45
|
+
expect(document['dc_creator_sm']).to eq(['Yosiwo George'])
|
46
|
+
expect(document['dc_subject_sm']).to eq(['Human settlements'])
|
47
|
+
expect(document['dct_spatial_sm']).to eq(['Micronesia'])
|
48
|
+
expect(document['dct_temporal_sm']).to eq(['2011'])
|
49
|
+
expect(document['dc_title_s']).to eq('Geo Work')
|
50
|
+
expect(document['dc_language_s']).to eq('Esperanto')
|
51
|
+
expect(document['dc_publisher_s']).to eq('National Geographic')
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'has date field' do
|
55
|
+
expect(document['solr_year_i']).to eq(2011)
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'has layer info fields' do
|
59
|
+
expect(document['layer_geom_type_s']).to eq('Mixed')
|
60
|
+
expect(document['dc_format_s']).to eq('Shapefile')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'has spatial fields' do
|
64
|
+
expect(document['georss_box_s']).to eq('42.943 -71.032 43.039 -69.856')
|
65
|
+
expect(document['solr_geom']).to eq('ENVELOPE(-71.032, -69.856, 43.039, 42.943)')
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'has references' do
|
69
|
+
refs = JSON.parse(document['dct_references_s'])
|
70
|
+
expect(refs['http://schema.org/url']).to eq('http://localhost:3000/concern/vector_works/geo-work-1')
|
71
|
+
expect(refs['http://www.isotc211.org/schemas/2005/gmd/']).to eq('http://localhost:3000/downloads/metadatafile')
|
72
|
+
expect(refs['http://schema.org/downloadUrl']).to eq('http://localhost:3000/downloads/geofile')
|
73
|
+
expect(refs['http://schema.org/thumbnailUrl']).to eq('http://localhost:3000/downloads/geofile?file=thumbnail')
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe 'raster work' do
|
78
|
+
let(:geo_concern_presenter) { GeoConcerns::RasterWorkShowPresenter.new(SolrDocument.new(geo_concern.to_solr), nil) }
|
79
|
+
|
80
|
+
context 'with a GeoTIFF file and a FGDC metadata file' do
|
81
|
+
let(:geo_file_mime_type) { 'image/tiff; gdal-format=GTiff' }
|
82
|
+
let(:metadata__mime_type) { 'application/xml; schema=fgdc' }
|
83
|
+
|
84
|
+
before do
|
85
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'has layer info fields' do
|
89
|
+
expect(document['layer_geom_type_s']).to eq('Raster')
|
90
|
+
expect(document['dc_format_s']).to eq('GeoTIFF')
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'has references' do
|
94
|
+
refs = JSON.parse(document['dct_references_s'])
|
95
|
+
expect(refs['http://www.opengis.net/cat/csw/csdgm']).to eq('http://localhost:3000/downloads/metadatafile')
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'with an ArcGRID file and a MODS metadata file' do
|
100
|
+
let(:geo_file_mime_type) { 'application/octet-stream; gdal-format=AIG' }
|
101
|
+
let(:metadata__mime_type) { 'application/mods+xml' }
|
102
|
+
|
103
|
+
before do
|
104
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'has layer info fields' do
|
108
|
+
expect(document['dc_format_s']).to eq('ArcGRID')
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'has references' do
|
112
|
+
refs = JSON.parse(document['dct_references_s'])
|
113
|
+
expect(refs['http://www.loc.gov/mods/v3']).to eq('http://localhost:3000/downloads/metadatafile')
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe 'image work' do
|
119
|
+
let(:geo_concern_presenter) { GeoConcerns::ImageWorkShowPresenter.new(SolrDocument.new(geo_concern.to_solr), nil) }
|
120
|
+
|
121
|
+
context 'with a tiff file and no decription' do
|
122
|
+
let(:geo_file_mime_type) { 'image/tiff' }
|
123
|
+
|
124
|
+
before do
|
125
|
+
attributes.delete(:description)
|
126
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'uses a default description' do
|
130
|
+
expect(document['dc_description_s']).to eq('A vector work object.')
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'has layer info fields' do
|
134
|
+
expect(document['layer_geom_type_s']).to eq('Scanned Map')
|
135
|
+
expect(document['dc_format_s']).to eq('TIFF')
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
context 'with a missing required metadata field' do
|
141
|
+
before do
|
142
|
+
attributes.delete(:title)
|
143
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'returns an error document' do
|
147
|
+
expect(document['error'][0]).to include('dc_title_s')
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
context 'with a missing non-required metadata field' do
|
152
|
+
before do
|
153
|
+
attributes.delete(:language)
|
154
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'returns a document without the field' do
|
158
|
+
expect(document['dc_language_s']).to be_nil
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
context 'with a public visibility' do
|
163
|
+
before do
|
164
|
+
pulic = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
165
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
166
|
+
allow(geo_concern_presenter.solr_document).to receive(:visibility).and_return(pulic)
|
167
|
+
end
|
168
|
+
|
169
|
+
it 'return a public access' do
|
170
|
+
expect(document['dc_rights_s']).to eq('Public')
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
context 'with ssl enabled' do
|
175
|
+
subject { described_class.new(geo_concern_presenter, document_class, ssl: true) }
|
176
|
+
|
177
|
+
before do
|
178
|
+
allow(geo_concern_presenter).to receive(:file_set_presenters).and_return([geo_file_presenter, metadata_presenter])
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'returns https reference urls' do
|
182
|
+
refs = JSON.parse(document['dct_references_s'])
|
183
|
+
expect(refs['http://schema.org/url']).to eq('https://localhost:3000/concern/vector_works/geo-work-1')
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GeoConcerns::Discovery::GeoblacklightDocument do
|
4
|
+
subject { described_class.new }
|
5
|
+
|
6
|
+
describe '#to_hash' do
|
7
|
+
let(:document) { { id: 'test' } }
|
8
|
+
|
9
|
+
before do
|
10
|
+
allow(subject).to receive(:document).and_return(document)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns the document hash' do
|
14
|
+
expect(subject.to_hash).to eq(document)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/template.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geo_concerns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Griffin
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-05-
|
15
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: curation_concerns
|
@@ -42,6 +42,34 @@ dependencies:
|
|
42
42
|
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0.7'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: simple_mapnik
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - '='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 0.0.9
|
52
|
+
type: :runtime
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 0.0.9
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: json-schema
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
45
73
|
- !ruby/object:Gem::Dependency
|
46
74
|
name: sqlite3
|
47
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +259,7 @@ files:
|
|
231
259
|
- app/assets/stylesheets/geo_concerns/bounding_box.scss
|
232
260
|
- app/assets/stylesheets/geo_concerns/leaflet-boundingbox.css
|
233
261
|
- app/controllers/concerns/geo_concerns/file_sets_controller_behavior.rb
|
262
|
+
- app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
|
234
263
|
- app/controllers/concerns/geo_concerns/image_works_controller_behavior.rb
|
235
264
|
- app/controllers/concerns/geo_concerns/raster_works_controller_behavior.rb
|
236
265
|
- app/controllers/concerns/geo_concerns/vector_works_controller_behavior.rb
|
@@ -243,6 +272,7 @@ files:
|
|
243
272
|
- app/helpers/geo_concerns/application_helper.rb
|
244
273
|
- app/helpers/geo_concerns/bounding_box_helper.rb
|
245
274
|
- app/helpers/geo_concerns/geo_works_helper.rb
|
275
|
+
- app/models/concerns/geo_concerns/ability.rb
|
246
276
|
- app/models/concerns/geo_concerns/basic_geo_metadata.rb
|
247
277
|
- app/models/concerns/geo_concerns/external_metadata_file_behavior.rb
|
248
278
|
- app/models/concerns/geo_concerns/extractors/fgdc_helper.rb
|
@@ -269,6 +299,7 @@ files:
|
|
269
299
|
- app/presenters/geo_concerns/vector_work_show_presenter.rb
|
270
300
|
- app/processors/geo_concerns/processors/base_geo_processor.rb
|
271
301
|
- app/processors/geo_concerns/processors/gdal.rb
|
302
|
+
- app/processors/geo_concerns/processors/mapnik.rb
|
272
303
|
- app/processors/geo_concerns/processors/ogr.rb
|
273
304
|
- app/processors/geo_concerns/processors/raster.rb
|
274
305
|
- app/processors/geo_concerns/processors/raster/aig.rb
|
@@ -278,6 +309,7 @@ files:
|
|
278
309
|
- app/processors/geo_concerns/processors/raster/processor.rb
|
279
310
|
- app/processors/geo_concerns/processors/vector.rb
|
280
311
|
- app/processors/geo_concerns/processors/vector/base.rb
|
312
|
+
- app/processors/geo_concerns/processors/vector/info.rb
|
281
313
|
- app/processors/geo_concerns/processors/vector/processor.rb
|
282
314
|
- app/processors/geo_concerns/processors/vector/shapefile.rb
|
283
315
|
- app/processors/geo_concerns/processors/zip.rb
|
@@ -287,15 +319,26 @@ files:
|
|
287
319
|
- app/schemas/geo_concerns/basic_geo_metadata_optional.rb
|
288
320
|
- app/schemas/geo_concerns/basic_geo_metadata_required.rb
|
289
321
|
- app/schemas/geo_concerns/file_set_metadata_required.rb
|
290
|
-
- app/services/authority_service.rb
|
322
|
+
- app/services/geo_concerns/authority_service.rb
|
291
323
|
- app/services/geo_concerns/derivative_path.rb
|
292
|
-
- app/services/
|
293
|
-
- app/services/
|
294
|
-
- app/services/
|
295
|
-
- app/services/
|
324
|
+
- app/services/geo_concerns/discovery.rb
|
325
|
+
- app/services/geo_concerns/discovery/abstract_document.rb
|
326
|
+
- app/services/geo_concerns/discovery/document_builder.rb
|
327
|
+
- app/services/geo_concerns/discovery/document_builder/basic_metadata_builder.rb
|
328
|
+
- app/services/geo_concerns/discovery/document_builder/composite_builder.rb
|
329
|
+
- app/services/geo_concerns/discovery/document_builder/date_builder.rb
|
330
|
+
- app/services/geo_concerns/discovery/document_builder/document_helper.rb
|
331
|
+
- app/services/geo_concerns/discovery/document_builder/document_path.rb
|
332
|
+
- app/services/geo_concerns/discovery/document_builder/layer_info_builder.rb
|
333
|
+
- app/services/geo_concerns/discovery/document_builder/references_builder.rb
|
334
|
+
- app/services/geo_concerns/discovery/document_builder/spatial_builder.rb
|
335
|
+
- app/services/geo_concerns/discovery/geoblacklight_document.rb
|
336
|
+
- app/services/geo_concerns/image_format_service.rb
|
337
|
+
- app/services/geo_concerns/metadata_format_service.rb
|
338
|
+
- app/services/geo_concerns/raster_format_service.rb
|
339
|
+
- app/services/geo_concerns/vector_format_service.rb
|
296
340
|
- app/values/geo_concerns/coverage.rb
|
297
341
|
- app/values/geo_concerns/time_period.rb
|
298
|
-
- app/views/curation_concerns/file_sets/_form.html.erb
|
299
342
|
- app/views/curation_concerns/image_works/_form.html.erb
|
300
343
|
- app/views/curation_concerns/image_works/_image_work.html.erb
|
301
344
|
- app/views/curation_concerns/image_works/_show_actions.html.erb
|
@@ -320,6 +363,10 @@ files:
|
|
320
363
|
- app/views/geo_concerns/_related_external_metadata_files.html.erb
|
321
364
|
- app/views/geo_concerns/_related_geo_files.html.erb
|
322
365
|
- app/views/geo_concerns/_related_geo_works.html.erb
|
366
|
+
- app/views/geo_concerns/_representative_media.html.erb
|
367
|
+
- app/views/geo_concerns/file_sets/_form.html.erb
|
368
|
+
- app/views/geo_concerns/file_sets/media_display/_geo.html.erb
|
369
|
+
- app/views/geo_concerns/file_sets/new.html.erb
|
323
370
|
- app/vocabs/geo_concerns/geo_terms.rb
|
324
371
|
- config/routes.rb
|
325
372
|
- geo_concerns.gemspec
|
@@ -331,6 +378,8 @@ files:
|
|
331
378
|
- lib/generators/geo_concerns/templates/config/authorities/metadata_formats.yml
|
332
379
|
- lib/generators/geo_concerns/templates/config/authorities/raster_formats.yml
|
333
380
|
- lib/generators/geo_concerns/templates/config/authorities/vector_formats.yml
|
381
|
+
- lib/generators/geo_concerns/templates/config/discovery/geoblacklight_schema.json
|
382
|
+
- lib/generators/geo_concerns/templates/config/mapnik.yml
|
334
383
|
- lib/generators/geo_concerns/templates/controllers/curation_concerns/file_sets_controller.rb
|
335
384
|
- lib/generators/geo_concerns/templates/controllers/curation_concerns/image_works_controller.rb
|
336
385
|
- lib/generators/geo_concerns/templates/controllers/curation_concerns/raster_works_controller.rb
|
@@ -367,6 +416,7 @@ files:
|
|
367
416
|
- solr/config/xslt/example_rss.xsl
|
368
417
|
- solr/config/xslt/luke.xsl
|
369
418
|
- spec/actors/geo_concerns/actors/file_actor_spec.rb
|
419
|
+
- spec/controllers/file_sets_controller_spec.rb
|
370
420
|
- spec/controllers/image_works_controller_spec.rb
|
371
421
|
- spec/controllers/raster_works_controller_spec.rb
|
372
422
|
- spec/controllers/vector_works_controller_spec.rb
|
@@ -406,6 +456,7 @@ files:
|
|
406
456
|
- spec/presenters/vector_work_show_presenter_spec.rb
|
407
457
|
- spec/processors/geo_concerns/processors/base_geo_processor_spec.rb
|
408
458
|
- spec/processors/geo_concerns/processors/gdal_spec.rb
|
459
|
+
- spec/processors/geo_concerns/processors/mapnik_spec.rb
|
409
460
|
- spec/processors/geo_concerns/processors/ogr_spec.rb
|
410
461
|
- spec/processors/geo_concerns/processors/raster/aig_spec.rb
|
411
462
|
- spec/processors/geo_concerns/processors/raster/base_spec.rb
|
@@ -413,11 +464,15 @@ files:
|
|
413
464
|
- spec/processors/geo_concerns/processors/raster/info_spec.rb
|
414
465
|
- spec/processors/geo_concerns/processors/raster/processor_spec.rb
|
415
466
|
- spec/processors/geo_concerns/processors/vector/base_spec.rb
|
467
|
+
- spec/processors/geo_concerns/processors/vector/info_spec.rb
|
416
468
|
- spec/processors/geo_concerns/processors/vector/processor_spec.rb
|
417
469
|
- spec/processors/geo_concerns/processors/vector/shapefile_spec.rb
|
418
470
|
- spec/processors/geo_concerns/processors/zip_spec.rb
|
419
471
|
- spec/renderers/geo_concerns/coverage_renderer_spec.rb
|
420
472
|
- spec/services/derivative_path_spec.rb
|
473
|
+
- spec/services/geo_concerns/discovery/abstract_document_spec.rb
|
474
|
+
- spec/services/geo_concerns/discovery/document_builder_spec.rb
|
475
|
+
- spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb
|
421
476
|
- spec/services/raster_format_service_spec.rb
|
422
477
|
- spec/spec_helper.rb
|
423
478
|
- spec/support/controllers/engine_helpers.rb
|
@@ -452,12 +507,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
452
507
|
version: '0'
|
453
508
|
requirements: []
|
454
509
|
rubyforge_project:
|
455
|
-
rubygems_version: 2.4.
|
510
|
+
rubygems_version: 2.4.6
|
456
511
|
signing_key:
|
457
512
|
specification_version: 4
|
458
513
|
summary: Rails engine for Hydra Geo models. Built around Curation Concerns engine.
|
459
514
|
test_files:
|
460
515
|
- spec/actors/geo_concerns/actors/file_actor_spec.rb
|
516
|
+
- spec/controllers/file_sets_controller_spec.rb
|
461
517
|
- spec/controllers/image_works_controller_spec.rb
|
462
518
|
- spec/controllers/raster_works_controller_spec.rb
|
463
519
|
- spec/controllers/vector_works_controller_spec.rb
|
@@ -497,6 +553,7 @@ test_files:
|
|
497
553
|
- spec/presenters/vector_work_show_presenter_spec.rb
|
498
554
|
- spec/processors/geo_concerns/processors/base_geo_processor_spec.rb
|
499
555
|
- spec/processors/geo_concerns/processors/gdal_spec.rb
|
556
|
+
- spec/processors/geo_concerns/processors/mapnik_spec.rb
|
500
557
|
- spec/processors/geo_concerns/processors/ogr_spec.rb
|
501
558
|
- spec/processors/geo_concerns/processors/raster/aig_spec.rb
|
502
559
|
- spec/processors/geo_concerns/processors/raster/base_spec.rb
|
@@ -504,11 +561,15 @@ test_files:
|
|
504
561
|
- spec/processors/geo_concerns/processors/raster/info_spec.rb
|
505
562
|
- spec/processors/geo_concerns/processors/raster/processor_spec.rb
|
506
563
|
- spec/processors/geo_concerns/processors/vector/base_spec.rb
|
564
|
+
- spec/processors/geo_concerns/processors/vector/info_spec.rb
|
507
565
|
- spec/processors/geo_concerns/processors/vector/processor_spec.rb
|
508
566
|
- spec/processors/geo_concerns/processors/vector/shapefile_spec.rb
|
509
567
|
- spec/processors/geo_concerns/processors/zip_spec.rb
|
510
568
|
- spec/renderers/geo_concerns/coverage_renderer_spec.rb
|
511
569
|
- spec/services/derivative_path_spec.rb
|
570
|
+
- spec/services/geo_concerns/discovery/abstract_document_spec.rb
|
571
|
+
- spec/services/geo_concerns/discovery/document_builder_spec.rb
|
572
|
+
- spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb
|
512
573
|
- spec/services/raster_format_service_spec.rb
|
513
574
|
- spec/spec_helper.rb
|
514
575
|
- spec/support/controllers/engine_helpers.rb
|