adiwg-mdtranslator 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/Rakefile +1 -2
  4. data/adiwg-mdtranslator.gemspec +23 -23
  5. data/bin/mdtranslator +187 -155
  6. data/lib/adiwg/mdtranslator.rb +63 -38
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +123 -5
  8. data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +55 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +98 -70
  10. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -11
  11. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_additionalDocumentation.rb +13 -3
  12. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_address.rb +3 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_associatedResource.rb +22 -4
  14. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_boundingBox.rb +3 -1
  15. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_browseGraphic.rb +11 -1
  16. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_citation.rb +28 -9
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedData.rb +49 -0
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedDataItem.rb +53 -0
  19. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_contacts.rb +14 -12
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageInfo.rb +83 -0
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageItem.rb +136 -0
  22. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataDictionary.rb +9 -7
  23. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataQuality.rb +17 -3
  24. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dateTime.rb +3 -1
  25. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_descriptiveKeyword.rb +22 -5
  26. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dictionaryInfo.rb +18 -3
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_digitalTransferOption.rb +80 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_dimension.rb +81 -0
  29. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionInfo.rb +89 -0
  30. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionOrder.rb +62 -0
  31. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domain.rb +24 -5
  32. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domainItem.rb +23 -4
  33. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entity.rb +26 -7
  34. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityAttribute.rb +24 -1
  35. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityForeignKey.rb +20 -1
  36. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityIndex.rb +20 -1
  37. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_extent.rb +9 -7
  38. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoCoordSystem.rb +3 -1
  39. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoProperties.rb +9 -7
  40. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geographicElement.rb +20 -18
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_gridInfo.rb +67 -0
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_imageInfo.rb +119 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_legalConstraint.rb +7 -1
  44. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineString.rb +5 -4
  45. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineage.rb +11 -5
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_locale.rb +57 -0
  47. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_mdJson.rb +10 -9
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_medium.rb +73 -0
  49. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadata.rb +14 -12
  50. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataExtension.rb +3 -1
  51. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataInfo.rb +35 -15
  52. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_onlineResource.rb +7 -1
  53. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_phone.rb +3 -1
  54. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_point.rb +5 -4
  55. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_polygon.rb +5 -4
  56. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_processStep.rb +19 -6
  57. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resolution.rb +7 -1
  58. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceFormat.rb +12 -1
  59. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceIdentifier.rb +30 -5
  60. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceInfo.rb +70 -33
  61. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceMaintenance.rb +5 -3
  62. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceSpecificUsage.rb +5 -3
  63. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_responsibleParty.rb +10 -8
  64. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_securityConstraint.rb +3 -1
  65. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_sensorInfo.rb +69 -0
  66. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_source.rb +11 -5
  67. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_spatialReference.rb +3 -1
  68. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonClass.rb +3 -1
  69. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonomy.rb +11 -9
  70. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_temporalElement.rb +9 -7
  71. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timeInstant.rb +5 -3
  72. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timePeriod.rb +6 -4
  73. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_verticalElement.rb +3 -1
  74. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_voucher.rb +5 -3
  75. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/version.rb +19 -0
  76. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +21 -18
  77. data/lib/adiwg/mdtranslator/version.rb +15 -1
  78. data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +11 -8
  79. data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +21 -18
  80. data/lib/adiwg/mdtranslator/writers/html/sections/html_additionalDocumentation.rb +48 -0
  81. data/lib/adiwg/mdtranslator/writers/html/sections/html_associatedResource.rb +73 -0
  82. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +84 -135
  83. data/lib/adiwg/mdtranslator/writers/html/sections/html_citation.rb +18 -8
  84. data/lib/adiwg/mdtranslator/writers/html/sections/html_classedData.rb +50 -0
  85. data/lib/adiwg/mdtranslator/writers/html/sections/html_classedDataItem.rb +50 -0
  86. data/lib/adiwg/mdtranslator/writers/html/sections/html_contact.rb +5 -9
  87. data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageInfo.rb +88 -0
  88. data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageItem.rb +139 -0
  89. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +13 -12
  90. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataLineage.rb +5 -4
  91. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataSource.rb +5 -4
  92. data/lib/adiwg/mdtranslator/writers/html/sections/html_dimension.rb +71 -0
  93. data/lib/adiwg/mdtranslator/writers/html/sections/html_distributor.rb +62 -0
  94. data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +3 -2
  95. data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +5 -4
  96. data/lib/adiwg/mdtranslator/writers/html/sections/html_extent.rb +7 -6
  97. data/lib/adiwg/mdtranslator/writers/html/sections/html_format.rb +7 -1
  98. data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +7 -7
  99. data/lib/adiwg/mdtranslator/writers/html/sections/html_gridInfo.rb +65 -0
  100. data/lib/adiwg/mdtranslator/writers/html/sections/html_head.rb +18 -3
  101. data/lib/adiwg/mdtranslator/writers/html/sections/html_imageInfo.rb +120 -0
  102. data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +13 -20
  103. data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +3 -2
  104. data/lib/adiwg/mdtranslator/writers/html/sections/html_medium.rb +19 -2
  105. data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +22 -9
  106. data/lib/adiwg/mdtranslator/writers/html/sections/html_orderProcess.rb +3 -2
  107. data/lib/adiwg/mdtranslator/writers/html/sections/html_processStep.rb +5 -4
  108. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceContact.rb +3 -2
  109. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +25 -14
  110. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceId.rb +30 -3
  111. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +194 -129
  112. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceMaint.rb +3 -2
  113. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceOther.rb +7 -6
  114. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceUsage.rb +3 -2
  115. data/lib/adiwg/mdtranslator/writers/html/sections/html_responsibleParty.rb +3 -2
  116. data/lib/adiwg/mdtranslator/writers/html/sections/html_sensorInfo.rb +66 -0
  117. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +7 -6
  118. data/lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb +7 -6
  119. data/lib/adiwg/mdtranslator/writers/html/sections/html_timeInstant.rb +3 -2
  120. data/lib/adiwg/mdtranslator/writers/html/sections/html_timePeriod.rb +3 -2
  121. data/lib/adiwg/mdtranslator/writers/html/sections/html_transferOption.rb +29 -4
  122. data/lib/adiwg/mdtranslator/writers/html/version.rb +17 -0
  123. data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +17 -16
  124. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_address.rb +12 -8
  125. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +42 -0
  126. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_codelist.rb +8 -3
  127. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_contact.rb +16 -25
  128. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +68 -0
  129. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +39 -0
  130. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +46 -0
  131. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureAttribute.rb +17 -14
  132. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureConstraint.rb +6 -2
  133. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureType.rb +16 -12
  134. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_listedValue.rb +9 -18
  135. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_multiplicity.rb +8 -4
  136. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_onlineResource.rb +13 -9
  137. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_responsibleParty.rb +16 -12
  138. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_telephone.rb +9 -5
  139. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +262 -0
  140. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +36 -16
  141. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +14 -0
  142. data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +73 -37
  143. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +116 -0
  144. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_aggregateInformation.rb +13 -9
  145. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_band.rb +165 -0
  146. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_baseUnit.rb +6 -6
  147. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_boundingPolygon.rb +14 -10
  148. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_browseGraphic.rb +9 -5
  149. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_citation.rb +31 -16
  150. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_codelist.rb +56 -0
  151. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +87 -0
  152. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contentInfo.rb +111 -0
  153. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_conventionalUnit.rb +6 -6
  154. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataIdentification.rb +106 -59
  155. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataQuality.rb +11 -7
  156. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_date.rb +8 -5
  157. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_definitionUnit.rb +7 -7
  158. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_derivedUnit.rb +6 -6
  159. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_digitalTransferOptions.rb +92 -0
  160. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +68 -0
  161. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distribution.rb +8 -4
  162. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distributor.rb +44 -22
  163. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_enumerationList.rb +7 -2
  164. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_extent.rb +18 -14
  165. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_format.rb +18 -2
  166. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicBoundingBox.rb +6 -2
  167. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicDescription.rb +8 -4
  168. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicElement.rb +10 -6
  169. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridInfo.rb +80 -0
  170. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_identifier.rb +10 -6
  171. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_imageDescription.rb +157 -0
  172. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_keyword.rb +12 -8
  173. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_legalConstraints.rb +12 -8
  174. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineString.rb +13 -10
  175. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineage.rb +14 -10
  176. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +67 -0
  177. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_maintenanceInformation.rb +12 -8
  178. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_medium.rb +30 -9
  179. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_metadataExtension.rb +19 -15
  180. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_multiGeometry.rb +22 -17
  181. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +94 -0
  182. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_point.rb +12 -9
  183. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_polygon.rb +14 -11
  184. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_processStep.rb +12 -9
  185. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeElementDescription.rb +88 -0
  186. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +52 -0
  187. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_resolution.rb +6 -2
  188. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resourceIdentifier.rb +94 -0
  189. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +106 -0
  190. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_securityConstraints.rb +12 -8
  191. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_source.rb +12 -8
  192. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_standardOrderProcess.rb +11 -9
  193. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonClassification.rb +8 -4
  194. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonSystem.rb +18 -14
  195. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_telephone.rb +92 -0
  196. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_temporalExtent.rb +10 -6
  197. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timeInstant.rb +9 -8
  198. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timePeriod.rb +10 -8
  199. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_unitsOfMeasure.rb +48 -25
  200. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_usage.rb +11 -7
  201. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_useConstraints.rb +6 -2
  202. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_verticalExtent.rb +6 -2
  203. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_vouchers.rb +8 -4
  204. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +32 -19
  205. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +17 -0
  206. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +21 -24
  207. data/test/readers/mdJson/v1/tc_reader_mdjson_additionalDocumentation.rb +116 -0
  208. data/test/readers/mdJson/v1/tc_reader_mdjson_address.rb +111 -0
  209. data/test/readers/mdJson/v1/tc_reader_mdjson_associatedResource.rb +157 -0
  210. data/test/readers/mdJson/v1/tc_reader_mdjson_browseGraphic.rb +119 -0
  211. data/test/readers/mdJson/v1/tc_reader_mdjson_citation.rb +143 -0
  212. data/test/readers/mdJson/v1/tc_reader_mdjson_contact.rb +138 -0
  213. data/test/readers/mdJson/v1/tc_reader_mdjson_dataQuality.rb +111 -0
  214. data/test/readers/mdJson/v1/tc_reader_mdjson_dateTime.rb +159 -0
  215. data/test/readers/mdJson/v1/tc_reader_mdjson_descriptiveKeyword.rb +115 -0
  216. data/test/readers/mdJson/v1/tc_reader_mdjson_dictionaryInfo.rb +121 -0
  217. data/test/readers/mdJson/v1/tc_reader_mdjson_digitalTransferOption.rb +94 -0
  218. data/test/readers/mdJson/v1/tc_reader_mdjson_distributionOrder.rb +103 -0
  219. data/test/readers/mdJson/v1/tc_reader_mdjson_domain.rb +130 -0
  220. data/test/readers/mdJson/v1/tc_reader_mdjson_domainItem.rb +98 -0
  221. data/test/readers/mdJson/v1/tc_reader_mdjson_entity.rb +134 -0
  222. data/test/readers/mdJson/v1/tc_reader_mdjson_entityAttribute.rb +154 -0
  223. data/test/readers/mdJson/v1/tc_reader_mdjson_entityForeignKey.rb +100 -0
  224. data/test/readers/mdJson/v1/tc_reader_mdjson_entityIndex.rb +99 -0
  225. data/test/readers/mdJson/v1/tc_reader_mdjson_legalConstraint.rb +104 -0
  226. data/test/readers/mdJson/v1/tc_reader_mdjson_lineage.rb +117 -0
  227. data/test/readers/mdJson/v1/tc_reader_mdjson_medium.rb +98 -0
  228. data/test/readers/mdJson/v1/tc_reader_mdjson_metadataInfo.rb +141 -0
  229. data/test/readers/mdJson/v1/tc_reader_mdjson_onlineResource.rb +110 -0
  230. data/test/readers/mdJson/v1/tc_reader_mdjson_phone.rb +112 -0
  231. data/test/readers/mdJson/v1/tc_reader_mdjson_processStep.rb +118 -0
  232. data/test/readers/mdJson/v1/tc_reader_mdjson_resolution.rb +77 -0
  233. data/test/readers/mdJson/v1/tc_reader_mdjson_source.rb +117 -0
  234. data/test/readers/mdJson/v1/tc_translation_19110.rb +57 -0
  235. data/test/readers/mdJson/{v1_0/tc_translation.rb → v1/tc_translation_19115_2.rb} +16 -31
  236. data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +22 -15
  237. metadata +219 -140
  238. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_coordinates.rb +0 -63
  239. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_distributionInfo.rb +0 -161
  240. data/lib/adiwg/mdtranslator/writers/html/sections/logo150.txt +0 -25
  241. data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +0 -62
  242. data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +0 -74
  243. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +0 -53
  244. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +0 -40
  245. data/test/readers/mdJson/v1_0/tc_reader_mdjson_additionalDocumentation.rb +0 -85
  246. data/test/readers/mdJson/v1_0/tc_reader_mdjson_address.rb +0 -100
  247. data/test/readers/mdJson/v1_0/tc_reader_mdjson_associatedResource.rb +0 -101
  248. data/test/readers/mdJson/v1_0/tc_reader_mdjson_browseGraphic.rb +0 -86
  249. data/test/readers/mdJson/v1_0/tc_reader_mdjson_citation.rb +0 -116
  250. data/test/readers/mdJson/v1_0/tc_reader_mdjson_contact.rb +0 -138
  251. data/test/readers/mdJson/v1_0/tc_reader_mdjson_dictionaryInfo.rb +0 -95
  252. data/test/readers/mdJson/v1_0/tc_reader_mdjson_domain.rb +0 -99
  253. data/test/readers/mdJson/v1_0/tc_reader_mdjson_onlineResource.rb +0 -92
  254. data/test/readers/mdJson/v1_0/tc_reader_mdjson_phone.rb +0 -110
