adiwg-mdtranslator 2.9.2 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -2
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +8 -8
  4. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +179 -160
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +1 -2
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +1 -2
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +1 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +1 -2
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +1 -2
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +1 -2
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +1 -2
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +1 -2
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +1 -2
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +1 -2
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +1 -2
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +1 -2
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +1 -2
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +1 -2
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +1 -2
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +1 -2
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +1 -2
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +1 -2
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +1 -2
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +1 -2
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +1 -2
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +16 -4
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_citation.rb +14 -1
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +8 -2
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +36 -8
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +2 -2
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +2 -2
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_digitalForm.rb +8 -2
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_distribution.rb +8 -2
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +12 -3
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityAttribute.rb +5 -0
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +4 -1
  37. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +12 -3
  38. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
  39. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +13 -4
  40. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +13 -4
  41. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geologicAge.rb +6 -0
  42. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +3 -3
  43. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +58 -12
  44. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +36 -0
  45. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +8 -2
  46. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +1 -1
  47. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +51 -12
  48. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +46 -9
  49. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalPlanar.rb +8 -2
  50. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +4 -1
  51. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb +10 -4
  52. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +4 -1
  53. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_offlineOption.rb +16 -4
  54. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineOption.rb +13 -4
  55. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb +9 -1
  56. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_pointVector.rb +21 -4
  57. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +8 -1
  58. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_publication.rb +8 -2
  59. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +14 -3
  60. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +8 -2
  61. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +12 -3
  62. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_security.rb +12 -3
  63. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_series.rb +8 -2
  64. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +20 -5
  65. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +32 -8
  66. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +8 -2
  67. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +20 -5
  68. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +8 -2
  69. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +4 -1
  70. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +12 -3
  71. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +9 -0
  72. data/lib/adiwg/mdtranslator/readers/fgdc/version.rb +2 -1
  73. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +10 -10
  74. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -16
  75. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb +55 -55
  76. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb +85 -85
  77. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +8 -8
  78. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_associatedResource.rb +91 -92
  79. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attribute.rb +212 -212
  80. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb +43 -43
  81. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +8 -8
  82. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_boundingBox.rb +11 -11
  83. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +17 -17
  84. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +26 -13
  85. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +13 -12
  86. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +8 -5
  87. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb +77 -77
  88. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +9 -7
  89. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +54 -54
  90. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +35 -35
  91. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb +70 -70
  92. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +15 -4
  93. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distributor.rb +53 -53
  94. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +5 -5
  95. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +5 -5
  96. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_duration.rb +92 -91
  97. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +10 -10
  98. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +28 -18
  99. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityForeignKey.rb +58 -59
  100. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb +52 -53
  101. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_extent.rb +70 -56
  102. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_featureCollection.rb +64 -63
  103. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb +6 -6
  104. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_funding.rb +9 -6
  105. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geoJson.rb +47 -47
  106. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +7 -7
  107. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicExtent.rb +12 -7
  108. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +6 -5
  109. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geologicAge.rb +6 -6
  110. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryCollection.rb +63 -63
  111. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryFeature.rb +84 -84
  112. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryObject.rb +50 -49
  113. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryProperties.rb +57 -57
  114. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +115 -100
  115. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georeferenceableRepresentation.rb +85 -82
  116. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +46 -46
  117. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb +78 -78
  118. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gridRepresentation.rb +61 -56
  119. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_identifier.rb +72 -72
  120. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb +106 -107
  121. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +4 -4
  122. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb +46 -46
  123. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +55 -51
  124. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb +87 -83
  125. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb +46 -46
  126. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb +73 -74
  127. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +11 -5
  128. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_measure.rb +56 -55
  129. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_medium.rb +88 -88
  130. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +106 -105
  131. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +4 -3
  132. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb +4 -4
  133. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +7 -4
  134. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_onlineResource.rb +60 -61
  135. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb +47 -47
  136. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_party.rb +57 -57
  137. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_phone.rb +49 -51
  138. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_processStep.rb +6 -6
  139. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +31 -30
  140. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +16 -2
  141. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_releasability.rb +53 -47
  142. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -13
  143. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb +46 -46
  144. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceUsage.rb +95 -95
  145. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb +67 -67
  146. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb +47 -46
  147. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb +47 -47
  148. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb +68 -63
  149. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb +50 -50
  150. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb +38 -38
  151. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +8 -8
  152. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +6 -5
  153. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb +77 -75
  154. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +8 -14
  155. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +71 -72
  156. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +46 -45
  157. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +118 -116
  158. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_temporalExtent.rb +48 -46
  159. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInstant.rb +8 -8
  160. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInterval.rb +50 -50
  161. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +21 -14
  162. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +86 -75
  163. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +4 -4
  164. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorObject.rb +45 -45
  165. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb +45 -33
  166. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +28 -6
  167. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb +59 -59
  168. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_voucher.rb +43 -43
  169. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +6 -2
  170. data/lib/adiwg/mdtranslator/version.rb +9 -1
  171. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +3 -3
  172. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureConstraint.rb +50 -46
  173. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +53 -43
  174. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +3 -1
  175. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +1 -1
  176. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +58 -58
  177. data/lib/adiwg/mdtranslator.rb +177 -165
  178. data/lib/adiwg/mdtranslator_cli.rb +8 -3
  179. metadata +2 -2
