adiwg-mdtranslator 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
  5. data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
  6. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
  7. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
  13. data/lib/adiwg/mdtranslator/version.rb +5 -1
  14. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
  15. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
  16. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
  22. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
  23. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
  24. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
  25. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
  26. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
  27. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
  28. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
  29. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
  30. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
  31. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
  32. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
  33. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
  34. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
  35. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
  36. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
  37. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
  38. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
  39. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
  40. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
  41. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
  43. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
  44. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
  45. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
  46. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
  47. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
  48. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
  49. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
  50. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
  51. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
  52. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
  53. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
  54. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
  55. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
  56. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
  57. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
  58. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
  59. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
  60. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
  61. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
  62. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
  63. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
  64. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
  65. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
  66. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
  67. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
  68. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
  69. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
  70. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
  71. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
  72. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
  73. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
  78. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
  79. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
  80. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
  81. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
  82. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
  83. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
  84. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
  85. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
  86. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
  87. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
  88. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
  89. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
  90. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
  91. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
  92. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
  93. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
  94. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
  95. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
  96. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
  97. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
  98. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
  99. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
  100. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
  103. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
  104. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
  105. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
  106. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
  107. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
  108. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
  109. data/lib/adiwg/mdtranslator_cli.rb +21 -4
  110. metadata +6 -5
@@ -2,143 +2,143 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-11-27 refactored for mdTranslator/mdJson 2.0
5
+ # Stan Smith 2016-11-27 refactored for mdTranslator/mdJson 2.0
6
6
  # Stan Smith 2015-08-27 original script
7
7
 
8
8
  require_relative 'class_codelist'
9
9
  require_relative 'class_rsIdentifier'
10
10
 
11
11
  module ADIWG
