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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -1
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +33 -2
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +68 -35
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +66 -0
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +7 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +10 -1
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +38 -19
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +68 -19
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +3 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +4 -2
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +87 -79
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +150 -115
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +184 -113
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +56 -0
  16. data/lib/adiwg/mdtranslator/version.rb +7 -1
  17. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +3 -3
  18. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +6 -6
  19. data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +74 -38
  20. data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +68 -0
  21. data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +130 -76
  22. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +78 -0
  23. data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +1 -1
  24. data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +37 -0
  25. data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +229 -0
  26. data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +65 -0
  27. data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +19 -1
  28. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +69 -0
  29. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_address.rb +103 -103
  30. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +185 -0
  31. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +60 -0
  32. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionReference.rb +45 -0
  33. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +107 -0
  34. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +187 -187
  35. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +123 -117
  36. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +155 -141
  37. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_gcoDateTime.rb +48 -0
  38. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +54 -55
  39. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +56 -0
  40. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_series.rb +63 -0
  41. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_attributeGroup.rb +51 -50
  42. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +181 -180
  43. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +96 -0
  44. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_ellipsoidParameters.rb +62 -0
  45. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +54 -54
  46. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +301 -298
  47. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +53 -0
  48. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +229 -0
  49. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +49 -32
  50. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +5 -2
  51. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +7 -1
  52. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +18 -2
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_valueRange.rb +28 -0
  54. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +33 -13
  55. metadata +22 -4
  56. data/lib/adiwg/mdtranslator/readers/mdJson/version.rb +0 -16