@@ -22,7 +22,7 @@ module ADIWG
22
22
  # horizontal reference 4.1.1 (geograph) - geographic resolution
23
23
  xGeographic = xHorizontalRef.xpath('./geograph')
24
24
  unless xGeographic.empty?
25
- hResolution = GeographicResolution.unpack(xGeographic)
25
+ hResolution = GeographicResolution.unpack(xGeographic, hResponseObj)
26
26
  unless hResolution.nil?
27
27
  hResourceInfo[:spatialResolutions] << hResolution
28
28
  end
@@ -39,7 +39,7 @@ module ADIWG
39
39
  # horizontal reference 4.1.3 (local) - local coordinate system
40
40
  xLocal = xHorizontalRef.xpath('./local')
41
41
  unless xLocal.empty?
42
- hReferenceSystem = LocalSystem.unpack(xLocal)
42
+ hReferenceSystem = LocalSystem.unpack(xLocal, hResponseObj)
43
43
  unless hReferenceSystem.nil?
44
44
  hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
45
45
  end
@@ -48,7 +48,7 @@ module ADIWG
48
48
  # horizontal reference 4.1.4 (geodetic) - parameters for shape of earth
49
49
  xGeodetic = xHorizontalRef.xpath('./geodetic')
50
50
  unless xGeodetic.empty?
51
- hReferenceSystem = GeodeticReference.unpack(xHorizontalRef)
51
+ hReferenceSystem = GeodeticReference.unpack(xHorizontalRef, hResponseObj)
52
52
  unless hReferenceSystem.nil?
53
53
  hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
54
54
  end
@@ -37,36 +37,54 @@ module ADIWG
37
37
  hCitation = Citation.unpack(xCitation, hResponseObj)
38
38
  hResourceInfo[:citation] = hCitation unless hCitation.nil?
39
39
  end
40
+ if xCitation.empty?
41
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section citation is missing'
42
+ end
40
43
 
41
44
  # identification information 1.2 (descript) - description (required)
42
45
  xDescription = xIdInfo.xpath('./descript')
43
46
  unless xDescription.empty?
44
47
 
45
- # description 1.2.1 (abstract) - abstract
48
+ # description 1.2.1 (abstract) - abstract (required)
46
49
  abstract = xDescription.xpath('./abstract').text
47
50
  hResourceInfo[:abstract] = abstract unless abstract.empty?
51
+ if abstract.empty?
52
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section abstract is missing'
53
+ end
48
54
 
49
- # description 1.2.2 (purpose) - purpose
55
+ # description 1.2.2 (purpose) - purpose (required)
50
56
  purpose = xDescription.xpath('./purpose').text
51
57
  hResourceInfo[:purpose] = purpose unless purpose.empty?
58
+ if purpose.empty?
59
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section purpose is missing'
60
+ end
52
61
 
53
62
  # description 1.2.3 (supplinf) - supplemental information
54
63
  supplemental = xDescription.xpath('./supplinf').text
55
64
  hResourceInfo[:supplementalInfo] = supplemental unless supplemental.empty?
56
65
 
57
66
  end
67
+ if xDescription.empty?
68
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section description is missing'
69
+ end
58
70
 
59
- # identification information 1.3 (timeperd) - time period of content
71
+
72
+ # identification information 1.3 (timeperd) - time period of content (required)
73
+ haveTimePeriod = false
60
74
  xTimePeriod = xIdInfo.xpath('./timeperd')