12
- module Mdtranslator
13
- module Writers
14
- module Iso19115_2
15
-
16
- class MI_ImageDescription
17
-
18
- def initialize(xml, hResponseObj)
19
- @xml = xml
20
- @hResponseObj = hResponseObj
21
- end
22
-
23
- def writeXML(hCoverage)
24
-
25
- # classes used
26
- codelistClass = MD_Codelist.new(@xml, @hResponseObj)
27
- resIdClass = RS_Identifier.new(@xml, @hResponseObj)
28
-
29
- hImage = hCoverage[:imageDescription]
30
-
31
- # image description - illumination elevation angle
32
- s = hImage[:illuminationElevationAngle]
33
- unless s.nil?
34
- @xml.tag!('gmd:illuminationElevationAngle') do
35
- @xml.tag!('gco:Real', s)
36
- end
37
- end
38
- if s.nil? && @hResponseObj[:writerShowTags]
39
- @xml.tag!('gmd:illuminationElevationAngle')
40
- end
41
-
42
- # image description - illumination azimuth angle
43
- s = hImage[:illuminationAzimuthAngle]
44
- unless s.nil?
45
- @xml.tag!('gmd:illuminationAzimuthAngle') do
46
- @xml.tag!('gco:Real', s)
47
- end
48
- end
49
- if s.nil? && @hResponseObj[:writerShowTags]
50
- @xml.tag!('gmd:illuminationAzimuthAngle')
51
- end
52
-
53
- # image description - image condition {MD_ImageConditionCode}
54
- s = hImage[:imagingCondition]
55
- unless s.nil?
56
- @xml.tag!('gmd:imagingCondition') do
57
- codelistClass.writeXML('gmd', 'iso_imageCondition',s)
58
- end
59
- end
60
- if s.nil? && @hResponseObj[:writerShowTags]
61
- @xml.tag!('gmd:imagingCondition')
62
- end
63
-
64
- # image description - image quality code {RS_Identifier}
65
- resId = hImage[:imageQualityCode]
66
- unless resId.empty?
67
- @xml.tag!('gmd:imageQualityCode') do
68
- resIdClass.writeXML(resId)
69
- end
70
- end
71
- if resId.empty? && @hResponseObj[:writerShowTags]
72
- @xml.tag!('gmd:imageQualityCode')
73
- end
74
-
75
- # image description - cloud cover percentage
76
- s = hImage[:cloudCoverPercent]
77
- unless s.nil?
78
- @xml.tag!('gmd:cloudCoverPercentage') do
79
- @xml.tag!('gco:Real', s)
80
- end
81
- end
82
- if s.nil? && @hResponseObj[:writerShowTags]
83
- @xml.tag!('gmd:cloudCoverPercentage')
84
- end
85
-
86
- # image description - processing level code (from coverageItem) {RS_Identifier}
87
- resId = hCoverage[:processingLevelCode]
88
- unless resId.empty?
89
- @xml.tag!('gmd:processingLevelCode') do
90
- resIdClass.writeXML(resId)
91
- end
92
- end
93
- if resId.empty? && @hResponseObj[:writerShowTags]
94
- @xml.tag!('gmd:processingLevelCode')
95
- end
96
-
97
- # image description - compression generation quality
98
- s = hImage[:compressionQuantity]
99
- unless s.nil?
100
- @xml.tag!('gmd:compressionGenerationQuantity') do
101
- @xml.tag!('gco:Integer', s)
102
- end
103
- end
104
- if s.nil? && @hResponseObj[:writerShowTags]
105
- @xml.tag!('gmd:compressionGenerationQuantity')
106
- end
107
-
108
- # image description - triangulation indicator
109
- s = hImage[:triangulationIndicator]
110
- @xml.tag!('gmd:triangulationIndicator') do
111
- @xml.tag!('gco:Boolean', s)
112
- end
113
-
114
- # image description - radiometric calibration data availability
115
- s = hImage[:radiometricCalibrationAvailable]
116
- @xml.tag!('gmd:radiometricCalibrationDataAvailability') do
117
- @xml.tag!('gco:Boolean', s)
118
- end
119
-
120
- # image description - camera calibration information availability
121
- s = hImage[:cameraCalibrationAvailable]
122
- @xml.tag!('gmd:cameraCalibrationInformationAvailability') do
123
- @xml.tag!('gco:Boolean', s)
124
- end
125
-
126
- # image description - film distortion information availability
127
- s = hImage[:filmDistortionAvailable]
128
- @xml.tag!('gmd:filmDistortionInformationAvailability') do
129
- @xml.tag!('gco:Boolean', s)
130
- end
131
-
132
- # image description - lens distortion information availability
133
- s = hImage[:lensDistortionAvailable]
134
- @xml.tag!('gmd:lensDistortionInformationAvailability') do
135
- @xml.tag!('gco:Boolean', s)
136
- end
137
-
138
- end
139
- end
140
-
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_2
15
+
16
+ class MI_ImageDescription
17
+
18
+ def initialize(xml, hResponseObj)
19
+ @xml = xml
20
+ @hResponseObj = hResponseObj
21
+ end
22
+
23
+ def writeXML(hCoverage)
24
+
25
+ # classes used
26
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
27
+ resIdClass = RS_Identifier.new(@xml, @hResponseObj)
28
+
29
+ hImage = hCoverage[:imageDescription]
30
+
31
+ # image description - illumination elevation angle
32
+ s = hImage[:illuminationElevationAngle]
33
+ unless s.nil?
34
+ @xml.tag!('gmd:illuminationElevationAngle') do
35
+ @xml.tag!('gco:Real', s)
36
+ end
37
+ end
38
+ if s.nil? && @hResponseObj[:writerShowTags]
39
+ @xml.tag!('gmd:illuminationElevationAngle')
40
+ end
41
+
42
+ # image description - illumination azimuth angle
43
+ s = hImage[:illuminationAzimuthAngle]
44
+ unless s.nil?
45
+ @xml.tag!('gmd:illuminationAzimuthAngle') do
46
+ @xml.tag!('gco:Real', s)
47
+ end
48
+ end
49
+ if s.nil? && @hResponseObj[:writerShowTags]
50
+ @xml.tag!('gmd:illuminationAzimuthAngle')
51
+ end
52
+
53
+ # image description - image condition {MD_ImageConditionCode}
54
+ s = hImage[:imagingCondition]
55
+ unless s.nil?
56
+ @xml.tag!('gmd:imagingCondition') do
57
+ codelistClass.writeXML('gmd', 'iso_imageCondition', s)
58
+ end
59
+ end
60
+ if s.nil? && @hResponseObj[:writerShowTags]
61
+ @xml.tag!('gmd:imagingCondition')
62
+ end
63
+
64
+ # image description - image quality code {RS_Identifier}
65
+ resId = hImage[:imageQualityCode]
66
+ unless resId.empty?
67
+ @xml.tag!('gmd:imageQualityCode') do
68
+ resIdClass.writeXML(resId, 'image quality code')
69
+ end
70
+ end
71
+ if resId.empty? && @hResponseObj[:writerShowTags]
72
+ @xml.tag!('gmd:imageQualityCode')
73
+ end
74
+
75
+ # image description - cloud cover percentage
76
+ s = hImage[:cloudCoverPercent]
77
+ unless s.nil?
78
+ @xml.tag!('gmd:cloudCoverPercentage') do
79
+ @xml.tag!('gco:Real', s)
80
+ end
81
+ end
82
+ if s.nil? && @hResponseObj[:writerShowTags]
83
+ @xml.tag!('gmd:cloudCoverPercentage')
84
+ end
85
+
86
+ # image description - processing level code (from coverageItem) {RS_Identifier}
87
+ resId = hCoverage[:processingLevelCode]
88
+ unless resId.empty?
89
+ @xml.tag!('gmd:processingLevelCode') do
90
+ resIdClass.writeXML(resId, 'image processing level code')
91
+ end
92
+ end
93
+ if resId.empty? && @hResponseObj[:writerShowTags]
94
+ @xml.tag!('gmd:processingLevelCode')
95
+ end
96
+
97
+ # image description - compression generation quality
98
+ s = hImage[:compressionQuantity]
99
+ unless s.nil?
100
+ @xml.tag!('gmd:compressionGenerationQuantity') do
101
+ @xml.tag!('gco:Integer', s)
102
+ end
103
+ end
104
+ if s.nil? && @hResponseObj[:writerShowTags]
105
+ @xml.tag!('gmd:compressionGenerationQuantity')
106
+ end
107
+
108
+ # image description - triangulation indicator
109
+ s = hImage[:triangulationIndicator]
110
+ @xml.tag!('gmd:triangulationIndicator') do
111
+ @xml.tag!('gco:Boolean', s)
112
+ end
113
+
114
+ # image description - radiometric calibration data availability
115
+ s = hImage[:radiometricCalibrationAvailable]
116
+ @xml.tag!('gmd:radiometricCalibrationDataAvailability') do
117
+ @xml.tag!('gco:Boolean', s)
118
+ end
119
+
120
+ # image description - camera calibration information availability
121
+ s = hImage[:cameraCalibrationAvailable]
122
+ @xml.tag!('gmd:cameraCalibrationInformationAvailability') do
123
+ @xml.tag!('gco:Boolean', s)
124
+ end
125
+
126
+ # image description - film distortion information availability
127
+ s = hImage[:filmDistortionAvailable]
128
+ @xml.tag!('gmd:filmDistortionInformationAvailability') do
129
+ @xml.tag!('gco:Boolean', s)
130
+ end
131
+
132
+ # image description - lens distortion information availability
133
+ s = hImage[:lensDistortionAvailable]
134
+ @xml.tag!('gmd:lensDistortionInformationAvailability') do
135
+ @xml.tag!('gco:Boolean', s)
136
+ end
137
+
138
+ end
141
139
  end