@@ -0,0 +1,229 @@
1
+ # HTML writer
2
+ # spatial reference system projection parameters
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-24 original script
6
+
7
+ require_relative 'html_identifier'
8
+ require_relative 'html_obliqueLinePoint'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Writers
13
+ module Html
14
+
15
+ class Html_ProjectionParameters
16
+
17
+ def initialize(html)
18
+ @html = html
19
+ end
20
+
21
+ def writeHtml(hProjection)
22
+
23
+ # classes used
24
+ identifierClass = Html_Identifier.new(@html)
25
+ linePointClass = Html_ObliqueLinePoint.new()
26
+
27
+ # projection parameters - projection name
28
+ unless hProjection[:projectionName].nil?
29
+ @html.em('Projection Name: ')
30
+ @html.text!(hProjection[:projectionName])
31
+ @html.br
32
+ end
33
+
34
+ # projection parameters - zone
35
+ unless hProjection[:zone].nil?
36
+ @html.em('Projection Zone: ')
37
+ @html.text!(hProjection[:zone])
38
+ @html.br
39
+ end
40
+
41
+ # projection parameters - Standard Parallel 1
42
+ unless hProjection[:standardParallel1].nil?
43
+ @html.em('Standard Parallel: ')
44
+ @html.text!(hProjection[:standardParallel1].to_s)
45
+ @html.br
46
+ end
47
+
48
+ # projection parameters - Standard Parallel 2
49
+ unless hProjection[:standardParallel2].nil?
50
+ @html.em('Standard Parallel: ')
51
+ @html.text!(hProjection[:standardParallel2].to_s)
52
+ @html.br
53
+ end
54
+
55
+ # projection parameters - Longitude of Central Meridian
56
+ unless hProjection[:longitudeOfCentralMeridian].nil?
57
+ @html.em('Longitude of Central Meridian: ')
58
+ @html.text!(hProjection[:longitudeOfCentralMeridian].to_s)
59
+ @html.br
60
+ end
61
+
62
+ # projection parameters - latitude of projection origin
63
+ unless hProjection[:latitudeOfProjectionOrigin].nil?
64
+ @html.em('Latitude of Projection Origin: ')
65
+ @html.text!(hProjection[:latitudeOfProjectionOrigin].to_s)
66
+ @html.br
67
+ end
68
+
69
+ # projection parameters - false easting
70
+ unless hProjection[:falseEasting].nil?
71
+ @html.em('False Easting: ')
72
+ @html.text!(hProjection[:falseEasting].to_s)
73
+ @html.br
74
+ end
75
+
76
+ # projection parameters - false northing
77
+ unless hProjection[:falseNorthing].nil?
78
+ @html.em('False Northing: ')
79
+ @html.text!(hProjection[:falseNorthing].to_s)
80
+ @html.br
81
+ end
82
+
83
+ # projection parameters - false easting-northing units
84
+ unless hProjection[:falseEastingNorthingUnits].nil?
85
+ @html.em('False Easting-Northing Units: ')
86
+ @html.text!(hProjection[:falseEastingNorthingUnits])
87
+ @html.br
88
+ end
89
+
90
+ # projection parameters - scale factor at equator
91
+ unless hProjection[:scaleFactorAtEquator].nil?
92
+ @html.em('Scale Factor at Equator: ')
93
+ @html.text!(hProjection[:scaleFactorAtEquator].to_s)
94
+ @html.br
95
+ end
96
+
97
+ # projection parameters - height of prospective point above surface
98
+ unless hProjection[:heightOfProspectivePointAboveSurface].nil?
99
+ @html.em('Height of Prospective Point Above Surface: ')
100
+ @html.text!(hProjection[:heightOfProspectivePointAboveSurface].to_s)
101
+ @html.br
102
+ end
103
+
104
+ # projection parameters - longitude of projection center
105
+ unless hProjection[:longitudeOfProjectionCenter].nil?
106
+ @html.em('Longitude of Projection Center: ')
107
+ @html.text!(hProjection[:longitudeOfProjectionCenter].to_s)
108
+ @html.br
109
+ end
110
+
111
+ # projection parameters - latitude of projection center
112
+ unless hProjection[:latitudeOfProjectionCenter].nil?
113
+ @html.em('Latitude of Projection Center: ')
114
+ @html.text!(hProjection[:latitudeOfProjectionCenter].to_s)
115
+ @html.br
116
+ end
117
+
118
+ # projection parameters - scale factor at center line
119
+ unless hProjection[:scaleFactorAtCenterLine].nil?
120
+ @html.em('Scale Factor at Center Line: ')
121
+ @html.text!(hProjection[:scaleFactorAtCenterLine].to_s)
122
+ @html.br
123
+ end
124
+
125
+ # projection parameters - scale factor at central meridian
126
+ unless hProjection[:scaleFactorAtCentralMeridian].nil?
127
+ @html.em('Scale Factor at Central Meridian: ')
128
+ @html.text!(hProjection[:scaleFactorAtCentralMeridian].to_s)
129
+ @html.br
130
+ end
131
+
132
+ # projection parameters - straight vertical longitude from pole
133
+ unless hProjection[:straightVerticalLongitudeFromPole].nil?
134
+ @html.em('Straight Vertical Longitude From Pole: ')
135
+ @html.text!(hProjection[:straightVerticalLongitudeFromPole].to_s)
136
+ @html.br
137
+ end
138
+
139
+ # projection parameters - scale factor at projection origin
140
+ unless hProjection[:scaleFactorAtProjectionOrigin].nil?
141
+ @html.em('Scale Factor at Projection Origin: ')
142
+ @html.text!(hProjection[:scaleFactorAtProjectionOrigin].to_s)
143
+ @html.br
144
+ end
145
+
146
+ # projection parameters - azimuthAngle
147
+ unless hProjection[:azimuthAngle].nil?
148
+ @html.em('Azimuth Angle: ')
149
+ @html.text!(hProjection[:azimuthAngle].to_s)
150
+ @html.br
151
+ end
152
+
153
+ # projection parameters - azimuth measure point longitude
154
+ unless hProjection[:azimuthMeasurePointLongitude].nil?
155
+ @html.em('Azimuth Measure Point Longitude: ')
156
+ @html.text!(hProjection[:azimuthMeasurePointLongitude].to_s)
157
+ @html.br
158
+ end
159
+
160
+ # projection parameters - oblique line point
161
+ hProjection[:obliqueLinePoints].each do |hLinePoint|
162
+ linePoint = linePointClass.writeHtml(hLinePoint)
163
+ @html.em('Oblique Line Point: ' + linePoint)
164
+ @html.br
165
+ end
166
+
167
+ # projection parameters - landsat number
168
+ unless hProjection[:landsatNumber].nil?
169
+ @html.em('Landsat Number: ')
170
+ @html.text!(hProjection[:landsatNumber].to_s)
171
+ @html.br
172
+ end
173
+
174
+ # projection parameters - landsat path
175
+ unless hProjection[:landsatPath].nil?
176
+ @html.em('Landsat Path: ')
177
+ @html.text!(hProjection[:landsatPath].to_s)
178
+ @html.br
179
+ end
180
+
181
+ # projection parameters - local planar description
182
+ unless hProjection[:localPlanarDescription].nil?
183
+ @html.em('Local Planar Description: ')
184
+ @html.section(:class => 'block') do
185
+ @html.text!(hProjection[:localPlanarDescription])
186
+ end
187
+ end
188
+
189
+ # projection parameters - local planar georeference
190
+ unless hProjection[:localPlanarGeoreference].nil?
191
+ @html.em('Local Planar Georeference: ')
192
+ @html.section(:class => 'block') do
193
+ @html.text!(hProjection[:localPlanarGeoreference])
194
+ end
195
+ end
196
+
197
+ # projection parameters - other projection description
198
+ unless hProjection[:otherProjectionDescription].nil?
199
+ @html.em('Other Projection Description: ')
200
+ @html.section(:class => 'block') do
201
+ @html.text!(hProjection[:otherProjectionDescription])
202
+ end
203
+ end
204
+
205
+ # projection parameters - other grid description
206
+ unless hProjection[:otherGridDescription].nil?
207
+ @html.em('Other Grid Description: ')
208
+ @html.section(:class => 'block') do
209
+ @html.text!(hProjection[:otherGridDescription])
210
+ end
211
+ end
212
+
213
+ # projection parameters - projection identifier
214
+ unless hProjection[:projectionIdentifier].empty?
215
+ @html.details do
216
+ @html.summary('Projection Identifier', {'id' => 'projection-identifier', 'class' => 'h5'})
217
+ @html.section(:class => 'block') do
218
+ identifierClass.writeHtml(hProjection[:projectionIdentifier])
219
+ end
220
+ end
221
+ end
222
+
223
+ end # writeHtml
224
+ end # Html_ProjectionParameters
225
+
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,65 @@
1
+ # HTML writer
2
+ # spatial reference system parameter set
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-24 original script
6
+
7
+ require_relative 'html_projectionParameters'
8
+ require_relative 'html_ellipsoidParameters'
9
+ require_relative 'html_verticalDatumParameters'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Html
15
+
16
+ class Html_ReferenceSystemParameters
17
+
18
+ def initialize(html)
19
+ @html = html
20
+ end
21
+
22
+ def writeHtml(hParamSet)
23
+
24
+ # classes used
25
+ projectionClass = Html_ProjectionParameters.new(@html)
26
+ ellipsoidClass = Html_EllipsoidParameters.new(@html)
27
+ verticalClass = Html_VerticalDatumParameters.new(@html)
28
+
29
+ # reference parameter set - projection
30
+ unless hParamSet[:projection].empty?
31
+ @html.details do
32
+ @html.summary('Projection Parameters', {'id' => 'projection', 'class' => 'h5'})
33
+ @html.section(:class => 'block') do
34
+ projectionClass.writeHtml(hParamSet[:projection])
35
+ end
36
+ end
37
+ end
38
+
39
+ # reference parameter set - ellipsoid
40
+ unless hParamSet[:ellipsoid].empty?
41
+ @html.details do
42
+ @html.summary('Ellipsoid Parameters', {'id' => 'ellipsoid', 'class' => 'h5'})
43
+ @html.section(:class => 'block') do
44
+ ellipsoidClass.writeHtml(hParamSet[:ellipsoid])
45
+ end
46
+ end
47
+ end
48
+
49
+ # reference parameter set - vertical datum
50
+ unless hParamSet[:verticalDatum].empty?
51
+ @html.details do
52
+ @html.summary('Vertical Datum Parameters', {'id' => 'verticalDatum', 'class' => 'h5'})
53
+ @html.section(:class => 'block') do
54
+ verticalClass.writeHtml(hParamSet[:verticalDatum])
55
+ end
56
+ end
57
+ end
58
+
59
+ end # writeHtml
60
+ end # Html_ReferenceSystemParameters
61
+
62
+ end
63
+ end
64
+ end
65
+ end
@@ -2,9 +2,11 @@
2
2
  # spatial reference system