61
75
  unless xTimePeriod.empty?
62
76
 
63
- # timeInfo currentness
77
+ # timeInfo currentness (required)
64
78
  current = xTimePeriod.xpath('./current').text
79
+ if current.empty?
80
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section time period currentness is missing'
81
+ end
65
82
 
66
83
  # time period for single date, multi-date, and date range {resource timePeriod}
67
84
  hTimePeriod = TimePeriod.unpack(xTimePeriod, hResponseObj)
68
85
  hResourceInfo[:timePeriod] = hTimePeriod unless hTimePeriod.nil?
69
86
  hResourceInfo[:timePeriod][:description] = current
87
+ haveTimePeriod = true unless hTimePeriod.nil?
70
88
 
71
89
  # time period multi-date also placed in temporalExtent
72
90
  axMultiple = xTimePeriod.xpath('./timeinfo/mdattim/sngdate')
@@ -80,42 +98,64 @@ module ADIWG
80
98
  hInstant[:description] = current
81
99
  hTempExtent[:timeInstant] = hInstant
82
100
  hExtent[:temporalExtents] << hTempExtent
83
- end
101
+ haveTimePeriod = true end
84
102
  end
85
103
  hResourceInfo[:extents] << hExtent unless hExtent[:temporalExtents].empty?
86
104
  end
87
105
 
88
106
  end
107
+ unless haveTimePeriod
108
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification section time period is missing'
109
+ end
89
110
 
90
- # identification information 1.4 (status) - status and maintenance
111
+ # identification information 1.4 (status) - status and maintenance (required)
91
112
  xStatus = xIdInfo.xpath('./status')
92
113
  unless xStatus.empty?
93
114
 
94
- # status 1.4.1 (progress) - state of resource
115
+ # status 1.4.1 (progress) - state of resource (required)
95
116
  progress = xStatus.xpath('./progress').text
96
117
  hResourceInfo[:status] << progress unless progress.empty?
118
+ if progress.empty?
119
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification progress is missing'
120
+ end
97
121
 
98
- # status 1.4.2 (update) - maintenance frequency
122
+ # status 1.4.2 (update) - maintenance frequency (required)
99
123
  update = xStatus.xpath('./update').text
100
124
  unless update.empty?
101
125
  hMaintenance = intMetadataClass.newMaintenance
102
126
  hMaintenance[:frequency] = update
103
127
  hResourceInfo[:resourceMaintenance] << hMaintenance
104
128
  end
129
+ if update.empty?
130
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification update frequency is missing'
131
+ end
105
132
 
106
133
  end
134
+ if xStatus.empty?
135
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification status is missing'
136
+ end
107
137
 
108
- # identification information 1.5 (spdom) - spatial domain
138
+ # identification information 1.5 (spdom) - spatial domain (required)
109
139
  xDomain = xIdInfo.xpath('./spdom')
110
140
  unless xDomain.empty?
111
141
  hExtent = SpatialDomain.unpack(xDomain, hResponseObj)
112
142
  hResourceInfo[:extents] << hExtent unless hExtent.nil?
113
143
  end
144
+ if xDomain.empty?
145
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification spatial domain section is missing'
146
+ end
114
147
 
115
- # identification information 1.6 (keywords) - keywords
148
+ # identification information 1.6 (keywords) - keywords (required)
116
149
  xKeywords = xIdInfo.xpath('./keywords')
117
150
  unless xKeywords.empty?
118
151
  Keyword.unpack(xKeywords, hResourceInfo, hResponseObj)
152
+ xTheme = xKeywords.xpath('./theme')
153
+ if xTheme.empty?
154
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification keyword section is missing theme keywords'
155
+ end
156
+ end
157
+ if xKeywords.empty?
158
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification keyword section is missing'
119
159
  end
120
160
 
121
161
  # identification information bio (taxonomy) - taxonomic information
@@ -127,8 +167,8 @@ module ADIWG
127
167
  end
128
168
  end
129
169
 
130
- # identification information 1.7 (accconst) - access constraints
131
- # identification information 1.8 (useconst) - use constraints
170
+ # identification information 1.7 (accconst) - access constraints (required)
171
+ # identification information 1.8 (useconst) - use constraints (required)
132
172
  accessCon = xIdInfo.xpath('./accconst').text
133
173
  useCon = xIdInfo.xpath('./useconst').text