142
- end
143
- end
140
+
141
+ end
142
+ end
143
+ end
144
144
  end
@@ -2,6 +2,7 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-04-09 add error and warning messaging
5
6
  # Stan Smith 2016-12-12 refactored for mdTranslator/mdJson 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
@@ -12,6 +13,7 @@
12
13
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
13
14
  # Stan Smith 2013-09-18 original script
14
15
 
16
+ require_relative '../iso19115_2_writer'
15
17
  require_relative 'class_codelist'
16
18
  require_relative 'class_citation'
17
19
 
@@ -25,6 +27,7 @@ module ADIWG
25
27
  def initialize(xml, hResponseObj)
26
28
  @xml = xml
27
29
  @hResponseObj = hResponseObj
30
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
28
31
  end
29
32
 
30
33
  def writeXML(hKeyword)
@@ -48,7 +51,7 @@ module ADIWG
48
51
  end
49
52
  end
50
53
  if aKeyObjects.empty?
51
- @xml.tag!('gmd:keyword', {'gco:nilReason' => 'missing'})
54
+ @NameSpace.issueWarning(200, 'gmd:keyword')
52
55
  end
53
56
 
54
57
  # keyword - type {MD_KeywordTypeCode}
@@ -66,7 +69,7 @@ module ADIWG
66
69
  hCitation = hKeyword[:thesaurus]
67
70
  unless hCitation.empty?
68
71
  @xml.tag!('gmd:thesaurusName') do
69
- citationClass.writeXML(hCitation)
72
+ citationClass.writeXML(hCitation, 'keyword thesaurus')
70
73
  end
71
74
  end
72
75
  if hCitation.empty? && @hResponseObj[:writerShowTags]
@@ -2,83 +2,83 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-12-05 refactored for mdTranslator/mdJson 2.0
6
- # Stan Smith 2015-07-16 moved module_coordinates from mdJson reader to internal
7
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
8
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
9
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
10
- # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
11
- # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
12
- # Stan Smith 2014-05-30 modified for version 0.5.0
5
+ # Stan Smith 2016-12-05 refactored for mdTranslator/mdJson 2.0
6
+ # Stan Smith 2015-07-16 moved module_coordinates from mdJson reader to internal
7
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
8
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
9
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
10
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
11
+ # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
12
+ # Stan Smith 2014-05-30 modified for version 0.5.0
13
13
  # Stan Smith 2013-11-13 original script.
