adiwg-mdtranslator 2.6.1 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +3 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +7 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +35 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +10 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +6 -10
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialOrganization.rb +6 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +6 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +6 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +101 -94
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +2 -2
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +54 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +35 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +39 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +148 -89
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +91 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +94 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +119 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +64 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +124 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +177 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +70 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +65 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +154 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +22 -16
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +19 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/readme.md +2 -2
- data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_source.rb +7 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_source.rb +1 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f63c2f64b279e4dbd888fe4af191291d692440e9
|
4
|
+
data.tar.gz: 37fdda4ca201df46a93d611d8ef3d639cfc684d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bb5674e9a1e307c07826358dcde39452219c9b415e2cb8b4c4873340863b8802f10d38c29964cf9dc77ae90f0dce3457b2769fba833e85a958743fc00b477e1
|
7
|
+
data.tar.gz: 90e071925c75844fe2203b6177ffc752e91bae66e4f35502c47a4908d8e2a1eefeff68023f49a67153f7cbc52d858c5f92f8c2704618739845e6ae0eed4857d8
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v2.
|
3
|
+
## [v2.7.0](https://github.com/adiwg/mdTranslator/tree/v2.7.0)
|
4
4
|
|
5
|
+
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.6.1...v2.7.0)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- Add basic FGDC writer [\#169](https://github.com/adiwg/mdTranslator/pull/169) ([stansmith907](https://github.com/stansmith907))
|
10
|
+
|
11
|
+
## [v2.6.1](https://github.com/adiwg/mdTranslator/tree/v2.6.1) (2017-12-05)
|
5
12
|
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.6.0...v2.6.1)
|
6
13
|
|
7
14
|
**Implemented enhancements:**
|
data/adiwg-mdtranslator.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
34
34
|
spec.add_runtime_dependency "uuidtools", "~> 2.1"
|
35
35
|
spec.add_runtime_dependency "json-schema", "~> 2.7"
|
36
|
-
spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.
|
36
|
+
spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.4.1"
|
37
37
|
spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.3.2"
|
38
38
|
spec.add_runtime_dependency "jbuilder", "~> 2.5"
|
39
39
|
spec.add_runtime_dependency "kramdown", "~> 1.13"
|
@@ -666,6 +666,7 @@ class InternalMetadata
|
|
666
666
|
|
667
667
|
def newDataSource
|
668
668
|
{
|
669
|
+
sourceId: nil,
|
669
670
|
description: nil,
|
670
671
|
sourceCitation: {},
|
671
672
|
metadataCitation: [],
|
@@ -789,8 +790,8 @@ class InternalMetadata
|
|
789
790
|
domainId: nil,
|
790
791
|
minValue: nil,
|
791
792
|
maxValue: nil,
|
792
|
-
|
793
|
-
|
793
|
+
valueRange: [],
|
794
|
+
timePeriod: []
|
794
795
|
}
|
795
796
|
end
|
796
797
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# unpack fgdc entity attribute
|
3
3
|
|
4
4
|
# History:
|
5
|
-
# Stan Smith 2017-10-30 added
|
5
|
+
# Stan Smith 2017-10-30 added timePeriod
|
6
6
|
# Stan Smith 2017-09-06 original script
|
7
7
|
|
8
8
|
require 'nokogiri'
|
@@ -100,8 +100,8 @@ module ADIWG
|
|
100
100
|
axBegin = xAttribute.xpath('./begdatea')
|
101
101
|
# entity attribute 5.1.2.5 (begdatea) - beginning date of attribute values
|
102
102
|
# entity attribute 5.1.2.6 (enddatea) - ending date of attribute values
|
103
|
-
# -> dataDictionary.entities.attributes.
|
104
|
-
# -> dataDictionary.entities.attributes.
|
103
|
+
# -> dataDictionary.entities.attributes.timePeriod.startDateTime
|
104
|
+
# -> dataDictionary.entities.attributes.timePeriod.endDateTime
|
105
105
|
axBegin.each_with_index do |xBegin, index|
|
106
106
|
beginDate = xBegin.text
|
107
107
|
unless beginDate.empty?
|
@@ -116,7 +116,7 @@ module ADIWG
|
|
116
116
|
hTimePeriod[:endDateTime] = hDateTime
|
117
117
|
end
|
118
118
|
hTimePeriod[:description] = 'attribute date range'
|
119
|
-
hAttribute[:
|
119
|
+
hAttribute[:timePeriod] << hTimePeriod
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -60,14 +60,17 @@ module ADIWG
|
|
60
60
|
xTimePeriod = xIdInfo.xpath('./timeperd')
|
61
61
|
unless xTimePeriod.empty?
|
62
62
|
|
63
|
+
# timeInfo currentness
|
64
|
+
current = xTimePeriod.xpath('./current').text
|
65
|
+
|
63
66
|
# time period for single date, multi-date, and date range {resource timePeriod}
|
64
67
|
hTimePeriod = TimePeriod.unpack(xTimePeriod, hResponseObj)
|
65
68
|
hResourceInfo[:timePeriod] = hTimePeriod unless hTimePeriod.nil?
|
69
|
+
hResourceInfo[:timePeriod][:description] = current
|
66
70
|
|
67
71
|
# time period multi-date also placed in temporalExtent
|
68
72
|
axMultiple = xTimePeriod.xpath('./timeinfo/mdattim/sngdate')
|
69
73
|
unless axMultiple.empty?
|
70
|
-
current = xTimePeriod.xpath('./current').text
|
71
74
|
hExtent = intMetadataClass.newExtent
|
72
75
|
hExtent[:description] = 'FGDC resource time period for multiple date/times/geological age'
|
73
76
|
axMultiple.each do |xDateTime|
|
@@ -129,6 +132,8 @@ module ADIWG
|
|
129
132
|
hConstraint[:type] = 'legal'
|
130
133
|
hLegal = intMetadataClass.newLegalConstraint
|
131
134
|
|
135
|
+
hLegal[:accessCodes] << accessCon unless accessCon.empty?
|
136
|
+
hLegal[:useCodes] << useCon unless useCon.empty?
|
132
137
|
hLegal[:otherCons] << accessCon unless accessCon.empty?
|
133
138
|
hLegal[:otherCons] << useCon unless useCon.empty?
|
134
139
|
unless hLegal[:otherCons].empty?
|
@@ -147,7 +152,7 @@ module ADIWG
|
|
147
152
|
end
|
148
153
|
|
149
154
|
# identification information 1.10 (browse) - browse graphic []
|
150
|
-
axBrowse = xIdInfo.xpath('
|
155
|
+
axBrowse = xIdInfo.xpath('//browse')
|
151
156
|
unless axBrowse.empty?
|
152
157
|
axBrowse.each do |xBrowse|
|
153
158
|
browseName = xBrowse.xpath('./browsen').text
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc keyword
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2017-12-19 add lineage method keywords
|
5
6
|
# Stan Smith 2017-08-24 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -171,7 +172,7 @@ module ADIWG
|
|
171
172
|
end
|
172
173
|
|
173
174
|
# keywords bio (keywtax) - taxonomy keywords {keyword}
|
174
|
-
nodeName = xKeywords.xpath('
|
175
|
+
nodeName = xKeywords.xpath('.').first.name
|
175
176
|
if nodeName == 'keywtax'
|
176
177
|
hKeyword = intMetadataClass.newKeyword
|
177
178
|
hKeyword[:keywordType] = 'taxon'
|
@@ -203,6 +204,39 @@ module ADIWG
|
|
203
204
|
|
204
205
|
end
|
205
206
|
|
207
|
+
# keywords bio (methodid) - lineage method keywords {keyword}
|
208
|
+
nodeName = xKeywords.xpath('.').first.name
|
209
|
+
if nodeName == 'methodid'
|
210
|
+
hKeyword = intMetadataClass.newKeyword
|
211
|
+
hKeyword[:keywordType] = 'method'
|
212
|
+
|
213
|
+
# theme bio.1.1 (methkt) - lineage method keyword thesaurus {citation}
|
214
|
+
thesaurus = xKeywords.xpath('./methkt').text
|
215
|
+
unless thesaurus.empty?
|
216
|
+
hCitation = intMetadataClass.newCitation
|
217
|
+
hCitation[:title] = thesaurus
|
218
|
+
hKeyword[:thesaurus] = hCitation
|
219
|
+
end
|
220
|
+
|
221
|
+
# theme keyword bio.1.2 (methkey) - lineage method keywords {keywordObject}
|
222
|
+
axKeywords = xKeywords.xpath('./methkey')
|
223
|
+
unless axKeywords.empty?
|
224
|
+
axKeywords.each do |xKeyword|
|
225
|
+
keyword = xKeyword.text
|
226
|
+
unless keyword.empty?
|
227
|
+
hKeywordObj = intMetadataClass.newKeywordObject
|
228
|
+
hKeywordObj[:keyword] = keyword
|
229
|
+
hKeyword[:keywords] << hKeywordObj
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
unless hKeyword.empty?
|
235
|
+
aKeywords << hKeyword
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
206
240
|
return aKeywords
|
207
241
|
|
208
242
|
end
|
@@ -2,10 +2,12 @@
|
|
2
2
|
# unpack fgdc lineage
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2017-12-19 add bio methodology
|
5
6
|
# Stan Smith 2017-08-28 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
8
9
|
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
10
|
+
require_relative 'module_methodology'
|
9
11
|
require_relative 'module_source'
|
10
12
|
require_relative 'module_process'
|
11
13
|
|
@@ -16,7 +18,7 @@ module ADIWG
|
|
16
18
|
|
17
19
|
module Lineage
|
18
20
|
|
19
|
-
def self.unpack(xLineage,
|
21
|
+
def self.unpack(xLineage, hResponseObj)
|
20
22
|
|
21
23
|
# instance classes needed in script
|
22
24
|
intMetadataClass = InternalMetadata.new
|
@@ -25,11 +27,17 @@ module ADIWG
|
|
25
27
|
# data quality 2.5 (lineage) - lineage
|
26
28
|
unless xLineage.empty?
|
27
29
|
|
30
|
+
# lineage bio (method) - methodology []
|
31
|
+
axMethods = xLineage.xpath('./method')
|
32
|
+
unless axMethods.empty?
|
33
|
+
Method.unpack(hLineage, axMethods, hResponseObj)
|
34
|
+
end
|
35
|
+
|
28
36
|
# lineage 2.5.1 (srcinfo) - source information []
|
29
37
|
axSource = xLineage.xpath('./srcinfo')
|
30
38
|
unless axSource.empty?
|
31
39
|
axSource.each do |xSource|
|
32
|
-
hSource = Source.unpack(xSource,
|
40
|
+
hSource = Source.unpack(xSource, hResponseObj)
|
33
41
|
hLineage[:dataSources] << hSource
|
34
42
|
end
|
35
43
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Reader - fgdc to internal data structure
|
2
|
+
# unpack fgdc methodology
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2017-12-19 original script
|
6
|
+
|
7
|
+
require 'nokogiri'
|
8
|
+
require_relative 'module_fgdc'
|
9
|
+
require_relative 'module_keyword'
|
10
|
+
require_relative 'module_citation'
|
11
|
+
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Readers
|
15
|
+
module Fgdc
|
16
|
+
|
17
|
+
module Method
|
18
|
+
|
19
|
+
def self.unpack(hLineage, axMethods, hResponseObj)
|
20
|
+
|
21
|
+
statement = ''
|
22
|
+
intObj = Fgdc.get_intObj
|
23
|
+
hResourceInfo = intObj[:metadata][:resourceInfo]
|
24
|
+
|
25
|
+
axMethods.each do |xMethod|
|
26
|
+
|
27
|
+
# methodology bio (methtype) - method type (not supported)
|
28
|
+
|
29
|
+
# methodology bio (methodid) - method identifier [] {keyword}
|
30
|
+
axKeywords = xMethod.xpath('./methodid')
|
31
|
+
unless axKeywords.empty?
|
32
|
+
axKeywords.each do |xKeyword|
|
33
|
+
Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# methodology bio (methdesc) - method description
|
38
|
+
description = xMethod.xpath('./methdesc').text
|
39
|
+
unless description.empty?
|
40
|
+
statement += description + '; '
|
41
|
+
end
|
42
|
+
|
43
|
+
# methodology bio (methcite) - method citation [] {citation}
|
44
|
+
axCitations = xMethod.xpath('./methcite')
|
45
|
+
unless axCitations.empty?
|
46
|
+
axCitations.each do |xCitation|
|
47
|
+
hReturn = Citation.unpack(xCitation, hResponseObj)
|
48
|
+
unless hReturn.nil?
|
49
|
+
hLineage[:lineageCitation] << hReturn
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
unless statement.empty?
|
57
|
+
statement.chomp!('; ')
|
58
|
+
hLineage[:statement] = statement
|
59
|
+
end
|
60
|
+
|
61
|
+
return hLineage
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -35,11 +35,9 @@ module ADIWG
|
|
35
35
|
usedSrc = xUsed.text
|
36
36
|
unless usedSrc.empty?
|
37
37
|
hLineage[:dataSources].each do |hSource|
|
38
|
-
unless hSource[:
|
39
|
-
hSource[:
|
40
|
-
|
41
|
-
hProcess[:stepSources] << hSource
|
42
|
-
end
|
38
|
+
unless hSource[:sourceId].nil?
|
39
|
+
if usedSrc == hSource[:sourceId]
|
40
|
+
hProcess[:stepSources] << hSource
|
43
41
|
end
|
44
42
|
end
|
45
43
|
end
|
@@ -67,11 +65,9 @@ module ADIWG
|
|
67
65
|
prodSrc = xProduct.text
|
68
66
|
unless prodSrc.empty?
|
69
67
|
hLineage[:dataSources].each do |hSource|
|
70
|
-
unless hSource[:
|
71
|
-
hSource[:
|
72
|
-
|
73
|
-
hProcess[:stepProducts] << hSource
|
74
|
-
end
|
68
|
+
unless hSource[:sourceId].nil?
|
69
|
+
if prodSrc == hSource[:sourceId]
|
70
|
+
hProcess[:stepProducts] << hSource
|
75
71
|
end
|
76
72
|
end
|
77
73
|
end
|
@@ -17,8 +17,6 @@ module ADIWG
|
|
17
17
|
|
18
18
|
def self.unpack(xDataQual, hMetadata, hResponseObj)
|
19
19
|
|
20
|
-
hResourceInfo = hMetadata[:resourceInfo]
|
21
|
-
|
22
20
|
# data quality 2.1 (attracc) - attribute accuracy (not implemented)
|
23
21
|
|
24
22
|
# data quality 2.2 (logic) - logical consistency (not implemented)
|
@@ -30,12 +28,14 @@ module ADIWG
|
|
30
28
|
# data quality 2.5 (lineage) - lineage
|
31
29
|
xLineage = xDataQual.xpath('./lineage')
|
32
30
|
unless xLineage.empty?
|
33
|
-
hLineage = Lineage.unpack(xLineage,
|
31
|
+
hLineage = Lineage.unpack(xLineage, hResponseObj)
|
34
32
|
unless hLineage.nil?
|
35
33
|
hMetadata[:lineageInfo] << hLineage
|
36
34
|
end
|
37
35
|
end
|
38
36
|
|
37
|
+
# data quality 2.6 (cloud) - cloud cover (not implemented)
|
38
|
+
|
39
39
|
return hMetadata
|
40
40
|
|
41
41
|
end
|
@@ -30,11 +30,11 @@ module ADIWG
|
|
30
30
|
axRanges.each do |xRange|
|
31
31
|
|
32
32
|
hRange = intMetadataClass.newValueRange
|
33
|
-
hAttribute[:
|
33
|
+
hAttribute[:valueRange] << hRange
|
34
34
|
|
35
35
|
# entity attribute 5.1.2.4.2.1 (rdommin) - range minimum
|
36
36
|
# -> dataDictionary.entities.attributes.minValue
|
37
|
-
# -> dataDictionary.entities.attributes.
|
37
|
+
# -> dataDictionary.entities.attributes.valueRange.minRangeValue
|
38
38
|
min = xRange.xpath('./rdommin').text
|
39
39
|
unless min.empty?
|
40
40
|
hRange[:minRangeValue] = min
|
@@ -52,7 +52,7 @@ module ADIWG
|
|
52
52
|
|
53
53
|
# entity attribute 5.1.2.4.2.2 (rdommax) - range maximum
|
54
54
|
# -> dataDictionary.entities.attributes.maxValue
|
55
|
-
# -> dataDictionary.entities.attributes.
|
55
|
+
# -> dataDictionary.entities.attributes.valueRange.maxRangeValue
|
56
56
|
max = xRange.xpath('./rdommax').text
|
57
57
|
unless max.empty?
|
58
58
|
hRange[:maxRangeValue] = max
|
@@ -30,7 +30,7 @@ module ADIWG
|
|
30
30
|
hGridInfo[:cellGeometry] = cellGeometry.downcase
|
31
31
|
end
|
32
32
|
|
33
|
-
# ->
|
33
|
+
# -> compute number of dimensions from total occurrence of 3.4.2-4
|
34
34
|
hGridInfo[:numberOfDimensions] = 0
|
35
35
|
|
36
36
|
# raster object 3.4.2 (rowcount) - row count
|
@@ -16,7 +16,7 @@ module ADIWG
|
|
16
16
|
|
17
17
|
module Source
|
18
18
|
|
19
|
-
def self.unpack(xSource,
|
19
|
+
def self.unpack(xSource, hResponseObj)
|
20
20
|
|
21
21
|
# instance classes needed in script
|
22
22
|
intMetadataClass = InternalMetadata.new
|
@@ -34,7 +34,7 @@ module ADIWG
|
|
34
34
|
unless scale.empty?
|
35
35
|
hResolution = intMetadataClass.newSpatialResolution
|
36
36
|
hResolution[:scaleFactor] = scale.to_i
|
37
|
-
|
37
|
+
hSource[:spatialResolution] = hResolution
|
38
38
|
end
|
39
39
|
|
40
40
|
# source 2.5.1.3 (typesrc) - type of source media
|
@@ -60,9 +60,9 @@ module ADIWG
|
|
60
60
|
end
|
61
61
|
|
62
62
|
# source 2.5.1.5 (srccitea) - source citation abbreviation
|
63
|
-
|
64
|
-
unless
|
65
|
-
hSource[:
|
63
|
+
sourceAbb = xSource.xpath('./srccitea').text
|
64
|
+
unless sourceAbb.empty?
|
65
|
+
hSource[:sourceId] = sourceAbb
|
66
66
|
end
|
67
67
|
|
68
68
|
# source 2.5.1.6 (srccontr) - source contribution
|
@@ -22,13 +22,15 @@ module ADIWG
|
|
22
22
|
intMetadataClass = InternalMetadata.new
|
23
23
|
|
24
24
|
# spatial organization 3.1 (indspref) - indirect spatial reference
|
25
|
-
# -> resourceInfo.spatialReferenceSystems.
|
25
|
+
# -> resourceInfo.spatialReferenceSystems.systemIdentifier.identifier per NOAA
|
26
26
|
# -> however definitions are not close
|
27
27
|
indirect = xSpatialOrg.xpath('./indspref').text
|
28
28
|
unless indirect.empty?
|
29
29
|
hSystem = intMetadataClass.newSpatialReferenceSystem
|
30
30
|
hIdentifier = intMetadataClass.newIdentifier
|
31
|
-
hIdentifier[:identifier] = indirect
|
31
|
+
hIdentifier[:identifier] = 'indirect'
|
32
|
+
hIdentifier[:namespace] = 'FGDC'
|
33
|
+
hIdentifier[:description] = indirect
|
32
34
|
hSystem[:systemIdentifier] = hIdentifier
|
33
35
|
hResourceInfo[:spatialReferenceSystems] << hSystem
|
34
36
|
end
|
@@ -40,13 +42,13 @@ module ADIWG
|
|
40
42
|
# -> raster = grid do 3.4
|
41
43
|
direct = xSpatialOrg.xpath('./direct').text
|
42
44
|
unless direct.empty?
|
43
|
-
type = '
|
45
|
+
type = 'point' if direct == 'Point'
|
44
46
|
type = 'vector' if direct == 'Vector'
|
45
47
|
type = 'grid' if direct == 'Raster'
|
46
48
|
hResourceInfo[:spatialRepresentationTypes] << type
|
47
49
|
|
48
50
|
# spatial organization 3.3 (ptvctinfo) - point and vector object
|
49
|
-
if type == 'vector'
|
51
|
+
if type == 'vector' || type == 'point'
|
50
52
|
xPtVec = xSpatialOrg.xpath('./ptvctinf')
|
51
53
|
unless xPtVec.empty?
|
52
54
|
PointVector.unpack(xPtVec, hResourceInfo, hResponseObj)
|