134
174
  hConstraint = intMetadataClass.newConstraint
@@ -143,6 +183,12 @@ module ADIWG
143
183
  hConstraint[:legalConstraint] = hLegal
144
184
  hResourceInfo[:constraints] << hConstraint
145
185
  end
186
+ if accessCon.empty?
187
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification access constraint is missing'
188
+ end
189
+ if useCon.empty?
190
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification use constraint is missing'
191
+ end
146
192
 
147
193
  # identification information 1.9 (ptcontac) - point of contact {contact}
148
194
  xContact = xIdInfo.xpath('./ptcontac')
@@ -39,6 +39,9 @@ module ADIWG
39
39
  hKeyword[:keywordType] = 'isoTopicCategory'
40
40
  end
41
41
  end
42
+ if thesaurus.empty?
43
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: theme keyword thesaurus is missing'
44
+ end
42
45
 
43
46
  # theme keyword 1.6.1.2 (themekey) - theme keyword keyword {keywordObject}
44
47
  axKeywords = xTheme.xpath('./themekey')
@@ -52,6 +55,9 @@ module ADIWG
52
55
  end
53
56
  end
54
57
  end
58
+ if axKeywords.empty?
59
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: theme keyword is missing'
60
+ end
55
61
 
56
62
  aKeywords << hKeyword
57
63
 
@@ -72,6 +78,9 @@ module ADIWG
72
78
  hCitation[:title] = thesaurus
73
79
  hKeyword[:thesaurus] = hCitation
74
80
  end
81
+ if thesaurus.empty?
82
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: place keyword thesaurus is missing'
83
+ end
75
84
 
76
85
  # theme keyword 1.6.2.2 (placekey) - place keyword keyword {keywordObject}
77
86
  axKeywords = xPlace.xpath('./placekey')
@@ -85,6 +94,9 @@ module ADIWG
85
94
  end
86
95
  end
87
96
  end
97
+ if axKeywords.empty?
98
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: place keyword is missing'
99
+ end
88
100
 
89
101
  aKeywords << hKeyword
90
102
 
@@ -105,6 +117,9 @@ module ADIWG
105
117
  hCitation[:title] = thesaurus
106
118
  hKeyword[:thesaurus] = hCitation
107
119
  end
120
+ if thesaurus.empty?
121
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: stratum keyword thesaurus is missing'
122
+ end
108
123
 
109
124
  # theme keyword 1.6.3.2 (stratkey) - stratum keyword keyword {keywordObject}
110
125
  axKeywords = xStratum.xpath('./stratkey')
@@ -118,6 +133,9 @@ module ADIWG
118
133
  end
119
134
  end
120
135
  end
136
+ if axKeywords.empty?
137
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: stratum keyword is missing'
138
+ end
121
139
 
122
140
  aKeywords << hKeyword
123
141
 
@@ -138,6 +156,9 @@ module ADIWG
138
156
  hCitation[:title] = thesaurus
139
157
  hKeyword[:thesaurus] = hCitation
140
158
  end
159
+ if thesaurus.empty?
160
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: temporal keyword thesaurus is missing'
161
+ end
141
162
 
142
163
  # theme keyword 1.6.4.2 (tempkey) - temporal keyword keyword {keywordObject}
143
164
  axKeywords = xTemporal.xpath('./tempkey')
@@ -151,6 +172,9 @@ module ADIWG
151
172
  end
152
173
  end
153
174
  end
175
+ if axKeywords.empty?
176
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: temporal keyword is missing'
177
+ end
154
178
 
155
179
  aKeywords << hKeyword
156
180
 
@@ -170,6 +194,9 @@ module ADIWG
170
194
  hCitation[:title] = thesaurus
171
195
  hKeyword[:thesaurus] = hCitation
172
196
  end
197
+ if thesaurus.empty?
198
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy keyword thesaurus is missing'
199
+ end
173
200
 
174
201
  # theme keyword bio.1.2 (taxonkey) - taxonomy keyword keywords {keywordObject}
175
202
  axKeywords = xKeywords.xpath('./taxonkey')
@@ -183,6 +210,9 @@ module ADIWG
183
210
  end
184
211
  end
185
212
  end
213
+ if axKeywords.empty?
214
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy keyword is missing'
215
+ end
186
216
 
187
217
  aKeywords << hKeyword
188
218
 
