adiwg-mdtranslator 2.10.0 → 2.12.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
- data/lib/adiwg/mdtranslator/version.rb +8 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
- data/lib/adiwg/mdtranslator_cli.rb +18 -8
- metadata +14 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -3,8 +3,10 @@
|
|
3
3
|
# to define the domain of an attribute
|
4
4
|
|
5
5
|
# History:
|
6
|
+
# Stan Smith 2018-04-04 refactored error and warning messaging
|
6
7
|
# Stan Smith 2017-11-02 original script
|
7
8
|
|
9
|
+
require_relative '../iso19110_writer'
|
8
10
|
require_relative 'class_listedValue'
|
9
11
|
require_relative 'class_definitionReference'
|
10
12
|
|
@@ -18,20 +20,23 @@ module ADIWG
|
|
18
20
|
def initialize(xml, responseObj)
|
19
21
|
@xml = xml
|
20
22
|
@hResponseObj = responseObj
|
23
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
21
24
|
end
|
22
25
|
|
23
|
-
def writeXML(hDomain)
|
26
|
+
def writeXML(hDomain, inContext)
|
24
27
|
|
25
28
|
# classes used
|
26
29
|
listClass = FC_ListedValue.new(@xml, @hResponseObj)
|
27
30
|
defRefClass = FC_DefinitionReference.new(@xml, @hResponseObj)
|
28
31
|
|
32
|
+
outContext = hDomain[:domainCode]
|
33
|
+
|
29
34
|
# if have domainItems treat as enumerated list
|
30
35
|
aItems = hDomain[:domainItems]
|
31
36
|
unless aItems.empty?
|
32
37
|
aItems.each do |hItem|
|
33
38
|
@xml.tag!('gfc:listedValue') do
|
34
|
-
listClass.writeXML(hItem)
|
39
|
+
listClass.writeXML(hItem, outContext)
|
35
40
|
end
|
36
41
|
end
|
37
42
|
return
|
@@ -45,7 +50,7 @@ module ADIWG
|
|
45
50
|
|
46
51
|
# label
|
47
52
|
if hDomain[:domainName].nil?
|
48
|
-
@
|
53
|
+
@NameSpace.issueWarning(100, 'gfc:label')
|
49
54
|
else
|
50
55
|
@xml.tag!('gfc:label') do
|
51
56
|
@xml.tag!('gco:CharacterString', hDomain[:domainName])
|
@@ -73,28 +78,30 @@ module ADIWG
|
|
73
78
|
end
|
74
79
|
|
75
80
|
# if have definition only treat as unrepresentable domain
|
76
|
-
|
77
|
-
@xml.tag!('gfc:
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
@xml.tag!('
|
81
|
+
unless hDomain[:domainDescription].nil?
|
82
|
+
@xml.tag!('gfc:listedValue') do
|
83
|
+
@xml.tag!('gfc:FC_ListedValue') do
|
84
|
+
|
85
|
+
# label
|
86
|
+
if hDomain[:domainName].nil?
|
87
|
+
@NameSpace.issueWarning(101, 'gfc:label')
|
88
|
+
else
|
89
|
+
@xml.tag!('gfc:label') do
|
90
|
+
@xml.tag!('gco:CharacterString', hDomain[:domainName])
|
91
|
+
end
|
85
92
|
end
|
86
|
-
end
|
87
93
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
94
|
+
# definition
|
95
|
+
unless hDomain[:domainDescription].nil?
|
96
|
+
@xml.tag!('gfc:definition') do
|
97
|
+
@xml.tag!('gco:CharacterString', hDomain[:domainDescription])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
if hDomain[:domainDescription].empty? && @hResponseObj[:writerShowTags]
|
101
|
+
@xml.tag!('gfc:definition')
|
92
102
|
end
|
93
|
-
end
|
94
|
-
if hDomain[:domainDescription].empty? && @hResponseObj[:writerShowTags]
|
95
|
-
@xml.tag!('gfc:definition')
|
96
|
-
end
|
97
103
|
|
104
|
+
end
|
98
105
|
end
|
99
106
|
end
|
100
107
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
5
6
|
# Stan Smith 2017-01-20 refactored for mdJson/mdTranslator 2.0
|
6
7
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
7
8
|
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
@@ -10,6 +11,7 @@
|
|
10
11
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
11
12
|
# Stan Smith 2013-12-01 original script
|
12
13
|
|
14
|
+
require_relative '../iso19110_writer'
|
13
15
|
require_relative 'class_locale'
|
14
16
|
require_relative 'class_responsibleParty'
|
15
17
|
require_relative 'class_featureType'
|
@@ -24,6 +26,7 @@ module ADIWG
|
|
24
26
|
def initialize(xml, responseObj)
|
25
27
|
@xml = xml
|
26
28
|
@hResponseObj = responseObj
|
29
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
27
30
|
end
|
28
31
|
|
29
32
|
def writeXML(intObj)
|
@@ -85,7 +88,7 @@ module ADIWG
|
|
85
88
|
end
|
86
89
|
end
|
87
90
|
if name.nil?
|
88
|
-
@
|
91
|
+
@NameSpace.issueWarning(40, 'gmx:name')
|
89
92
|
end
|
90
93
|
|
91
94
|
# feature catalogue - scope (required) []
|
@@ -95,8 +98,8 @@ module ADIWG
|
|
95
98
|
@xml.tag!('gco:CharacterString', scope)
|
96
99
|
end
|
97
100
|
end
|
98
|
-
if aScopes.empty?
|
99
|
-
@
|
101
|
+
if aScopes.empty?
|
102
|
+
@NameSpace.issueWarning(41, 'gmx:scope')
|
100
103
|
end
|
101
104
|
|
102
105
|
# feature catalogue - field of application []
|
@@ -117,7 +120,7 @@ module ADIWG
|
|
117
120
|
end
|
118
121
|
end
|
119
122
|
if version.nil?
|
120
|
-
@
|
123
|
+
@NameSpace.issueWarning(42, 'gmx:versionNumber')
|
121
124
|
end
|
122
125
|
|
123
126
|
# feature catalogue - version date (required)
|
@@ -135,7 +138,7 @@ module ADIWG
|
|
135
138
|
end
|
136
139
|
end
|
137
140
|
if sDate.nil?
|
138
|
-
@
|
141
|
+
@NameSpace.issueWarning(43, 'gmx:versionDate')
|
139
142
|
end
|
140
143
|
|
141
144
|
# feature catalogue - locale []
|
@@ -163,8 +166,8 @@ module ADIWG
|
|
163
166
|
end
|
164
167
|
end
|
165
168
|
end
|
166
|
-
if hParty.empty?
|
167
|
-
@
|
169
|
+
if hParty.empty?
|
170
|
+
@NameSpace.issueWarning(44, 'gfc:producer')
|
168
171
|
end
|
169
172
|
|
170
173
|
# feature catalogue - functional language
|
@@ -178,7 +181,7 @@ module ADIWG
|
|
178
181
|
@xml.tag!('gfc:functionalLanguage')
|
179
182
|
end
|
180
183
|
|
181
|
-
# feature catalogue - feature type (required)
|
184
|
+
# feature catalogue - feature type [] (required)
|
182
185
|
# use feature type to represent date entities
|
183
186
|
unless aEntities.empty?
|
184
187
|
aEntities.each do |hEntity|
|
@@ -188,7 +191,7 @@ module ADIWG
|
|
188
191
|
end
|
189
192
|
end
|
190
193
|
if aEntities.empty?
|
191
|
-
@
|
194
|
+
@NameSpace.issueWarning(45, 'gfc:featureType')
|
192
195
|
end
|
193
196
|
|
194
197
|
return metadata
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# create attributes for entities
|
4
4
|
|
5
5
|
# History:
|
6
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
6
7
|
# Stan Smith 2017-11-02 split out domain from attribute
|
7
8
|
# Stan Smith 2017-02-02 refactored for mdTranslator/mdJson 2.0
|
8
9
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
@@ -11,6 +12,7 @@
|
|
11
12
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
13
|
# Stan Smith 2014-12-02 original script
|
13
14
|
|
15
|
+
require_relative '../iso19110_writer'
|
14
16
|
require_relative 'class_multiplicity'
|
15
17
|
require_relative 'class_unitsOfMeasure'
|
16
18
|
require_relative 'class_definitionReference'
|
@@ -26,6 +28,7 @@ module ADIWG
|
|
26
28
|
def initialize(xml, responseObj)
|
27
29
|
@xml = xml
|
28
30
|
@hResponseObj = responseObj
|
31
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
29
32
|
end
|
30
33
|
|
31
34
|
def writeXML(hAttribute)
|
@@ -38,6 +41,8 @@ module ADIWG
|
|
38
41
|
|
39
42
|
@xml.tag!('gfc:FC_FeatureAttribute') do
|
40
43
|
|
44
|
+
outContext = hAttribute[:attributeCode]
|
45
|
+
|
41
46
|
# feature attribute - member name (required)
|
42
47
|
# used for attribute common name
|
43
48
|
s = hAttribute[:attributeName]
|
@@ -47,7 +52,7 @@ module ADIWG
|
|
47
52
|
end
|
48
53
|
end
|
49
54
|
if s.nil?
|
50
|
-
@
|
55
|
+
@NameSpace.issueWarning(50, 'gfc:memberName', outContext)
|
51
56
|
end
|
52
57
|
|
53
58
|
# feature attribute - definition
|
@@ -63,6 +68,7 @@ module ADIWG
|
|
63
68
|
end
|
64
69
|
|
65
70
|
# feature attribute - cardinality (required)
|
71
|
+
# no test required, values come from Boolean values
|
66
72
|
@xml.tag!('gfc:cardinality') do
|
67
73
|
multiClass.writeXML(hAttribute)
|
68
74
|
end
|
@@ -100,7 +106,7 @@ module ADIWG
|
|
100
106
|
@xml.tag!('gfc:valueMeasurementUnit')
|
101
107
|
end
|
102
108
|
|
103
|
-
# feature attribute - value type
|
109
|
+
# feature attribute - value type {datatype}
|
104
110
|
s = hAttribute[:dataType]
|
105
111
|
unless s.nil?
|
106
112
|
@xml.tag!('gfc:valueType') do
|
@@ -121,7 +127,7 @@ module ADIWG
|
|
121
127
|
# find domain in domain array
|
122
128
|
hDomain = ADIWG::Mdtranslator::Writers::Iso19110.getDomain(domainID)
|
123
129
|
unless hDomain.empty?
|
124
|
-
domainClass.writeXML(hDomain)
|
130
|
+
domainClass.writeXML(hDomain, outContext)
|
125
131
|
end
|
126
132
|
end
|
127
133
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
5
6
|
# Stan Smith 2017-11-02 add entity reference
|
6
7
|
# Stan Smith 2017-02-03 refactored for mdJson/mdTranslator 2.0
|
7
8
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
@@ -11,6 +12,7 @@
|
|
11
12
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
13
|
# Stan Smith 2014-12-02 original script
|
13
14
|
|
15
|
+
require_relative '../iso19110_writer'
|
14
16
|
require_relative 'class_featureConstraint'
|
15
17
|
require_relative 'class_featureAttribute'
|
16
18
|
require_relative 'class_definitionReference'
|
@@ -25,6 +27,7 @@ module ADIWG
|
|
25
27
|
def initialize(xml, responseObj)
|
26
28
|
@xml = xml
|
27
29
|
@hResponseObj = responseObj
|
30
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
28
31
|
end
|
29
32
|
|
30
33
|
def writeXML(hEntity)
|
@@ -45,6 +48,8 @@ module ADIWG
|
|
45
48
|
|
46
49
|
@xml.tag!('gfc:FC_FeatureType', {'id' => entityId}) do
|
47
50
|
|
51
|
+
outContext = hEntity[:entityCode]
|
52
|
+
|
48
53
|
# feature type - type name (required)
|
49
54
|
# used for entity common name
|
50
55
|
s = hEntity[:entityName]
|
@@ -54,7 +59,7 @@ module ADIWG
|
|
54
59
|
end
|
55
60
|
end
|
56
61
|
if s.nil?
|
57
|
-
@
|
62
|
+
@NameSpace.issueWarning(60, 'gfc:typeName', outContext)
|
58
63
|
end
|
59
64
|
|
60
65
|
# feature type - definition
|
@@ -96,8 +101,8 @@ module ADIWG
|
|
96
101
|
|
97
102
|
# feature type - feature catalogue (required)
|
98
103
|
# 'role that links this feature type to the feature catalogue that contains it'
|
99
|
-
# confusing
|
100
|
-
# just set
|
104
|
+
# confusing?, allows definition of another feature catalogue here
|
105
|
+
# just set nilReason = 'inapplicable' (as recommended by NOAA)
|
101
106
|
@xml.tag!('gfc:featureCatalogue', {'gco:nilReason' => 'inapplicable'})
|
102
107
|
|
103
108
|
# feature type - constrained by
|
@@ -2,9 +2,8 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
# to define the domain of an attribute
|
4
4
|
|
5
|
-
require_relative 'class_definitionReference'
|
6
|
-
|
7
5
|
# History:
|
6
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
8
7
|
# Stan Smith 2018-01-25 add support for domain itemReference
|
9
8
|
# Stan Smith 2017-02-03 refactored for mdJson/mdTranslator 2.0
|
10
9
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
@@ -13,6 +12,9 @@ require_relative 'class_definitionReference'
|
|
13
12
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
14
13
|
# Stan Smith 2014-12-02 original script
|
15
14
|
|
15
|
+
require_relative '../iso19110_writer'
|
16
|
+
require_relative 'class_definitionReference'
|
17
|
+
|
16
18
|
module ADIWG
|
17
19
|
module Mdtranslator
|
18
20
|
module Writers
|
@@ -23,9 +25,10 @@ module ADIWG
|
|
23
25
|
def initialize(xml, responseObj)
|
24
26
|
@xml = xml
|
25
27
|
@hResponseObj = responseObj
|
28
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
26
29
|
end
|
27
30
|
|
28
|
-
def writeXML(hItem)
|
31
|
+
def writeXML(hItem, inContext)
|
29
32
|
|
30
33
|
# classes used
|
31
34
|
defRefClass = FC_DefinitionReference.new(@xml, @hResponseObj)
|
@@ -41,7 +44,7 @@ module ADIWG
|
|
41
44
|
end
|
42
45
|
end
|
43
46
|
if s.nil?
|
44
|
-
@
|
47
|
+
@NameSpace.issueWarning(70, 'gfc:label', inContext)
|
45
48
|
end
|
46
49
|
|
47
50
|
# listed value - code
|
@@ -2,68 +2,71 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
6
|
+
# Stan Smith 2016-11-21 refactored for mdTranslator/mdJson 2.0
|
6
7
|
# Stan Smith 2015-07-28 original script.
|
7
8
|
|
9
|
+
require_relative '../iso19110_writer'
|
8
10
|
require_relative 'class_codelist'
|
9
11
|
|
10
12
|
module ADIWG
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso19110
|
14
16
|
|
15
|
-
|
17
|
+
class PT_Locale
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
def initialize(xml, hResponseObj)
|
20
|
+
@xml = xml
|
21
|
+
@hResponseObj = hResponseObj
|
22
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
23
|
+
end
|
21
24
|
|
22
|
-
|
25
|
+
def writeXML(hLocale)
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
# classes used
|
28
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
26
29
|
|
27
|
-
|
30
|
+
@xml.tag!('gmd:PT_Locale') do
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
# locale - language (required)
|
33
|
+
s = hLocale[:languageCode]
|
34
|
+
unless s.nil?
|
35
|
+
@xml.tag!('gmd:languageCode') do
|
36
|
+
codelistClass.writeXML('gmd', 'iso_language', s)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if s.nil?
|
40
|
+
@NameSpace.issueWarning(80, 'gmd:languageCode')
|
41
|
+
end
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
# locale - country
|
44
|
+
s = hLocale[:countryCode]
|
45
|
+
unless s.nil?
|
46
|
+
@xml.tag!('gmd:country') do
|
47
|
+
codelistClass.writeXML('gmd', 'iso_countries', s)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
51
|
+
@xml.tag!('gmd:country')
|
52
|
+
end
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
54
|
+
# locale - character encoding (required)
|
55
|
+
s = hLocale[:characterEncoding]
|
56
|
+
unless s.nil?
|
57
|
+
@xml.tag!('gmd:characterEncoding') do
|
58
|
+
codelistClass.writeXML('gmd', 'iso_characterSet', s)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
if s.nil?
|
62
|
+
@NameSpace.issueWarning(81, 'gmd:characterEncoding')
|
63
|
+
end
|
61
64
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
end # gmd:PT_Locale
|
66
|
+
end # writeXML
|
67
|
+
end # gmd:PT_Locale class
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
69
72
|
end
|
@@ -2,8 +2,10 @@
|
|
2
2
|
# 19115-2 output for ISO 19115-2 XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
5
6
|
# Stan Smith 2017-11-02 original script
|
6
7
|
|
8
|
+
require_relative '../iso19110_writer'
|
7
9
|
require_relative 'class_citation'
|
8
10
|
|
9
11
|
module ADIWG
|
@@ -16,6 +18,7 @@ module ADIWG
|
|
16
18
|
def initialize(xml, hResponseObj)
|
17
19
|
@xml = xml
|
18
20
|
@hResponseObj = hResponseObj
|
21
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
19
22
|
end
|
20
23
|
|
21
24
|
def writeXML(hIdentifier)
|
@@ -39,7 +42,7 @@ module ADIWG
|
|
39
42
|
# identifier - code (required)
|
40
43
|
s = hIdentifier[:identifier]
|
41
44
|
if s.nil?
|
42
|
-
@
|
45
|
+
@NameSpace.issueWarning(90, 'gmd:code')
|
43
46
|
else
|
44
47
|
@xml.tag!('gmd:code') do
|
45
48
|
@xml.tag!('gco:CharacterString', s)
|
@@ -37,8 +37,23 @@ module ADIWG
|
|
37
37
|
def writeXML(hAttribute)
|
38
38
|
|
39
39
|
# xml for iso classes Multiplicity and MultiplicityRange
|
40
|
+
# in 19110 cardinality is expressed as multiplicity, a min/max range
|
41
|
+
# Multiplicity is not defined in the documentation, only inferred from the XSD
|
42
|
+
# max cardinality -----------------
|
40
43
|
# ISO 19110-2 rule
|
41
44
|
# ... "If this is an attribute or operation, the default cardinality is 1"
|
45
|
+
# there is no hint if this refers to min or max of the range, I chose max
|
46
|
+
# I assume this means the attribute can occur only once in the entity
|
47
|
+
# I set the internal object mustBeUnique = true as default
|
48
|
+
# I assume false would describe something like a repeating tag in an XML file
|
49
|
+
# min cardinality -----------------
|
50
|
+
# mdJson allows setting flag to allow nulls as attribute values
|
51
|
+
# I set this into minimum cardinality
|
52
|
+
# issue ---------------------------
|
53
|
+
# min cardinality refers to the attribute values
|
54
|
+
# max cardinality refers to the attribute instantiation
|
55
|
+
# perhaps one of these should not be carried in ISO19110
|
56
|
+
|
42
57
|
minCard = 1
|
43
58
|
maxCard = 9
|
44
59
|
if hAttribute[:allowNull]
|