@@ -0,0 +1,87 @@
1
+ # ISO <<Class>> CI_Contact
2
+ # writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2013-08-12 original script
6
+ # Stan Smith 2014-05-14 modified for JSON schema version 0.4.0
7
+ # Stan Smith 2014-05-16 added method to return contact from array
8
+ # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
9
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
10
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
11
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
12
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
13
+
14
+ require_relative 'class_telephone'
15
+ require_relative 'class_address'
16
+ require_relative 'class_onlineResource'
17
+
18
+ module ADIWG
19
+ module Mdtranslator
20
+ module Writers
21
+ module Iso19115_2
22
+
23
+ class CI_Contact
24
+
25
+ def initialize(xml, responseObj)
26
+ @xml = xml
27
+ @responseObj = responseObj
28
+ end
29
+
30
+ def writeXML(hContact)
31
+
32
+ # classes used
33
+ pBookClass = CI_Telephone.new(@xml, @responseObj)
34
+ addClass = CI_Address.new(@xml, @responseObj)
35
+ resourceClass = CI_OnlineResource.new(@xml, @responseObj)
36
+
37
+ @xml.tag!('gmd:CI_Contact') do
38
+
39
+ # contact - phone list - all services
40
+ aPhones = hContact[:phones]
41
+ if !aPhones.empty?
42
+ @xml.tag!('gmd:phone') do
43
+ pBookClass.writeXML(aPhones)
44
+ end
45
+ elsif @responseObj[:writerShowTags]
46
+ @xml.tag!('gmd:phone')
47
+ end
48
+
49
+ # contact - address
50
+ hAddress = hContact[:address]
51
+ if !hAddress.empty?
52
+ @xml.tag!('gmd:address') do
53
+ addClass.writeXML(hAddress)
54
+ end
55
+ elsif @responseObj[:writerShowTags]
56
+ @xml.tag!('gmd:address')
57
+ end
58
+
59
+ # contact - online resource
60
+ aResource = hContact[:onlineRes]
61
+ if !aResource.empty?
62
+ @xml.tag!('gmd:onlineResource') do
63
+ resourceClass.writeXML(aResource[0])
64
+ end
65
+ elsif @responseObj[:writerShowTags]
66
+ @xml.tag!('gmd:onlineResource')
67
+ end
68
+
69
+ # contact - contact instructions
70
+ s = hContact[:contactInstructions]
71
+ if !s.nil?
72
+ @xml.tag!('gmd:contactInstructions') do
73
+ @xml.tag!('gco:CharacterString', hContact[:contactInstructions])
74
+ end
75
+ elsif @responseObj[:writerShowTags]
76
+ @xml.tag!('gmd:contactInstructions')
77
+ end
78
+
79
+ end
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,111 @@
1
+ # ISO <<abstract class>> ContentInfo
2
+ # writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2015-08-27 original script.
6
+
7
+ require_relative 'class_codelist'
8
+ require_relative 'class_band'
9
+ require_relative 'class_imageDescription'
10
+ require_relative 'class_rangeElementDescription'
11
+
12
+ module ADIWG
13
+ module Mdtranslator
14
+ module Writers
15
+ module Iso19115_2
16
+
17
+ class ContentInfo
18
+
19
+ def initialize(xml, responseObj)
20
+ @xml = xml
21
+ @responseObj = responseObj
22
+ end
23
+
24
+ def writeXML(hContent)
25
+
26
+ # classes used
27
+ codelistClass = MD_Codelist.new(@xml, @responseObj)
28
+ bandClass = MD_Band.new(@xml, @responseObj)
29
+ imageClass = ImageDescription.new(@xml, @responseObj)
30
+ rangeClass = MI_RangeElementDescription.new(@xml, @responseObj)
31
+
32
+ if !hContent[:imageInfo].empty?
33
+ contentTag = 'gmi:MI_ImageDescription'
34
+ else
35
+ contentTag = 'gmi:MI_CoverageDescription'
36
+ end
37
+
38
+ @xml.tag!(contentTag) do
39
+
40
+ # content information - attribute description - required
41
+ # combine coverageName and coverageDescription
42
+ attDesc = ''
43
+ if hContent[:coverageName]
44
+ attDesc += hContent[:coverageName] + '; '
45
+ end
46
+ if hContent[:coverageDescription]
47
+ attDesc += hContent[:coverageDescription]
48
+ end
49
+ if attDesc == ''
50
+ @xml.tag!('gmd:attributeDescription', {'gco:nilReason'=>'missing'})
51
+ else
52
+ @xml.tag!('gmd:attributeDescription') do
53
+ @xml.tag!('gco:RecordType', attDesc)
54
+ end
55
+ end
56
+
57
+ # content information - content type - required - MD_CoverageContentTypeCode
58
+ s = hContent[:coverageType]
59
+ if !s.nil?
60
+ @xml.tag!('gmd:contentType') do
61
+ codelistClass.writeXML('iso_coverageContentType',s)
62
+ end
63
+ else
64
+ @xml.tag!('gmd:contentType', {'gco:nilReason'=>'missing'})
65
+ end
66
+
67
+ # content information - coverage items [] - band information
68
+ # only write band information if applicable coverage items are present
69
+ aCoverItems = hContent[:coverageItems]
70
+ aCoverItems.each do |hCoverItem|
71
+
72
+ # check for applicable coverage items
73
+ if !hCoverItem[:maxValue].nil? ||
74
+ !hCoverItem[:minValue].nil? ||
75
+ !hCoverItem[:units].nil? ||
76
+ !hCoverItem[:bitsPerValue].nil? ||
77
+ !hCoverItem[:scaleFactor].nil? ||
78
+ !hCoverItem[:offset].nil?
79
+ @xml.tag!('gmd:dimension') do
80
+ bandClass.writeXML(hCoverItem)
81
+ end
82
+ end
83
+
84
+ end
85
+
86
+ # content information - image information
87
+ # pass whole content information object
88
+ if !hContent[:imageInfo].empty?
89
+ imageClass.writeXML(hContent)
90
+ end
91
+
92
+ # content information - coverage items [] - classified data
93
+ aCoverItems = hContent[:coverageItems]
94
+ aCoverItems.each do |hCoverItem|
95
+ if !hCoverItem[:classedData].empty?
96
+ @xml.tag!('gmi:rangeElementDescription') do
97
+ rangeClass.writeXML(hCoverItem)
98
+ end
99
+ end
100
+ end
101
+
102
+ end
103
+
104
+ end
105
+
106
+ end
107
+
108
+ end
109
+ end
110
+ end
111
+ end
@@ -2,25 +2,25 @@
2
2
  # writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2014-12-03 original script