@@ -201,6 +231,9 @@ module ADIWG
201
231
  hCitation[:title] = thesaurus
202
232
  hKeyword[:thesaurus] = hCitation
203
233
  end
234
+ if thesaurus.empty?
235
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO method keyword thesaurus is missing'
236
+ end
204
237
 
205
238
  # theme keyword bio.1.2 (methkey) - lineage method keywords {keywordObject}
206
239
  axKeywords = xKeywords.xpath('./methkey')
@@ -214,6 +247,9 @@ module ADIWG
214
247
  end
215
248
  end
216
249
  end
250
+ if axKeywords.empty?
251
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO method keyword is missing'
252
+ end
217
253
 
218
254
  aKeywords << hKeyword
219
255
 
@@ -27,11 +27,14 @@ module ADIWG
27
27
  # data quality 2.5 (lineage) - lineage
28
28
  unless xLineage.empty?
29
29
 
30
- # lineage bio (method) - methodology []
30
+ # lineage bio (method) - methodology [] (required)
31
31
  axMethods = xLineage.xpath('./method')
32
32
  unless axMethods.empty?
33
33
  Method.unpack(hLineage, axMethods, hResponseObj)
34
34
  end
35
+ if axMethods.empty?
36
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO lineage methodology section is missing'
37
+ end
35
38
 
36
39
  # lineage 2.5.1 (srcinfo) - source information []
37
40
  axSource = xLineage.xpath('./srcinfo')
@@ -42,7 +45,7 @@ module ADIWG
42
45
  end
43
46
  end
44
47
 
45
- # lineage 2.5.2 (procstep) - process step []
48
+ # lineage 2.5.2 (procstep) - process step [] (required)
46
49
  axProcess = xLineage.xpath('./procstep')
47
50
  unless axProcess.empty?
48
51
  axProcess.each do |xProcess|
@@ -50,6 +53,9 @@ module ADIWG
50
53
  hLineage[:processSteps] << hProcess
51
54
  end
52
55
  end
56
+ if axProcess.empty?
57
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: lineage process step section is missing'
58
+ end
53
59
 
54
60
  return hLineage
55
61
 
@@ -14,7 +14,7 @@ module ADIWG
14
14
 
15
15
  module LocalSystem
16
16
 
17
- def self.unpack(xLocal)
17
+ def self.unpack(xLocal, hResponseObj)
18
18
 
19
19
  # instance classes needed in script
20
20
  intMetadataClass = InternalMetadata.new
@@ -19,39 +19,53 @@ module ADIWG
19
19
  # instance classes needed in script
20
20
  intMetadataClass = InternalMetadata.new
21
21
 
22
- # map projection 4.1.2.4.1 (plance) - planar coordinate encoding method
22
+ # map projection 4.1.2.4.1 (plance) - planar coordinate encoding method (required)
23
23
  # -> resourceInfo.spatialRepresentationTypes
24
24
  encoding = xPlanarCI.xpath('./plance').text
25
25
  unless encoding.empty?
26
26
  hResourceInfo[:spatialRepresentationTypes] << encoding
27
27
  end
28
+ if encoding.empty?
29
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: planar coordinate encoding method is missing'
30
+ end
28
31
 
29
- # map projection 4.1.2.4.2 (coordrep) - coordinate representation
32
+ haveRep = false
33
+ # map projection 4.1.2.4.2 (coordrep) - coordinate representation (required)
30
34
  xCoordRep = xPlanarCI.xpath('./coordrep')
31
35
  unless xCoordRep.empty?
32
36
 
37
+ haveRep = true
33
38
  hCoordResolution = intMetadataClass.newCoordinateResolution
34
39
 
35
- # map projection 4.1.2.4.2.1 (absres) - abscissa resolution
40
+ # map projection 4.1.2.4.2.1 (absres) - abscissa resolution (required)
36
41
  # -> resourceInfo.spatialResolutions.spatialResolution.coordinateResolution.abscissaResolutionX
37
42
  abscissa = xCoordRep.xpath('./absres').text
38
43
  unless abscissa.empty?
39
44
  hCoordResolution[:abscissaResolutionX] = abscissa.to_f
40
45
  end
46
+ if abscissa.empty?
47
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: coordinate representation abscissa resolution is missing'
48
+ end
41
49
 