14
14
 
15
15
  require 'adiwg/mdtranslator/internal/module_coordinates'
16
16
  require_relative 'class_featureProperties'
17
17
 
18
18
  module ADIWG
19
- module Mdtranslator
20
- module Writers
21
- module Iso19115_2
22
-
23
- class LineString
24
-
25
- def initialize(xml, hResponseObj)
26
- @xml = xml
27
- @hResponseObj = hResponseObj
28
- end
29
-
30
- def writeXML(hGeoObject, hProperties, lineId)
31
-
32
- # classes used
33
- geoPropClass = FeatureProperties.new(@xml, @hResponseObj)
34
-
35
- # LineString attributes
36
- attributes = {}
37
-
38
- # LineString attributes - gml:id (required)
39
- if lineId.nil?
40
- @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
41
- lineId = 'line' + @hResponseObj[:writerMissingIdCount]
42
- else
43
- lineId.gsub!(/[^0-9a-zA-Z]/,'')
19
+ module Mdtranslator
20
+ module Writers
21
+ module Iso19115_2
22
+
23
+ class LineString
24
+
25
+ def initialize(xml, hResponseObj)
26
+ @xml = xml
27
+ @hResponseObj = hResponseObj
28
+ end
29
+
30
+ def writeXML(hGeoObject, hProperties, lineId)
31
+
32
+ # classes used
33
+ geoPropClass = FeatureProperties.new(@xml, @hResponseObj)
34
+
35
+ # LineString attributes
36
+ attributes = {}
37
+
38
+ # LineString attributes - gml:id (required)
39
+ if lineId.nil?
40
+ @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
41
+ lineId = 'line' + @hResponseObj[:writerMissingIdCount]
42
+ else
43
+ lineId.gsub!(/[^0-9a-zA-Z]/, '')
44
+ end
45
+ attributes['gml:id'] = lineId
46
+
47
+ # LineString attributes - srsDimension
48
+ s = AdiwgCoordinates.getDimension(hGeoObject[:coordinates])
49
+ if !s.nil?
50
+ attributes[:srsDimension] = s
51
+ end
52
+
53
+ # LineString attributes - srsName (GeoJSON is WGS84)
54
+ attributes[:srsName] = 'WGS84'
55
+
56
+ @xml.tag!('gml:LineString', attributes) do
57
+
58
+ # lineString - properties for Feature
59
+ unless hProperties.empty?
60
+ geoPropClass.writeXML(hProperties)
61
+ end
62
+ if hProperties.empty? && @hResponseObj[:writerShowTags]
63
+ @xml.tag!('gml:description')
64
+ @xml.tag!('gml:identifier', {'codeSpace' => ''})
65
+ @xml.tag!('gml:name')
66
+ end
67
+
68
+ # lineString - pos (required)
69
+ unless hGeoObject[:coordinates].empty?
70
+ aCoords = hGeoObject[:coordinates]
71
+ aCoords.each do |aCoord|
72
+ s = aCoord[0].to_s + ' ' + aCoord[1].to_s
73
+ @xml.tag!('gml:pos', s)
44
74
  end
45
- attributes['gml:id'] = lineId
75
+ end
46
76
 
47
- # LineString attributes - srsDimension
48
- s = AdiwgCoordinates.getDimension(hGeoObject[:coordinates])
49
- if !s.nil?
50
- attributes[:srsDimension] = s
51
- end
77
+ end # gml:LineString
78
+ end # writeXML
79
+ end # LineString class
52
80
 
53
- # LineString attributes - srsName (GeoJSON is WGS84)
54
- attributes[:srsName] = 'WGS84'
55
-
56
- @xml.tag!('gml:LineString', attributes) do
57
-
58
- # lineString - properties for Feature
59
- unless hProperties.empty?
60
- geoPropClass.writeXML(hProperties)
61
- end
62
- if hProperties.empty? && @hResponseObj[:writerShowTags]
63
- @xml.tag!('gml:description')
64
- @xml.tag!('gml:identifier', {'codeSpace'=>''})
65
- @xml.tag!('gml:name')
66
- end
67
-
68
- # lineString - pos (required)
69
- unless hGeoObject[:coordinates].empty?
70
- aCoords = hGeoObject[:coordinates]
71
- aCoords.each do |aCoord|
72
- s = aCoord[0].to_s + ' ' + aCoord[1].to_s
73
- @xml.tag!('gml:pos', s)
74
- end
75
- end
76
-
77
- end # gml:LineString
78
- end # writeXML
79
- end # LineString class
80
-
81
- end
82
- end
83
- end
81
+ end
82
+ end
83
+ end
84
84
  end