6
- # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
5
+ # Stan Smith 2015-08-27 copied from 19110 writer
7
6
 
8
7
  module ADIWG
9
8
  module Mdtranslator
10
9
  module Writers
11
- module Iso
10
+ module Iso19115_2
12
11
 
13
12
  class ConventionalUnit
14
13
 
15
- def initialize(xml)
14
+ def initialize(xml, responseObj)
16
15
  @xml = xml
16
+ @responseObj = responseObj
17
17
  end
18
18
 
19
19
  def writeXML(hConv)
20
20
 
21
21
  # create and identity for the unit
22
- $idCount = $idCount.succ
23
- unitID = 'unit' + $idCount
22
+ @responseObj[:writerMissingIdCount] = @responseObj[:writerMissingIdCount].succ
23
+ unitID = 'unit' + @responseObj[:writerMissingIdCount]
24
24
 
25
25
  @xml.tag!('gml:ConventionalUnit', {'gml:id' => unitID}) do
26
26
  @xml.tag!('gml:identifier', {'codeSpace' => hConv[:codeSpace]}, hConv[:identifier])
@@ -17,56 +17,61 @@
17
17
  # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
18
18
  # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
19
19
  # Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
20
- # Stan Smith 2015-16-12 added support for declaring multiple resource character sets
21
-
22
- require 'class_codelist'
23
- require 'class_enumerationList'
24
- require 'class_citation'
25
- require 'class_responsibleParty'
26
- require 'class_maintenanceInformation'
27
- require 'class_browseGraphic'
28
- require 'class_format'
29
- require 'class_keyword'
30
- require 'class_usage'
31
- require 'class_useConstraints'
32
- require 'class_legalConstraints'
33
- require 'class_securityConstraints'
34
- require 'class_aggregateInformation'
35
- require 'class_taxonSystem'
36
- require 'class_resolution'
37
- require 'class_extent'
20
+ # Stan Smith 2015-06-12 added support for declaring multiple resource character sets
21
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
22
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
23
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
24
+ # Stan Smith 2015-07-30 added support for translating locale into language and characterSet
25
+
26
+ require_relative 'class_codelist'
27
+ require_relative 'class_enumerationList'
28
+ require_relative 'class_citation'
29
+ require_relative 'class_responsibleParty'
30
+ require_relative 'class_maintenanceInformation'
31
+ require_relative 'class_browseGraphic'
32
+ require_relative 'class_format'
33
+ require_relative 'class_keyword'
34
+ require_relative 'class_usage'
35
+ require_relative 'class_useConstraints'
36
+ require_relative 'class_legalConstraints'
37
+ require_relative 'class_securityConstraints'
38
+ require_relative 'class_aggregateInformation'
39
+ require_relative 'class_taxonSystem'
40
+ require_relative 'class_resolution'
41
+ require_relative 'class_extent'
38
42
 