42
- # map projection 4.1.2.4.2.2 (ordres) - ordinate resolution
50
+ # map projection 4.1.2.4.2.2 (ordres) - ordinate resolution (required)
43
51
  # -> resourceInfo.spatialResolutions.spatialResolution.coordinateResolution.ordinateResolutionY
44
52
  ordinate = xCoordRep.xpath('./ordres').text
45
53
  unless ordinate.empty?
46
54
  hCoordResolution[:ordinateResolutionY] = ordinate.to_f
47
55
  end
56
+ if ordinate.empty?
57
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: coordinate representation ordinate resolution is missing'
58
+ end
48
59
 
49
- # map projection 4.1.2.4.4 (plandu) - planar distance units
60
+ # map projection 4.1.2.4.4 (plandu) - planar distance units (required)
50
61
  # -> resourceInfo.spatialResolutions.spatialResolution.coordinateResolution.unitOfMeasure
51
62
  distUnits = xPlanarCI.xpath('./plandu').text
52
63
  unless distUnits.empty?
53
64
  hCoordResolution[:unitOfMeasure] = distUnits
54
65
  end
66
+ if distUnits.empty?
67
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: planar distance units are missing'
68
+ end
55
69
 
56
70
  hResolution = intMetadataClass.newSpatialResolution
57
71
  hResolution[:coordinateResolution] = hCoordResolution
@@ -59,52 +73,72 @@ module ADIWG
59
73
 
60
74
  end
61
75
 
62
- # map projection 4.1.2.4.3 (distbrep) - distance and bearing representation
76
+ # map projection 4.1.2.4.3 (distbrep) - distance and bearing representation (required)
63
77
  xBDRep = xPlanarCI.xpath('./distbrep')
64
78
  unless xBDRep.empty?
65
79
 
80
+ haveRep = true
66
81
  hBDResolution = intMetadataClass.newBearingDistanceResolution
67
82
 
68
- # map projection 4.1.2.4.3.1 (distres) - distance resolution
83
+ # map projection 4.1.2.4.3.1 (distres) - distance resolution (required)
69
84
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.distanceResolution
70
85
  distRes = xBDRep.xpath('./distres').text
71
86
  unless distRes.empty?
72
87
  hBDResolution[:distanceResolution] = distRes.to_f
73
88
  end
89
+ if distRes.empty?
90
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance distance resolution is missing'
91
+ end
74
92
 
75
- # map projection 4.1.2.4.4 (plandu) - planar distance units
93
+ # map projection 4.1.2.4.4 (plandu) - planar distance units (required)
76
94
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.distanceUnitOfMeasure
77
95
  distUnits = xPlanarCI.xpath('./plandu').text
78
96
  unless distUnits.empty?
79
97
  hBDResolution[:distanceUnitOfMeasure] = distUnits
80
98
  end
81
- # map projection 4.1.2.4.3.2 (bearres) - bearing resolution
99
+ if distUnits.empty?
100
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance distance units is missing'
101
+ end
102
+
103
+ # map projection 4.1.2.4.3.2 (bearres) - bearing resolution (required)
82
104
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.bearingResolution
83
105
  bearingRes = xBDRep.xpath('./bearres').text
84
106
  unless bearingRes.empty?
85
107
  hBDResolution[:bearingResolution] = bearingRes.to_f
86
108
  end
109
+ if bearingRes.empty?
110
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance bearing resolution is missing'
111
+ end
87
112
 
88
- # map projection 4.1.2.4.3.3 (bearunit) - bearing units
113
+ # map projection 4.1.2.4.3.3 (bearunit) - bearing units (required)
89
114
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.bearingUnitsOfMeasure
90
115
  bearingUnits = xBDRep.xpath('./bearunit').text
91
116
  unless bearingUnits.empty?
92
117
  hBDResolution[:bearingUnitsOfMeasure] = bearingUnits
93
118
  end
119
+ if bearingUnits.empty?
120
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance bearing units is missing'
121
+ end
94
122
 
95
- # map projection 4.1.2.4.3.4 (bearrefd) - bearing reference direction
123
+ # map projection 4.1.2.4.3.4 (bearrefd) - bearing reference direction (required)
96
124
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.bearingReferenceDirection
97
125
  bearingDirection = xBDRep.xpath('./bearrefd').text
98
126
  unless bearingDirection.empty?
99
127
  hBDResolution[:bearingReferenceDirection] = bearingDirection
100
128
  end
129
+ if bearingDirection.empty?
130
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance bearing direction is missing'
131
+ end
101
132
 
