adiwg-mdtranslator 2.10.0 → 2.12.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
  16. data/lib/adiwg/mdtranslator/version.rb +8 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
  22. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
  23. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
  24. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
  25. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
  26. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
  27. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
  28. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
  29. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
  30. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
  31. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
  32. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
  33. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
  34. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
  35. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
  36. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
  37. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
  38. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
  39. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
  40. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
  41. data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
  42. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
  43. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
  44. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
  45. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
  46. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
  47. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
  48. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
  49. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
  50. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
  51. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
  52. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
  53. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
  54. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
  55. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
  67. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
  68. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
  69. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
  70. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
  71. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
  72. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
  73. data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
  74. data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
  75. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
  76. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
  77. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
  78. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
  79. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
  80. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
  81. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
  82. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
  83. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
  84. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
  85. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
  86. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
  87. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
  88. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
  89. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
  90. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
  91. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
  92. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
  93. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
  94. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
  95. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
  96. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
  97. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
  98. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
  99. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
  100. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
  103. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
  104. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
  105. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
  106. data/lib/adiwg/mdtranslator_cli.rb +18 -8
  107. metadata +14 -8
  108. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -2,8 +2,11 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-16 refactored error and warning messaging
5
6
  # Stan Smith 2017-11-28 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
@@ -14,9 +17,10 @@ module ADIWG
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
- def writeXML(aPhones)
23
+ def writeXML(aPhones, context = nil)
20
24
 
21
25
  # phone 10.5 (cntvoice) - voice phone [] (required)
22
26
  # <- hPhone[:phoneNumber] where hPhone[:phoneServiceTypes] = 'voice'
@@ -30,8 +34,7 @@ module ADIWG
30
34
  end
31
35
  end
32
36
  unless haveVoice
33
- @hResponseObj[:writerPass] = false
34
- @hResponseObj[:writerMessages] << 'Contact is missing voice phone'
37
+ @NameSpace.issueWarning(5, 'cntvoice', context)
35
38
  end
36
39
 
37
40
  # phone 10.6 (cnttdd) - tty phone []