39
43
  module ADIWG
40
44
  module Mdtranslator
41
45
  module Writers
42
- module Iso
46
+ module Iso19115_2
43
47
 
44
48
  class MD_DataIdentification
45
49
 
46
- def initialize(xml)
50
+ def initialize(xml, responseObj)
47
51
  @xml = xml
52
+ @responseObj = responseObj
48
53
  end
49
54
 
50
55
  def writeXML(hDataId, aAssocRes)
51
56
 
52
57
  # classes used
53
- codelistClass = $IsoNS::MD_Codelist.new(@xml)
54
- enumerationClass = $IsoNS::MD_EnumerationList.new(@xml)
58
+ codelistClass = MD_Codelist.new(@xml, @responseObj)
59
+ enumerationClass = MD_EnumerationList.new(@xml, @responseObj)
55
60
  intMetadataClass = InternalMetadata.new
56
- citationClass = $IsoNS::CI_Citation.new(@xml)
57
- rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
58
- mInfoClass = $IsoNS::MD_MaintenanceInformation.new(@xml)
59
- bGraphicClass = $IsoNS::MD_BrowseGraphic.new(@xml)
60
- rFormatClass = $IsoNS::MD_Format.new(@xml)
61
- keywordClass = $IsoNS::MD_Keywords.new(@xml)
62
- useClass = $IsoNS::MD_Usage.new(@xml)
63
- uConClass = $IsoNS::MD_Constraints.new(@xml)
64
- lConClass = $IsoNS::MD_LegalConstraints.new(@xml)
65
- sConClass = $IsoNS::MD_SecurityConstraints.new(@xml)
66
- aggInfoClass = $IsoNS::MD_AggregateInformation.new(@xml)
67
- taxClass = $IsoNS::MD_TaxonSys.new(@xml)
68
- resolutionClass = $IsoNS::MD_Resolution.new(@xml)
69
- extentClass = $IsoNS::EX_Extent.new(@xml)
61
+ citationClass = CI_Citation.new(@xml, @responseObj)
62
+ rPartyClass = CI_ResponsibleParty.new(@xml, @responseObj)
63
+ mInfoClass = MD_MaintenanceInformation.new(@xml, @responseObj)
64
+ bGraphicClass = MD_BrowseGraphic.new(@xml, @responseObj)
65
+ rFormatClass = MD_Format.new(@xml, @responseObj)
66
+ keywordClass = MD_Keywords.new(@xml, @responseObj)
67
+ useClass = MD_Usage.new(@xml, @responseObj)
68
+ uConClass = MD_Constraints.new(@xml, @responseObj)
69
+ lConClass = MD_LegalConstraints.new(@xml, @responseObj)
70
+ sConClass = MD_SecurityConstraints.new(@xml, @responseObj)
71
+ aggInfoClass = MD_AggregateInformation.new(@xml, @responseObj)
72
+ taxClass = MD_TaxonSys.new(@xml, @responseObj)
73
+ resolutionClass = MD_Resolution.new(@xml, @responseObj)
74
+ extentClass = EX_Extent.new(@xml, @responseObj)
70
75
 