3
3
 
4
4
  # History:
5
+ # Stan Smith 2017-10-24 add reference system parameter set
5
6
  # Stan Smith 2017-03-27 original script
6
7
 
7
8
  require_relative 'html_identifier'
9
+ require_relative 'html_referenceSystemParameters'
8
10
 
9
11
  module ADIWG
10
12
  module Mdtranslator
@@ -21,6 +23,7 @@ module ADIWG
21
23
 
22
24
  # classes used
23
25
  identifierClass = Html_Identifier.new(@html)
26
+ paramSetClass = Html_ReferenceSystemParameters.new(@html)
24
27
 
25
28
  # spatial reference - type
26
29
  unless hSpaceRef[:systemType].nil?
@@ -31,7 +34,22 @@ module ADIWG
31
34
 
32
35
  # spatial reference - identifier {identifier}
33
36
  unless hSpaceRef[:systemIdentifier].empty?
34
- identifierClass.writeHtml(hSpaceRef[:systemIdentifier])
37
+ @html.details do
38
+ @html.summary('System Identifier', {'id' => 'spatialReference-identifier', 'class' => 'h5'})
39
+ @html.section(:class => 'block') do
40
+ identifierClass.writeHtml(hSpaceRef[:systemIdentifier])
41
+ end
42
+ end
43
+ end
44
+
45
+ # spatial reference - projection parameters {referenceSystemParameterSet}
46
+ unless hSpaceRef[:systemParameterSet].empty?
47
+ @html.details do
48
+ @html.summary('System Parameters', {'id' => 'spatialReference-parameters', 'class' => 'h5'})
49
+ @html.section(:class => 'block') do
50
+ paramSetClass.writeHtml(hSpaceRef[:systemParameterSet])
51
+ end
52
+ end
35
53
  end