102
- # map projection 4.1.2.4.3.5 (bearrefm) - bearing reference meridian
133
+ # map projection 4.1.2.4.3.5 (bearrefm) - bearing reference meridian (required)
103
134
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.bearingReferenceMeridian
104
135
  bearingMeridian = xBDRep.xpath('./bearrefm').text
105
136
  unless bearingMeridian.empty?
106
137
  hBDResolution[:bearingReferenceMeridian] = bearingMeridian
107
138
  end
139
+ if bearingMeridian.empty?
140
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bearing-distance bearing meridian is missing'
141
+ end
108
142
 
109
143
  hResolution = intMetadataClass.newSpatialResolution
110
144
  hResolution[:bearingDistanceResolution] = hBDResolution
@@ -112,6 +146,11 @@ module ADIWG
112
146
 
113
147
  end
114
148
 
149
+ # error messages
150
+ unless haveRep
151
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: planar coordinate representation is missing'
152
+ end
153
+
115
154
  # map projection 4.1.2.4.4 (plandu) - planar distance units
116
155
  # handled in sections coordinateResolution and bearingDistanceResolution sections above
117
156
  # -> resourceInfo.spatialResolutions.spatialResolution.bearingDistanceResolution.distanceUnitOfMeasure
@@ -26,32 +26,43 @@ module ADIWG
26
26
  intMetadataClass = InternalMetadata.new
27
27
  hProjection = intMetadataClass.newProjection
28
28
 
29
- # grid system 4.1.2.2.1 (gridsysn) - grid coordinate system name
29
+ # grid system 4.1.2.2.1 (gridsysn) - grid coordinate system name (required)
30
30
  # -> ReferenceSystemParameters.projection.projectionIdentifier.identifier
31
31
  gridName = xMapGrid.xpath('./gridsysn').text
32
32
  unless gridName.empty?
33
33
  hProjection[:gridSystemName] = gridName
34
34
  end
35
+ if gridName.empty?
36
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: grid system name is missing'
37
+ end
35
38
 
39
+ haveGrid = false
36
40
  # grid system 4.1.2.2.2 (utm) - universal transverse mercator
37
41
  xUTM = xMapGrid.xpath('./utm')
38
42
  unless xUTM.empty?
39
43
 
44
+ haveGrid = true
40
45
  hProjection[:gridSystem] = 'utm'
41
46
  hProjection[:gridSystemName] = 'Universal Transverse Mercator (UTM)' if gridName.empty?
42
47
 
43
- # grid system 4.1.2.2.2.1 (utmzone) - utm zone number {-60..-1, 1..60}
48
+ # grid system 4.1.2.2.2.1 (utmzone) - utm zone number {-60..-1, 1..60} (required)
44
49
  # -> ReferenceSystemParameters.projection.gridZone
45
50
  zone = xUTM.xpath('./utmzone').text
46
51
  unless zone.empty?
47
52
  hProjection[:gridZone] = zone
48
53
  end
54
+ if zone.empty?
55
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UTM zone number is missing'
56
+ end
49
57
 
50
- # + transverse mercator
58
+ # + transverse mercator (required)
51
59
  xTransMer = xUTM.xpath('./transmer')
52
60
  unless xTransMer.empty?
53
61
  return TransverseMercatorProjection.unpack(xTransMer, hProjection, hResponseObj)
54
62
  end
63
+ if xTransMer.empty?
64
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UTM transverse mercator definition is missing'
65
+ end
55
66
 
56
67
  end
57
68
 
@@ -59,21 +70,28 @@ module ADIWG
59
70
  xUSP = xMapGrid.xpath('./ups')
60
71
  unless xUSP.empty?
61
72
 
73
+ haveGrid = true
62
74
  hProjection[:gridSystem] = 'ups'
63
75
  hProjection[:gridSystemName] = 'Universal Polar Stereographic (UPS)' if gridName.empty?
64
76
 
65
- # grid system 4.1.2.2.3.1 (upszone) - utm zone number {-60..-1, 1..60}
77
+ # grid system 4.1.2.2.3.1 (upszone) - utm zone number {-60..-1, 1..60} (required)
66
78
  # -> ReferenceSystemParameters.projection.gridZone
67
79
  zone = xUSP.xpath('./upszone').text
68
80
  unless zone.empty?
69
81
  hProjection[:gridZone] = zone