71
76
  # data identification
72
77
  @xml.tag!('gmd:MD_DataIdentification') do
@@ -97,7 +102,7 @@ module ADIWG
97
102
  @xml.tag!('gmd:purpose') do
98
103
  @xml.tag!('gco:CharacterString', s)
99
104
  end
100
- elsif $showAllTags
105
+ elsif @responseObj[:writerShowTags]
101
106
  @xml.tag!('gmd:purpose')
102
107
  end
103
108
 
@@ -109,7 +114,7 @@ module ADIWG
109
114
  @xml.tag!('gco:CharacterString', credit)
110
115
  end
111
116
  end
112
- elsif $showAllTags
117
+ elsif @responseObj[:writerShowTags]
113
118
  @xml.tag!('gmd:credit')
114
119
  end
115
120
 
@@ -131,7 +136,7 @@ module ADIWG
131
136
  rPartyClass.writeXML(hPContact)
132
137
  end
133
138
  end
134
- elsif $showAllTags
139
+ elsif @responseObj[:writerShowTags]
135
140
  @xml.tag!('gmd:pointOfContact')
136
141
  end
137
142
 
@@ -143,7 +148,7 @@ module ADIWG
143
148
  mInfoClass.writeXML(hResMaintInfo)
144
149
  end
145
150
  end