36
54
 
37
55
  end # writeHtml
@@ -0,0 +1,69 @@
1
+ # HTML writer
2
+ # spatial reference system vertical datum parameters
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-24 original script
6
+
7
+ require_relative 'html_identifier'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Html
13
+
14
+ class Html_VerticalDatumParameters
15
+
16
+ def initialize(html)
17
+ @html = html
18
+ end
19
+
20
+ def writeHtml(hDatum)
21
+
22
+ # classes used
23
+ identifierClass = Html_Identifier.new(@html)
24
+
25
+ # vertical datum - is depth system {Boolean}
26
+ if hDatum[:encodingMethod]
27
+ @html.text!('Depth System')
28
+ else
29
+ @html.text!('Altitude System')
30
+ end
31
+ @html.br
32
+
33
+ # vertical datum - encoding method
34
+ unless hDatum[:encodingMethod].nil?
35
+ @html.em('Encoding Method: ')
36
+ @html.text!(hDatum[:encodingMethod])
37
+ @html.br
38
+ end
39
+
40
+ # vertical datum - vertical resolution
41
+ unless hDatum[:verticalResolution].nil?
42
+ @html.em('Vertical Resolution: ')
43
+ @html.text!(hDatum[:verticalResolution].to_s)
44
+ @html.br
45
+ end
46
+
47
+ # vertical datum - unit of measure
48
+ unless hDatum[:unitOfMeasure].nil?
49
+ @html.em('Unit of Measure: ')
50
+ @html.text!(hDatum[:unitOfMeasure])
51
+ end
52
+
53
+ # vertical datum parameters - vertical datum identifier
54
+ unless hDatum[:datumIdentifier].empty?
55
+ @html.details do
56
+ @html.summary('Vertical Datum Identifier', {'id' => 'datum-identifier', 'class' => 'h5'})
57
+ @html.section(:class => 'block') do
58
+ identifierClass.writeHtml(hDatum[:datumIdentifier])
59
+ end
60
+ end
61
+ end
62
+
63
+ end # writeHtml
64
+ end # Html_VerticalDatumParameters
65
+
66
+ end
67
+ end
68
+ end
69
+ end
@@ -2,110 +2,110 @@
2
2
  # 19110 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-11-18 refactored for mdTranslator/mdJson 2.0