@@ -0,0 +1,146 @@
1
+ # FGDC <<Class>> PlanarReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2018-03-21 original script
6
+
7
+ require_relative 'class_mapProjectionTags'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Fgdc
13
+
14
+ class PlanarGrid
15
+
16
+ def initialize(xml, hResponseObj)
17
+ @xml = xml
18
+ @hResponseObj = hResponseObj
19
+ end
20
+
21
+ def writeXML(hProjection)
22
+
23
+ # classes used
24
+ classTags = MapProjectionTags.new(@xml, @hResponseObj)
25
+
26
+ # planar 4.1.2.2 (gridsys) - grid coordinate system
27
+ # <- hProjection.projectionName = oneOf ...
28
+ gridSystem = hProjection[:gridSystem]
29
+ case gridSystem
30
+ when 'utm'
31
+ @xml.tag!('gridsys') do
32
+ if hProjection[:gridSystemName].nil?
33
+ classTags.write_gridName('Universal Transverse Mercator (UTM)')
34
+ else
35
+ classTags.write_gridName(hProjection[:gridSystemName])
36
+ end
37
+ @xml.tag!('utm') do
38
+ classTags.write_utmZone(hProjection)
39
+ @xml.tag!('transmer') do
40
+ classTags.write_scaleFactorCM(hProjection)
41
+ classTags.write_longCM(hProjection)
42
+ classTags.write_latPO(hProjection)
43
+ classTags.write_falseNE(hProjection)
44
+ end
45
+ end
46
+ end
47
+ when 'ups'
48
+ @xml.tag!('gridsys') do
49
+ if hProjection[:gridSystemName].nil?
50
+ classTags.write_gridName('Universal Polar Stereographic (UPS)')
51
+ else
52
+ classTags.write_gridName(hProjection[:gridSystemName])
53
+ end
54
+ @xml.tag!('ups') do
55
+ classTags.write_upsZone(hProjection)
56
+ @xml.tag!('polarst') do
57
+ classTags.write_straightFromPole(hProjection)
58
+ if hProjection[:standardParallel1] || hProjection[:standardParallel2]
59
+ classTags.write_standParallel(hProjection)
60
+ elsif hProjection[:scaleFactorAtProjectionOrigin]
61
+ classTags.write_scaleFactorPO(hProjection)
62
+ end
63
+ classTags.write_falseNE(hProjection)
64
+ end
65
+ end
66
+ end
67
+ when 'spcs'
68
+ @xml.tag!('gridsys') do
69
+ if hProjection[:gridSystemName].nil?
70
+ classTags.write_gridName('State Plane Coordinate System')
71
+ else
72
+ classTags.write_gridName(hProjection[:gridSystemName])
73
+ end
74
+ @xml.tag!('spcs') do
75
+ classTags.write_spcsZone(hProjection)
76
+ if hProjection[:standardParallel1] || hProjection[:standardParallel2]
77
+ @xml.tag!('lambertc') do
78
+ classTags.write_standParallel(hProjection)
79
+ classTags.write_longCM(hProjection)
80
+ classTags.write_latPO(hProjection)
81
+ classTags.write_falseNE(hProjection)
82
+ end
83
+ elsif hProjection[:scaleFactorAtCenterLine]
84
+ @xml.tag!('obqmerc') do
85
+ classTags.write_scaleFactorCL(hProjection)
86
+ if hProjection[:obliqueLinePoints].empty?
87
+ classTags.write_obliqueLineAzimuth(hProjection)
88
+ else
89
+ @xml.tag!('obqlpt') do
90
+ hProjection[:obliqueLinePoints].each do |hLinePt|
91
+ classTags.write_obliqueLinePoint(hLinePt)
92
+ end
93
+ end
94
+ end
95
+ classTags.write_latPO(hProjection)
96
+ classTags.write_falseNE(hProjection)
97
+ end
98
+ elsif hProjection[:scaleFactorAtCentralMeridian]
99
+ @xml.tag!('transmer') do
100
+ classTags.write_scaleFactorCM(hProjection)
101
+ classTags.write_longCM(hProjection)
102
+ classTags.write_latPO(hProjection)
103
+ classTags.write_falseNE(hProjection)
104
+ end
105
+ else
106
+ @xml.tag!('polycon') do
107
+ classTags.write_longCM(hProjection)
108
+ classTags.write_latPO(hProjection)
109
+ classTags.write_falseNE(hProjection)
110
+ end
111
+ end
112
+ end
113
+ end
114
+ when 'arcsys'
115
+ @xml.tag!('gridsys') do
116
+ if hProjection[:gridSystemName].nil?
117
+ classTags.write_gridName('Equal Arc-second Coordinate System')
118
+ else
119
+ classTags.write_gridName(hProjection[:gridSystemName])
120
+ end
121
+ @xml.tag!('arcsys') do
122
+ classTags.write_arcZone(hProjection)
123
+ if hProjection[:standardParallel1] || hProjection[:standardParallel2]
124
+ @xml.tag!('equirect') do
125
+ classTags.write_standParallel(hProjection)
126
+ classTags.write_longCM(hProjection)
127
+ classTags.write_falseNE(hProjection)
128
+ end
129
+ elsif hProjection[:latitudeOfProjectionOrigin]
130
+ @xml.tag!('azimequi') do
131
+ classTags.write_longCM(hProjection)
132
+ classTags.write_latPO(hProjection)
133
+ classTags.write_falseNE(hProjection)
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+
140
+ end # writeXML
141
+ end # PlanarGrid
142
+
143
+ end
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,168 @@
1
+ # FGDC <<Class>> SpatialReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2018-03-20 refactored error and warning messaging
6
+ # Stan Smith 2018-01-12 original script
7
+
8
+ require_relative '../fgdc_writer'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Writers
13
+ module Fgdc
14
+
15
+ class PlanarInformation
16
+
17
+ def initialize(xml, hResponseObj)
18
+ @xml = xml
19
+ @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
21
+ end
22
+
23
+ def writeXML(aRepTypes, aResolutions)
24
+
25
+ # <- spatialReferencesTypes[] (encoding method) 4.1.2.4.1
26
+ # <- spatialResolution[].coordinateResolution (coordinate representation) 4.1.2.4.2
27
+ # <- spatialResolution[].bearingDistanceResolution (bearing-distance representation) 4.1.2.4.3
28
+ # <- spatialResolution[] (distance units) 4.1.2.4.4
29
+
30
+ haveCInfo = false
31
+ haveCInfo = true unless aRepTypes.empty?
32
+ aResolutions.each do |hResolution|
33
+ haveCInfo = true if hResolution[:coordinateResolution]
34
+ haveCInfo = true if hResolution[:bearingDistanceResolution]
35
+ end
36
+ unitOfMeasure = nil
37
+
38
+ # coordinate information 4.1.2.4 (planci) - planar coordinate information
39
+ if haveCInfo
40
+ @xml.tag!('planci') do
41
+
42
+ # coordinate information 4.1.2.4.1 (plance) - planar coordinate encoding method (required)
43
+ # <- spatialRepresentationTypes[].first
44
+ unless aRepTypes.empty?
45
+ @xml.tag!('plance', aRepTypes[0])
46
+ end
47
+ if aRepTypes.empty?
48
+ @NameSpace.issueWarning(260, 'plance')
49
+ end
50
+
51
+ # <- spatialResolutions[] look for coordinateResolution or bearingDistanceResolution
52
+ # take first one encountered, only one is permitted in FGDC
53
+ aResolutions.each do |hResolution|
54
+ unless hResolution[:coordinateResolution].empty?
55
+ hCoordRes = hResolution[:coordinateResolution]
56
+
57
+ # coordinate information 4.1.2.4.2 (coordrep) - coordinate representation
58
+ @xml.tag!('coordrep') do
59
+
60
+ # coordinate information 4.1.2.4.2.1 (absres) - abscissa resolution (required)
61
+ unless hCoordRes[:abscissaResolutionX].nil?
62
+ @xml.tag!('absres', hCoordRes[:abscissaResolutionX].to_f)
63
+ end
64
+ if hCoordRes[:abscissaResolutionX].nil?
65
+ @NameSpace.issueWarning(261, 'absres')
66
+ end
67
+
68
+ # coordinate information 4.1.2.4.2.2 (ordres) - ordinate resolution (required)
69
+ unless hCoordRes[:ordinateResolutionY].nil?
70
+ @xml.tag!('ordres', hCoordRes[:ordinateResolutionY].to_f)
71
+ end
72
+ if hCoordRes[:ordinateResolutionY].nil?
73
+ @NameSpace.issueWarning(262, 'ordres')
74
+ end
75
+
76
+ # coordinate information 4.1.2.4.4 (plandu) - distance unit of measure (required)
77
+ unless hCoordRes[:unitOfMeasure].nil?
78
+ unitOfMeasure = hCoordRes[:unitOfMeasure]
79
+ end
80
+ if hCoordRes[:unitOfMeasure].nil?
81
+ @NameSpace.issueWarning(263, 'plandu')
82
+ end
83
+
84
+ end
85
+ break
86
+ end
87
+
88
+ unless hResolution[:bearingDistanceResolution].empty?
89
+ hBearRes = hResolution[:bearingDistanceResolution]
90
+
91
+ # coordinate information 4.1.2.4.3 (distbrep) - bearing and distance representation
92
+ @xml.tag!('distbrep') do
93
+
94
+ # coordinate information 4.1.2.4.3.1 (distres) - distance resolution (required)
95
+ unless hBearRes[:distanceResolution].nil?
96
+ @xml.tag!('distres', hBearRes[:distanceResolution].to_f)
97
+ end
98
+ if hBearRes[:distanceResolution].nil?
99
+ @NameSpace.issueWarning(264, 'distres')
100
+ end
101
+
102
+ # coordinate information 4.1.2.4.3.2 (bearres) - bearing resolution (required)
103
+ unless hBearRes[:bearingResolution].nil?
104
+ @xml.tag!('bearres', hBearRes[:bearingResolution])
105
+ end
106
+ if hBearRes[:bearingResolution].nil?
107
+ @NameSpace.issueWarning(265, 'bearres')
108
+ end
109
+
110
+ # coordinate information 4.1.2.4.3.3 (bearunit) - bearing units of measure (required)
111
+ unless hBearRes[:bearingUnitOfMeasure].nil?
112
+ @xml.tag!('bearunit', hBearRes[:bearingUnitOfMeasure])
113
+ end
114
+ if hBearRes[:bearingUnitOfMeasure].nil?
115
+ @NameSpace.issueWarning(266, 'bearunit')
116
+ end
117
+
118
+ # coordinate information 4.1.2.4.3.4 (bearrefd) - bearing units of measure (required)
119
+ unless hBearRes[:bearingReferenceDirection].nil?
120
+ @xml.tag!('bearrefd', hBearRes[:bearingReferenceDirection])
121
+ end
122
+ if hBearRes[:bearingReferenceDirection].nil?
123
+ @NameSpace.issueWarning(267, 'bearrefd')
124
+ end
125
+
126
+ # coordinate information 4.1.2.4.3.5 (bearrefm) - bearing reference meridian (required)
127
+ unless hBearRes[:bearingReferenceMeridian].nil?
128
+ @xml.tag!('bearrefm', hBearRes[:bearingReferenceMeridian])
129
+ end
130
+ if hBearRes[:bearingReferenceMeridian].nil?
131
+ @NameSpace.issueWarning(268, 'bearrefm')
132
+ end
133
+
134
+ # coordinate information 4.1.2.4.4 (plandu) - distance unit of measure (required)
135
+ unless hBearRes[:distanceUnitOfMeasure].nil?
136
+ unitOfMeasure = hBearRes[:distanceUnitOfMeasure]
137
+ end
138
+ if hBearRes[:distanceUnitOfMeasure].nil?
139
+ @NameSpace.issueWarning(269, 'plandu')
140
+ end
141
+
142
+ end
143
+
144
+ end
145
+ end
146
+
147
+ # planar distance units 4.1.2.4.4 (plandu) - (required)
148
+ # value and error messages handled in above code
149
+ # just write it out here
150
+ unless unitOfMeasure.nil?
151
+ @xml.tag!('plandu', unitOfMeasure)
152
+ end
153
+
154
+ end
155
+ end
156
+
157
+ # error message
158
+ unless haveCInfo
159
+ @NameSpace.issueWarning(270, nil)
160
+ end
161
+
162
+ end # writeXML
163
+ end # CoordinateInformation
164
+
165
+ end
166
+ end
167
+ end
168
+ end
@@ -0,0 +1,42 @@
1
+ # FGDC <<Class>> PlanarReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2018-03-21 original script
6
+
7
+ require_relative 'class_mapProjectionTags'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Fgdc
13
+
14
+ class PlanarLocal
15
+
16
+ def initialize(xml, hResponseObj)
17
+ @xml = xml
18
+ @hResponseObj = hResponseObj
19
+ end
20
+
21
+ def writeXML(hProjection)
22
+
23
+ # classes used
24
+ classTags = MapProjectionTags.new(@xml, @hResponseObj)
25
+
26
+ # planar 4.1.2.3 (localp) - local planar
27
+ projection = hProjection[:projection]
28
+ if projection == 'localPlanar'
29
+ hProjection[:projectionName] = 'local right-handed planar coordinate system'
30
+ @xml.tag!('localp') do
31
+ classTags.write_localDesc(hProjection)
32
+ classTags.write_localGeoInfo(hProjection)
33
+ end
34
+ end
35
+
36
+ end # writeXML
37
+ end # PlanarReference
38
+
39
+ end
40
+ end
41
+ end
42
+ end