146
- elsif $showAllTags
151
+ elsif @responseObj[:writerShowTags]
147
152
  @xml.tag!('gmd:resourceMaintenance')
148
153
  end
149
154
 
@@ -158,7 +163,7 @@ module ADIWG
158
163
  bGraphicClass.writeXML(graphic)
159
164
  end
160
165
  end
161
- elsif $showAllTags
166
+ elsif @responseObj[:writerShowTags]
162
167
  @xml.tag!('gmd:graphicOverview')
163
168
  end
164
169
 
@@ -170,7 +175,7 @@ module ADIWG
170
175
  rFormatClass.writeXML(hResFormat)
171
176
  end
172
177
  end
173
- elsif $showAllTags
178
+ elsif @responseObj[:writerShowTags]
174
179
  @xml.tag!('gmd:resourceFormat')
175
180
  end
176
181
 
@@ -182,7 +187,7 @@ module ADIWG
182
187
  keywordClass.writeXML(hDKeyword)
183
188
  end
184
189
  end
185
- elsif $showAllTags
190
+ elsif @responseObj[:writerShowTags]
186
191
  @xml.tag!('gmd:descriptiveKeywords')
187
192
  end
188
193
 
@@ -194,7 +199,7 @@ module ADIWG
194
199
  useClass.writeXML(hResUse)