70
82
  end
83
+ if zone.empty?
84
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UPS zone number is missing'
85
+ end
71
86
 
72
- # + polar stereographic
87
+ # + polar stereographic (required)
73
88
  xPolarS = xUSP.xpath('./polarst')
74
89
  unless xPolarS.empty?
75
90
  return PolarStereoProjection.unpack(xPolarS, hProjection, hResponseObj)
76
91
  end
92
+ if xPolarS.empty?
93
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UPS polar stereographic definition is missing'
94
+ end
77
95
 
78
96
  end
79
97
 
@@ -84,14 +102,18 @@ module ADIWG
84
102
  hProjection[:gridSystem] = 'spcs'
85
103
  hProjection[:gridSystemName] = 'State Plane Coordinate System (SPCS)' if gridName.empty?
86
104
 
87
- # grid system 4.1.2.2.4.1 (spcszone) - state plane zone number {nnnn}
105
+ haveGrid = true
106
+ # grid system 4.1.2.2.4.1 (spcszone) - state plane zone number {nnnn} (required)
88
107
  # -> ReferenceSystemParameters.projection.gridZone
89
108
  zone = xStateP.xpath('./spcszone').text
90
109
  unless zone.empty?
91
110
  hProjection[:gridZone] = zone
92
111
  end
112
+ if zone.empty?
113
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: state plane zone number is missing'
114
+ end
93
115
 
94
- # + [ lambert conformal conic | transverse mercator | oblique mercator | polyconic ]
116
+ # + [ lambert conformal conic | transverse mercator | oblique mercator | polyconic ] (required)
95
117
  # + lambert conformal conic
96
118
  xLambert = xStateP.xpath('./lambertc')
97
119
  unless xLambert.empty?
@@ -116,23 +138,30 @@ module ADIWG
116
138
  return PolyconicProjection.unpack(xPolyCon, hProjection, hResponseObj)
117
139
  end
118
140
 
141
+ # error message
142
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UPS state plane projection definition is missing'
143
+
119
144
  end
120
145
 
121
146
  # grid system 4.1.2.2.5 (arcsys) - equal arc-second coordinate system
122
147
  xArc = xMapGrid.xpath('./arcsys')
123
148
  unless xArc.empty?
124
149
 
150
+ haveGrid = true
125
151
  hProjection[:gridSystem] = 'arcsys'
126
152
  hProjection[:gridSystemName] = 'Equal Arc-second Coordinate System (ARC)' if gridName.empty?
127
153
 
128
- # grid system 4.1.2.2.5.1 (arcszone) - state plane zone number {1..18}
154
+ # grid system 4.1.2.2.5.1 (arcszone) - state plane zone number {1..18} (required)
129
155
  # -> ReferenceSystemParameters.projection.gridZone
130
156
  zone = xArc.xpath('./arczone').text
131
157
  unless zone.empty?
132
158
  hProjection[:gridZone] = zone
133
159
  end
160
+ if zone.empty?
161
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: equal arc-second zone number is missing'
162
+ end
134
163
 
135
- # + [ equirectangular | azimuthal equidistant ]
164
+ # + [ equirectangular | azimuthal equidistant ] (required)
136
165
  # + equirectangular
137
166
  xEquiR = xArc.xpath('./equirect')
138
167
  unless xEquiR.empty?
@@ -145,6 +174,8 @@ module ADIWG
145
174
  return AzimuthEquidistantProjection.unpack(xAzimuthE, hProjection, hResponseObj)
146
175
  end
147
176
 
177
+ # error message
178
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UPS equal arc-second projection definition is missing'
148
179
  end
149
180
 
150
181
  # grid system 4.1.2.2.6 (othergrd) - other coordinate system {text}
@@ -152,6 +183,7 @@ module ADIWG
152
183
  otherG = xMapGrid.xpath('./othergrd').text
153
184
  unless otherG.empty?
154
185
 
186
+ haveGrid = true
155
187
  hProjection[:gridSystem] = 'other'
156
188
  hProjection[:gridSystemName] = 'other grid coordinate system' if gridName.empty?
157
189
 
@@ -159,6 +191,11 @@ module ADIWG
159
191
  return hProjection
160
192
  end
161
193
 
194
+ # error message
195
+ unless haveGrid
196
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: grid system is missing'
197
+ end
198
+
162
199
  return nil
163
200
 
164
201
  end