adiwg-mdtranslator 2.4.0 → 2.5.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 +51 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +33 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +68 -35
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +10 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +38 -19
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +68 -19
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +3 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +4 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +87 -79
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +150 -115
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +184 -113
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +56 -0
- data/lib/adiwg/mdtranslator/version.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +74 -38
- data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +130 -76
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +78 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +229 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +65 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +19 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_address.rb +103 -103
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +185 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionReference.rb +45 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +107 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +187 -187
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +123 -117
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +155 -141
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_gcoDateTime.rb +48 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +54 -55
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +56 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_series.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_attributeGroup.rb +51 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +181 -180
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +96 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_ellipsoidParameters.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +54 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +301 -298
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +229 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +49 -32
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_valueRange.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +33 -13
- metadata +22 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/version.rb +0 -16
@@ -0,0 +1,53 @@
|
|
1
|
+
# ISO <<Class>> MD_ObliqueLinePoint
|
2
|
+
# writer
|
3
|
+
# 19115-2 output for ISO 19115-2 XML
|
4
|
+
|
5
|
+
# History:
|
6
|
+
# Stan Smith 2017-10-26 original script
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso19115_2
|
12
|
+
|
13
|
+
class MD_ObliqueLinePoint
|
14
|
+
|
15
|
+
def initialize(xml, hResponseObj)
|
16
|
+
@xml = xml
|
17
|
+
@hResponseObj = hResponseObj
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(hLinePoint)
|
21
|
+
|
22
|
+
@xml.tag!('gmd:MD_ObliqueLinePoint') do
|
23
|
+
|
24
|
+
# oblique line point - azimuth line latitude {integer}
|
25
|
+
r = hLinePoint[:azimuthLineLatitude]
|
26
|
+
unless r.nil?
|
27
|
+
@xml.tag!('gmd:azimuthLineLatitude') do
|
28
|
+
@xml.tag!('gco:real', r.to_s)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
32
|
+
@xml.tag!('gmd:azimuthLineLatitude')
|
33
|
+
end
|
34
|
+
|
35
|
+
# oblique line point - azimuth line longitude {real}
|
36
|
+
r = hLinePoint[:azimuthLineLongitude]
|
37
|
+
unless r.nil?
|
38
|
+
@xml.tag!('gmd:azimuthLineLongitude') do
|
39
|
+
@xml.tag!('gco:real', r.to_s)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
43
|
+
@xml.tag!('gmd:azimuthLineLongitude')
|
44
|
+
end
|
45
|
+
|
46
|
+
end # gmd:MD_ObliqueLinePoint
|
47
|
+
end # writeXML
|
48
|
+
end # MD_ProjectionParameters class
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
# ISO <<Class>> MD_ProjectionParameters
|
2
|
+
# writer
|
3
|
+
# 19115-2 output for ISO 19115-2 XML
|
4
|
+
|
5
|
+
# History:
|
6
|
+
# Stan Smith 2017-10-26 original script
|
7
|
+
|
8
|
+
require_relative 'class_obliqueLinePoint'
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso19115_2
|
14
|
+
|
15
|
+
class MD_ProjectionParameters
|
16
|
+
|
17
|
+
def initialize(xml, hResponseObj)
|
18
|
+
@xml = xml
|
19
|
+
@hResponseObj = hResponseObj
|
20
|
+
end
|
21
|
+
|
22
|
+
def writeXML(hProjection)
|
23
|
+
|
24
|
+
# classes used
|
25
|
+
linePointClass = MD_ObliqueLinePoint.new(@xml, @hResponseObj)
|
26
|
+
|
27
|
+
@xml.tag!('gmd:MD_ProjectionParameters') do
|
28
|
+
|
29
|
+
# projection parameters - zone {integer}
|
30
|
+
i = hProjection[:zone]
|
31
|
+
unless i.nil?
|
32
|
+
@xml.tag!('gmd:zone') do
|
33
|
+
@xml.tag!('gco:integer', i.to_s)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
if i.nil? && @hResponseObj[:writerShowTags]
|
37
|
+
@xml.tag!('gmd:zone')
|
38
|
+
end
|
39
|
+
# projection parameters - standard parallel {real}
|
40
|
+
r = hProjection[:standardParallel1]
|
41
|
+
unless r.nil?
|
42
|
+
@xml.tag!('gmd:standardParallel') do
|
43
|
+
@xml.tag!('gco:real', r.to_s)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
47
|
+
@xml.tag!('gmd:standardParallel')
|
48
|
+
end
|
49
|
+
|
50
|
+
# projection parameters - standard parallel {real}
|
51
|
+
r = hProjection[:standardParallel2]
|
52
|
+
unless r.nil?
|
53
|
+
@xml.tag!('gmd:standardParallel') do
|
54
|
+
@xml.tag!('gco:real', r.to_s)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
58
|
+
@xml.tag!('gmd:standardParallel')
|
59
|
+
end
|
60
|
+
|
61
|
+
# projection parameters - longitude of central meridian {real}
|
62
|
+
r = hProjection[:longitudeOfCentralMeridian]
|
63
|
+
unless r.nil?
|
64
|
+
@xml.tag!('gmd:longitudeOfCentralMeridian') do
|
65
|
+
@xml.tag!('gco:real', r.to_s)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
69
|
+
@xml.tag!('gmd:longitudeOfCentralMeridian')
|
70
|
+
end
|
71
|
+
|
72
|
+
# projection parameters - latitude of projection origin {real}
|
73
|
+
r = hProjection[:latitudeOfProjectionOrigin]
|
74
|
+
unless r.nil?
|
75
|
+
@xml.tag!('gmd:latitudeOfProjectionOrigin') do
|
76
|
+
@xml.tag!('gco:real', r.to_s)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
80
|
+
@xml.tag!('gmd:latitudeOfProjectionOrigin')
|
81
|
+
end
|
82
|
+
|
83
|
+
# projection parameters - false easting {real}
|
84
|
+
r = hProjection[:falseEasting]
|
85
|
+
unless r.nil?
|
86
|
+
@xml.tag!('gmd:falseEasting') do
|
87
|
+
@xml.tag!('gco:real', r.to_s)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
91
|
+
@xml.tag!('gmd:falseEasting')
|
92
|
+
end
|
93
|
+
|
94
|
+
# projection parameters - false northing {real}
|
95
|
+
r = hProjection[:falseNorthing]
|
96
|
+
unless r.nil?
|
97
|
+
@xml.tag!('gmd:falseNorthing') do
|
98
|
+
@xml.tag!('gco:real', r.to_s)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
102
|
+
@xml.tag!('gmd:falseNorthing')
|
103
|
+
end
|
104
|
+
|
105
|
+
# projection parameters - false northing units
|
106
|
+
s = hProjection[:falseEastingNorthingUnits]
|
107
|
+
unless s.nil?
|
108
|
+
@xml.tag!('gmd:falseEastingNorthingUnits') do
|
109
|
+
@xml.tag!('gco:unit', s)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
113
|
+
@xml.tag!('gmd:falseEastingNorthingUnits')
|
114
|
+
end
|
115
|
+
|
116
|
+
# projection parameters - scale factor at equator {real}
|
117
|
+
r = hProjection[:scaleFactorAtEquator]
|
118
|
+
unless r.nil?
|
119
|
+
@xml.tag!('gmd:scaleFactorAtEquator') do
|
120
|
+
@xml.tag!('gco:real', r.to_s)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
124
|
+
@xml.tag!('gmd:scaleFactorAtEquator')
|
125
|
+
end
|
126
|
+
|
127
|
+
# projection parameters - height of prospective point above surface {real}
|
128
|
+
r = hProjection[:heightOfProspectivePointAboveSurface]
|
129
|
+
unless r.nil?
|
130
|
+
@xml.tag!('gmd:heightOfProspectivePointAboveSurface') do
|
131
|
+
@xml.tag!('gco:real', r.to_s)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
135
|
+
@xml.tag!('gmd:heightOfProspectivePointAboveSurface')
|
136
|
+
end
|
137
|
+
|
138
|
+
# projection parameters - longitude of projection center {real}
|
139
|
+
r = hProjection[:longitudeOfProjectionCenter]
|
140
|
+
unless r.nil?
|
141
|
+
@xml.tag!('gmd:longitudeOfProjectionCenter') do
|
142
|
+
@xml.tag!('gco:real', r.to_s)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
146
|
+
@xml.tag!('gmd:longitudeOfProjectionCenter')
|
147
|
+
end
|
148
|
+
|
149
|
+
# projection parameters - scale factor at center line {real}
|
150
|
+
r = hProjection[:scaleFactorAtCenterLine]
|
151
|
+
unless r.nil?
|
152
|
+
@xml.tag!('gmd:scaleFactorAtCenterLine') do
|
153
|
+
@xml.tag!('gco:real', r.to_s)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
157
|
+
@xml.tag!('gmd:scaleFactorAtCenterLine')
|
158
|
+
end
|
159
|
+
|
160
|
+
# projection parameters - straight vertical longitude from pole {real}
|
161
|
+
r = hProjection[:straightVerticalLongitudeFromPole]
|
162
|
+
unless r.nil?
|
163
|
+
@xml.tag!('gmd:straightVerticalLongitudeFromPole') do
|
164
|
+
@xml.tag!('gco:real', r.to_s)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
168
|
+
@xml.tag!('gmd:straightVerticalLongitudeFromPole')
|
169
|
+
end
|
170
|
+
|
171
|
+
# projection parameters - scale factor at projection origin {real}
|
172
|
+
r = hProjection[:scaleFactorAtProjectionOrigin]
|
173
|
+
unless r.nil?
|
174
|
+
@xml.tag!('gmd:scaleFactorAtProjectionOrigin') do
|
175
|
+
@xml.tag!('gco:real', r.to_s)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
if r.nil? && @hResponseObj[:writerShowTags]
|
179
|
+
@xml.tag!('gmd:scaleFactorAtProjectionOrigin')
|
180
|
+
end
|
181
|
+
|
182
|
+
# projection parameters - oblique line azimuth parameter
|
183
|
+
r1 = hProjection[:azimuthAngle]
|
184
|
+
r2 = hProjection[:azimuthMeasurePointLongitude]
|
185
|
+
unless r1.nil? && r2.nil?
|
186
|
+
@xml.tag!('gmd:obliqueLineAzimuthParameter') do
|
187
|
+
@xml.tag!('gmd:MD_ObliqueLineAzimuth') do
|
188
|
+
unless r1.nil?
|
189
|
+
@xml.tag!('gmd:azimuthAngle') do
|
190
|
+
@xml.tag!('gco:real', r1.to_s)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
if r1.nil? && @hResponseObj[:writerShowTags]
|
194
|
+
@xml.tag!('gmd:azimuthAngle')
|
195
|
+
end
|
196
|
+
unless r2.nil?
|
197
|
+
@xml.tag!('gmd:azimuthMeasurePointLongitude') do
|
198
|
+
@xml.tag!('gco:real', r2.to_s)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
if r2.nil? && @hResponseObj[:writerShowTags]
|
202
|
+
@xml.tag!('gmd:azimuthMeasurePointLongitude')
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
if r1.nil? && r2.nil? && @hResponseObj[:writerShowTags]
|
208
|
+
@xml.tag!('gmd:obliqueLineAzimuthParameter')
|
209
|
+
end
|
210
|
+
|
211
|
+
# projection parameters - oblique line point parameter
|
212
|
+
aLinePoints = hProjection[:obliqueLinePoints]
|
213
|
+
aLinePoints.each do |hLinePoint|
|
214
|
+
@xml.tag!('gmd:obliqueLinePointParameter') do
|
215
|
+
linePointClass.writeXML(hLinePoint)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
if aLinePoints.empty? && @hResponseObj[:writerShowTags]
|
219
|
+
@xml.tag!('gmd:obliqueLinePointParameter')
|
220
|
+
end
|
221
|
+
|
222
|
+
end # gmd:MD_ProjectionParameters
|
223
|
+
end # writeXML
|
224
|
+
end # MD_ProjectionParameters class
|
225
|
+
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -3,49 +3,66 @@
|
|
3
3
|
# 19115-2 output for ISO 19115-2 XML
|
4
4
|
|
5
5
|
# History:
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
6
|
+
# Stan Smith 2017-10-26 added crs class
|
7
|
+
# Stan Smith 2016-12-07 refactored for mdTranslator/mdJson 2.0
|
8
|
+
# Stan Smith 2015-08-28 convert referenceSystem to resourceId and pass to RS_Identifier
|
9
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
10
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
11
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
12
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
13
|
# Stan Smith 2014-09-03 original script
|
13
14
|
|
14
15
|
require_relative 'class_rsIdentifier'
|
16
|
+
require_relative 'class_crs'
|
15
17
|
|
16
18
|
module ADIWG
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
module Mdtranslator
|
20
|
+
module Writers
|
21
|
+
module Iso19115_2
|
20
22
|
|
21
|
-
|
23
|
+
class MD_ReferenceSystem
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
def initialize(xml, hResponseObj)
|
26
|
+
@xml = xml
|
27
|
+
@hResponseObj = hResponseObj
|
28
|
+
end
|
27
29
|
|
28
|
-
|
30
|
+
def writeXML(hSystem)
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
+
# classes used
|
33
|
+
idClass = RS_Identifier.new(@xml, @hResponseObj)
|
34
|
+
crsClass = MD_CRS.new(@xml, @hResponseObj)
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
# determine reference system class to write
|
37
|
+
if hSystem[:systemParameterSet].empty?
|
38
|
+
refClass = 'gmd:MD_ReferenceSystem'
|
39
|
+
else
|
40
|
+
refClass = 'gmd:MD_CRS'
|
41
|
+
end
|
42
|
+
@xml.tag!(refClass) do
|
43
|
+
|
44
|
+
# reference system identifier {rsIdentifier}
|
45
|
+
hIdentifier = hSystem[:systemIdentifier]
|
46
|
+
unless hIdentifier.empty?
|
47
|
+
@xml.tag!('gmd:referenceSystemIdentifier') do
|
48
|
+
idClass.writeXML(hIdentifier)
|
43
49
|
end
|
50
|
+
end
|
51
|
+
if hIdentifier.empty? && @hResponseObj[:writerShowTags]
|
52
|
+
@xml.tag!('gmd:referenceSystemIdentifier')
|
53
|
+
end
|
54
|
+
|
55
|
+
# CRS identifiers and parameters
|
56
|
+
if refClass == 'gmd:MD_CRS'
|
57
|
+
crsClass.writeXML(hSystem[:systemParameterSet])
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
44
61
|
|
45
|
-
|
46
|
-
|
62
|
+
end # writeXML
|
63
|
+
end # MD_ReferenceSystem class
|
47
64
|
|
48
|
-
|
49
|
-
|
50
|
-
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
51
68
|
end
|
@@ -1,10 +1,12 @@
|
|
1
1
|
# mdJson 2.0 writer - domain
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Stan Smith 2017-11-01 add domainDescription
|
5
|
+
# Stan Smith 2017-03-19 refactored for mdJson/mdTranslator 2.0
|
6
|
+
# Josh Bradley original script
|
6
7
|
|
7
8
|
require 'jbuilder'
|
9
|
+
require_relative 'mdJson_citation'
|
8
10
|
require_relative 'mdJson_domainItem'
|
9
11
|
|
10
12
|
module ADIWG
|
@@ -23,6 +25,7 @@ module ADIWG
|
|
23
25
|
json.commonName hDomain[:domainName]
|
24
26
|
json.codeName hDomain[:domainCode]
|
25
27
|
json.description hDomain[:domainDescription]
|
28
|
+
json.domainReference Citation.build(hDomain[:domainReference]) unless hDomain[:domainReference].empty?
|
26
29
|
json.domainItem @Namespace.json_map(hDomain[:domainItems], DomainItem)
|
27
30
|
end
|
28
31
|
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# mdJson 2.0 writer - entity
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
4
|
+
# Stan Smith 2017-11-01 add new elements to support fgdc
|
5
|
+
# Stan Smith 2017-03-19 original script
|
5
6
|
|
6
7
|
require 'jbuilder'
|
8
|
+
require_relative 'mdJson_citation'
|
7
9
|
require_relative 'mdJson_entityAttribute'
|
8
10
|
require_relative 'mdJson_entityIndex'
|
9
11
|
require_relative 'mdJson_entityForeignKey'
|
@@ -25,10 +27,14 @@ module ADIWG
|
|
25
27
|
json.codeName hEntity[:entityCode]
|
26
28
|
json.alias hEntity[:entityAlias] unless hEntity[:entityAlias].empty?
|
27
29
|
json.definition hEntity[:entityDefinition]
|
30
|
+
json.entityReference @Namespace.json_map(hEntity[:entityReferences], Citation)
|
28
31
|
json.primaryKeyAttributeCodeName hEntity[:primaryKey] unless hEntity[:primaryKey].empty?
|
29
32
|
json.index @Namespace.json_map(hEntity[:indexes], EntityIndex)
|
30
33
|
json.attribute @Namespace.json_map(hEntity[:attributes], EntityAttribute)
|
31
34
|
json.foreignKey @Namespace.json_map(hEntity[:foreignKeys], EntityForeignKey)
|
35
|
+
json.fieldSeparatorCharacter hEntity[:fieldSeparatorCharacter]
|
36
|
+
json.numberOfHeaderLines hEntity[:numberOfHeaderLines]
|
37
|
+
json.quoteCharacter hEntity[:quoteCharacter]
|
32
38
|
end
|
33
39
|
|
34
40
|
end # build
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# mdJson 2.0 writer - entity attribute
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Stan Smith 2017-11-01 added new elements to support fgdc
|
5
|
+
# Stan Smith 2017-03-19 refactored for mdJson/mdTranslator 2.0
|
6
|
+
# Josh Bradley original script
|
6
7
|
|
7
8
|
require 'jbuilder'
|
9
|
+
require_relative 'mdJson_citation'
|
10
|
+
require_relative 'mdJson_valueRange'
|
11
|
+
require_relative 'mdJson_timePeriod'
|
8
12
|
|
9
13
|
module ADIWG
|
10
14
|
module Mdtranslator
|
@@ -13,6 +17,8 @@ module ADIWG
|
|
13
17
|
|
14
18
|
module EntityAttribute
|
15
19
|
|
20
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
21
|
+
|
16
22
|
def self.build(hAttribute)
|
17
23
|
|
18
24
|
Jbuilder.new do |json|
|
@@ -20,13 +26,23 @@ module ADIWG
|
|
20
26
|
json.codeName hAttribute[:attributeCode]
|
21
27
|
json.alias hAttribute[:attributeAlias] unless hAttribute[:attributeAlias].empty?
|
22
28
|
json.definition hAttribute[:attributeDefinition]
|
29
|
+
unless hAttribute[:attributeReference].empty?
|
30
|
+
json.attributeReference Citation.build(hAttribute[:attributeReference])
|
31
|
+
end
|
23
32
|
json.dataType hAttribute[:dataType]
|
24
33
|
json.allowNull hAttribute[:allowNull]
|
25
34
|
json.allowMany hAttribute[:allowMany]
|
26
35
|
json.units hAttribute[:unitOfMeasure]
|
36
|
+
json.unitsResolution hAttribute[:measureResolution]
|
37
|
+
json.isCaseSensitive hAttribute[:isCaseSensitive]
|
38
|
+
json.fieldWidth hAttribute[:fieldWidth]
|
39
|
+
json.missingValue hAttribute[:missingValue]
|
27
40
|
json.domainId hAttribute[:domainId]
|
28
41
|
json.minValue hAttribute[:minValue]
|
29
42
|
json.maxValue hAttribute[:maxValue]
|
43
|
+
json.rangeOfValues @Namespace.json_map(hAttribute[:rangeOfValues], ValueRange)
|
44
|
+
json.timePeriodOfValues @Namespace.json_map(hAttribute[:timePeriodOfValues], TimePeriod)
|
45
|
+
|
30
46
|
end
|
31
47
|
|
32
48
|
end # build
|