195
200
  end
196
201
  end
197
- elsif $showAllTags
202
+ elsif @responseObj[:writerShowTags]
198
203
  @xml.tag!('gmd:resourceSpecificUsage')
199
204
  end
200
205
 
@@ -204,7 +209,7 @@ module ADIWG
204
209
  @xml.tag!('gmd:resourceConstraints') do
205
210
  uConClass.writeXML(aUseLimits)
206
211
  end
207
- elsif $showAllTags
212
+ elsif @responseObj[:writerShowTags]
208
213
  @xml.tag!('gmd:resourceConstraints') do
209
214
  @xml.tag!('gmd:MD_Constraints')
210
215
  end
@@ -218,7 +223,7 @@ module ADIWG
218
223
  lConClass.writeXML(hLegalCon)
219
224
  end
220
225
  end
221
- elsif $showAllTags
226
+ elsif @responseObj[:writerShowTags]
222
227
  @xml.tag!('gmd:resourceConstraints') do
223
228
  @xml.tag!('gmd:MD_LegalConstraints')
224
229
  end
@@ -242,7 +247,7 @@ module ADIWG
242
247
  aggInfoClass.writeXML(hAssocRes)
243
248
  end
244
249
  end
245
- elsif $showAllTags
250
+ elsif @responseObj[:writerShowTags]
246
251
  @xml.tag!('gmd:aggregationInfo')
247
252
  end
248
253
 
@@ -252,7 +257,7 @@ module ADIWG
252
257
  @xml.tag!('gmd:taxonomy') do
253
258
  taxClass.writeXML(hTaxonomy)
254
259
  end
255
- elsif $showAllTags
260
+ elsif @responseObj[:writerShowTags]
256
261
  @xml.tag!('gmd:taxonomy')
257
262
  end
258
263
 
@@ -264,7 +269,7 @@ module ADIWG
264
269
  codelistClass.writeXML('iso_spatialRepresentation',spType)
265
270
  end
266
271
  end
267
- elsif $showAllTags
272
+ elsif @responseObj[:writerShowTags]
268
273
  @xml.tag!('gmd:spatialRepresentationType')
269
274
  end
270
275
 
@@ -276,33 +281,75 @@ module ADIWG
276
281
  resolutionClass.writeXML(hSpRes)
277
282
  end
278
283
  end
279
- elsif $showAllTags
284
+ elsif @responseObj[:writerShowTags]
280
285
  @xml.tag!('gmd:spatialResolution')
281
286
  end
282
287
 