6
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
9
- # Stan Smith 2014-12-23 refactored to drop physical address elements if no
10
- # ... deliveryPoints are provided
11
- # Stan Smith 2014-12-22 added return if passed nil address objects
12
- # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
5
+ # Stan Smith 2016-11-18 refactored for mdTranslator/mdJson 2.0
6
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
9
+ # Stan Smith 2014-12-23 refactored to drop physical address elements if no
10
+ # ... deliveryPoints are provided
11
+ # Stan Smith 2014-12-22 added return if passed nil address objects
12
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
13
13
  # Stan Smith 2013-08-09 original script
14
14
 
15
15
  module ADIWG
16
- module Mdtranslator
17
- module Writers
18
- module Iso19110
19
-
20
- class CI_Address
21
-
22
- def initialize(xml, hResponseObj)
23
- @xml = xml
24
- @hResponseObj = hResponseObj
25
- end
26
-
27
- def writeXML(hAddress, aEmail)
28
-
29
- @xml.tag!('gmd:CI_Address') do
30
-
31
- unless hAddress.nil?
32
-
33
- # address - address type (not used by ISO 19115-2)
34
-
35
- # address - description (not used by ISO 19115-2)
36
-
37
- # address - delivery points []
38
- aDeliveryPoints = hAddress[:deliveryPoints]
39
- aDeliveryPoints.each do |myPoint|
40
- @xml.tag!('gmd:deliveryPoint') do
41
- @xml.tag!('gco:CharacterString', myPoint)
42
- end
43
- end
44
- if aDeliveryPoints.empty? && @hResponseObj[:writerShowTags]
45
- @xml.tag!('gmd:deliveryPoint')
46
- end
47
-
48
- # address - city
49
- s = hAddress[:city]
50
- unless s.nil?
51
- @xml.tag!('gmd:city') do
52
- @xml.tag!('gco:CharacterString', s)
53
- end
54
- end
55
- if s.nil? && @hResponseObj[:writerShowTags]
56
- @xml.tag!('gmd:city')
57
- end
58
-
59
- # address - administrative area
60
- s = hAddress[:adminArea]
61
- unless s.nil?
62
- @xml.tag!('gmd:administrativeArea') do
63
- @xml.tag!('gco:CharacterString', s)
64
- end
65
- end
66
- if s.nil? && @hResponseObj[:writerShowTags]
67
- @xml.tag!('gmd:administrativeArea')
68
- end
69
-
70
- # address - postal code
71
- s = hAddress[:postalCode]
72
- unless s.nil?
73
- @xml.tag!('gmd:postalCode') do
74
- @xml.tag!('gco:CharacterString', s)
75
- end
76
- end
77
- if s.nil? && @hResponseObj[:writerShowTags]
78
- @xml.tag!('gmd:postalCode')
79
- end
80
-
81
- # address - country
82
- s = hAddress[:country]
83
- unless s.nil?
84
- @xml.tag!('gmd:country') do
85
- @xml.tag!('gco:CharacterString', s)
86
- end
87
- end
88
- if s.nil? && @hResponseObj[:writerShowTags]
89
- @xml.tag!('gmd:country')
90
- end
91
-
92
- end
93
-
94
- # address - email addresses []
95
- aEmail.each do |myEmail|
96
- @xml.tag!('gmd:electronicMailAddress') do
97
- @xml.tag!('gco:CharacterString', myEmail)
98
- end
99
- end
100
- if aEmail.empty? && @hResponseObj[:writerShowTags]
101
- @xml.tag!('gmd:electronicMailAddress')
102
- end
103
-
104
- end # CI_Address tag
105
- end # writeXML
106
- end # CI_Address class
107
-
108
- end
109
- end
110
- end
16
+ module Mdtranslator
17
+ module Writers
18
+ module Iso19110
19
+
20
+ class CI_Address
21
+
22
+ def initialize(xml, hResponseObj)
23
+ @xml = xml
24
+ @hResponseObj = hResponseObj
25
+ end
26
+
27
+ def writeXML(hAddress, aEmail)
28
+
29
+ @xml.tag!('gmd:CI_Address') do
30
+
31
+ unless hAddress.nil?
32
+
33
+ # address - address type (not used by ISO 19115-2)
34
+
35
+ # address - description (not used by ISO 19115-2)
36
+
37
+ # address - delivery points []
38
+ aDeliveryPoints = hAddress[:deliveryPoints]
39
+ aDeliveryPoints.each do |myPoint|
40
+ @xml.tag!('gmd:deliveryPoint') do
41
+ @xml.tag!('gco:CharacterString', myPoint)
42
+ end
43
+ end
44
+ if aDeliveryPoints.empty? && @hResponseObj[:writerShowTags]
45
+ @xml.tag!('gmd:deliveryPoint')
46
+ end
47
+
48
+ # address - city
49
+ s = hAddress[:city]
50
+ unless s.nil?
51
+ @xml.tag!('gmd:city') do
52
+ @xml.tag!('gco:CharacterString', s)
53
+ end
54
+ end
55
+ if s.nil? && @hResponseObj[:writerShowTags]
56
+ @xml.tag!('gmd:city')
57
+ end
58
+
59
+ # address - administrative area
60
+ s = hAddress[:adminArea]
61
+ unless s.nil?
62
+ @xml.tag!('gmd:administrativeArea') do
63
+ @xml.tag!('gco:CharacterString', s)
64
+ end
65
+ end
66
+ if s.nil? && @hResponseObj[:writerShowTags]
67
+ @xml.tag!('gmd:administrativeArea')
68
+ end
69
+
70
+ # address - postal code
71
+ s = hAddress[:postalCode]
72
+ unless s.nil?
73
+ @xml.tag!('gmd:postalCode') do
74
+ @xml.tag!('gco:CharacterString', s)
75
+ end
76
+ end
77
+ if s.nil? && @hResponseObj[:writerShowTags]
78
+ @xml.tag!('gmd:postalCode')
79
+ end
80
+
81
+ # address - country
82
+ s = hAddress[:country]
83
+ unless s.nil?
84
+ @xml.tag!('gmd:country') do
85
+ @xml.tag!('gco:CharacterString', s)
86
+ end
87
+ end
88
+ if s.nil? && @hResponseObj[:writerShowTags]
89
+ @xml.tag!('gmd:country')
90
+ end
91
+
92
+ end
93
+
94
+ # address - email addresses []
95
+ aEmail.each do |myEmail|
96
+ @xml.tag!('gmd:electronicMailAddress') do
97
+ @xml.tag!('gco:CharacterString', myEmail)
98
+ end
99
+ end
100
+ if aEmail.empty? && @hResponseObj[:writerShowTags]
101
+ @xml.tag!('gmd:electronicMailAddress')
102
+ end
103
+
104
+ end # CI_Address tag
105
+ end # writeXML
106
+ end # CI_Address class
107
+
108
+ end
109
+ end
110
+ end
111
111
  end