283
- # data identification - language - required - default of english applied
288
+ # data identification - language - required
289
+ languageTags = 0
284
290
  aLanguages = hDataId[:resourceLanguages]
285
291
  if !aLanguages.empty?
286
292
  aLanguages.each do |language|
293
+ languageTags += 1
287
294
  @xml.tag!('gmd:language') do
288
295
  @xml.tag!('gco:CharacterString', language)
289
296
  end
290
297
  end
291
- else
298
+ end
299
+
300
+ # data identification - locale - not supported in 19115-2
301
+ # encode languageCode and country as a string for gmd:language
302
+ aLocale = hDataId[:resourceLocales]
303
+ if !aLocale.empty?
304
+ aLocale.each do |hLocale|
305
+ if !hLocale[:languageCode].nil?
306
+ s = hLocale[:languageCode]
307
+ if !hLocale[:countryCode].nil?
308
+ s += '; ' + hLocale[:countryCode]
309
+ end
310
+ languageTags += 1
311
+ @xml.tag!('gmd:language') do
312
+ @xml.tag!('gco:CharacterString', s)
313
+ end
314
+ end
315
+ end
316
+ end
317
+
318
+ # language for resource was not specified, use 'eng; USA' as default
319
+ if languageTags == 0
292
320
  @xml.tag!('gmd:language') do
293
321
  @xml.tag!('gco:CharacterString', 'eng; USA')
294
322
  end
295
323
  end
296
324
 
297
- # data identification - characterSet - default 'utf8'
325
+ # data identification - characterSet - not required - default 'utf8'
326
+ characterSetTags = 0
298
327
  aCharSets = hDataId[:resourceCharacterSets]
299
328
  if !aCharSets.empty?
300
329
  aCharSets.each do |charSet|
330
+ characterSetTags += 1
301
331
  @xml.tag!('gmd:characterSet') do
302
332
  codelistClass.writeXML('iso_characterSet',charSet)
303
333
  end
304
334
  end
305
- else
335
+ end
336
+
337
+ # data identification - locale - not supported in 19115-2
338
+ # copy characterEncoding to gmd:characterSet
339
+ if !aLocale.empty?
340
+ aLocale.each do |hLocale|
341
+ s = hLocale[:characterEncoding]
342
+ if !s.nil?
343
+ characterSetTags += 1
344
+ @xml.tag!('gmd:characterSet') do
345
+ codelistClass.writeXML('iso_characterSet', s)
346
+ end
347
+ end
348
+ end
349
+ end
350
+
351
+ # characterSet encoding for resource was not specified, use 'utf8' as default
352
+ if characterSetTags == 0
306
353
  @xml.tag!('gmd:characterSet') do
307
354
  codelistClass.writeXML('iso_characterSet','utf8')
308
355
  end
@@ -316,7 +363,7 @@ module ADIWG
316
363
  enumerationClass.writeXML('iso_topicCategory',spType)
317
364
  end
318
365
  end
319
- elsif $showAllTags
366
+ elsif @responseObj[:writerShowTags]
320
367
  @xml.tag!('gmd:topicCategory')
321
368
  end
322
369
 
@@ -326,7 +373,7 @@ module ADIWG
326
373
  @xml.tag!('gmd:environmentDescription') do
327
374
  @xml.tag!('gco:CharacterString', s)
328
375
  end
329
- elsif $showAllTags
376
+ elsif @responseObj[:writerShowTags]
330
377
  @xml.tag!('gmd:environmentDescription')
331
378
  end
332
379
 
@@ -347,7 +394,7 @@ module ADIWG
347
394
  needTag = false
348
395
  end
349
396
 
350
- # add the remaining geographic, temporal, and veritcal extents
397
+ # add the remaining geographic, temporal, and vertical extents
351
398
  aExtents = hDataId[:extents]
352
399
  if !aExtents.empty?
353
400
  aExtents.each do |hExtent|
@@ -355,7 +402,7 @@ module ADIWG
355
402
  extentClass.writeXML(hExtent)
356
403
  end
357
404
  end
358
- elsif $showAllTags && needTag
405
+ elsif @responseObj[:writerShowTags] && needTag
359
406
  @xml.tag!('gmd:extent')
360
407
  end
361
408
 
@@ -365,7 +412,7 @@ module ADIWG
365
412
  @xml.tag!('gmd:supplementalInformation') do
366
413
  @xml.tag!('gco:CharacterString', s)
367
414
  end
368
- elsif $showAllTags
415
+ elsif @responseObj[:writerShowTags]
369
416
  @xml.tag!('gmd:supplementalInformation')
370
417
  end
371
418