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,6 +2,7 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-04-06 changed taxonomy to an array
5
6
  # Stan Smith 2018-01-05 deprecated topicCategory[]
6
7
  # Stan Smith 2018-01-05 get topics from keywords where type='isoTopicCategory'
7
8
  # Stan Smith 2016-12-13 refactored for mdTranslator/mdJson 2.0
@@ -252,16 +253,22 @@ module ADIWG
252
253
  @xml.tag!('gmd:aggregationInfo')
253
254
  end
254
255
 
255
- # data identification - taxonomy
256
- hTaxonomy = hData[:taxonomy]
257
- unless hTaxonomy.empty?
258
- @xml.tag!('gmd:taxonomy') do
259
- taxClass.writeXML(hTaxonomy)
256
+ # data identification - taxonomy (first)
257
+ unless hData[:taxonomy].empty?
258
+ hTaxonomy = hData[:taxonomy][0]
259
+ unless hTaxonomy.empty?
260
+ @xml.tag!('gmd:taxonomy') do
261
+ taxClass.writeXML(hTaxonomy)
262
+ end
260
263
  end
261
264
  end
262
- if hTaxonomy.empty? && @hResponseObj[:writerShowTags]
265
+ if hData[:taxonomy].empty? && @hResponseObj[:writerShowTags]
263
266
  @xml.tag!('gmd:taxonomy')
264
267
  end
268
+ if hData[:taxonomy].length > 1
269
+ # - {id: 186, message: "multiple taxonomic structures were specified, CSDGM allows for only one"}
270
+ # - {id: 187, message: "the first taxonomic structure was written to the metadata record"}
271
+ end
265
272
 
266
273
  # data identification - spatial representation type []
267
274
  aSpatialType = hData[:spatialRepresentationTypes]
@@ -100,7 +100,7 @@ module ADIWG
100
100
  s = hExtension[:dataType]
101
101
  unless s.nil?
102
102
  @xml.tag!('gmd:dataType') do
103
- codelistClass.writeXML('gmd', 'iso_dataType',s)
103
+ codelistClass.writeXML('gmd', 'iso_entityType',s)
104
104
  end
105
105
  end
106
106
  if s.nil?
@@ -1,10 +1,12 @@
1
1
  # mdJson 2.0 writer - allocation
2
2
 
3
3
  # History:
4
+ # Stan Smith 2018-03-31 added responsibleParties []
4
5
  # Stan Smith 2017-08-31 refactored for mdJson schema 2.3
5
6
  # Stan Smith 2017-03-20 original script
6
7
 
7
8
  require 'jbuilder'
9
+ require_relative 'mdJson_responsibleParty'
8
10
  require_relative 'mdJson_onlineResource'
9
11
 
10
12
  module ADIWG
@@ -24,6 +26,7 @@ module ADIWG
24
26
  json.currency hAllocation[:currency]
25
27
  json.sourceId hAllocation[:sourceId]
26
28
  json.recipientId hAllocation[:recipientId]
29
+ json.responsibleParty @Namespace.json_map(hAllocation[:responsibleParties], ResponsibleParty)
27
30
  json.matching hAllocation[:matching]
28
31
  json.onlineResource @Namespace.json_map(hAllocation[:onlineResources], OnlineResource)
29
32
  json.comment hAllocation[:comment]
@@ -1,9 +1,10 @@
1
1
  # mdJson 2.0 writer - resource information
2
2
 
3
3
  # History:
4
- # Stan Smith 2017-05-16 deprecated topicCategory
5
- # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
6
- # Josh Bradley original script
4
+ # Stan Smith 2018-04-06 changed taxonomy to an array
5
+ # Stan Smith 2017-05-16 deprecated topicCategory
6
+ # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
7
+ # Josh Bradley original script
7
8
 
8
9
  require 'jbuilder'
9
10
  require_relative 'mdJson_resourceType'
@@ -52,7 +53,7 @@ module ADIWG
52
53
  json.temporalResolution @Namespace.json_map(hResInfo[:temporalResolutions], Duration)
53
54
  json.extent @Namespace.json_map(hResInfo[:extents], Extent)
54
55
  json.coverageDescription @Namespace.json_map(hResInfo[:coverageDescriptions], CoverageDescription)
55
- json.taxonomy Taxonomy.build(hResInfo[:taxonomy]) unless hResInfo[:taxonomy].empty?
56
+ json.taxonomy @Namespace.json_map(hResInfo[:taxonomy], Taxonomy)
56
57
  json.graphicOverview @Namespace.json_map(hResInfo[:graphicOverviews], GraphicOverview)
57
58
  json.resourceFormat @Namespace.json_map(hResInfo[:resourceFormats], Format)
58
59
  json.keyword @Namespace.json_map(hResInfo[:keywords], Keyword)
@@ -1,8 +1,10 @@
1
1
  # mdJson 2.0 writer - taxonomic classification
2
2
 
3
3
  # History:
4
- # Stan Smith 2017-03-17 refactored for mdJson/mdTranslator 2.0
5
- # Josh Bradley original script
4
+ # Stan Smith 2018-04-06 renamed taxonomicRank to taxonomicLevel
5
+ # Stan Smith 2018-04-06 renamed latinName to taxonomicName
6
+ # Stan Smith 2017-03-17 refactored for mdJson/mdTranslator 2.0
7
+ # Josh Bradley original script
6
8
 
7
9
  require 'jbuilder'
8
10
  require_relative 'mdJson_taxonomicClassification'
@@ -20,8 +22,8 @@ module ADIWG
20
22
 
21
23
  Jbuilder.new do |json|
22
24
  json.taxonomicSystemId hTaxon[:taxonId]
23
- json.taxonomicRank hTaxon[:taxonRank]
24
- json.latinName hTaxon[:taxonValue]
25
+ json.taxonomicLevel hTaxon[:taxonRank]
26
+ json.taxonomicName hTaxon[:taxonValue]
25
27
  json.commonName hTaxon[:commonNames] unless hTaxon[:commonNames].empty?
26
28
  json.subClassification @Namespace.json_map(hTaxon[:subClasses], TaxonomicClassification)
27
29
  end
@@ -2,6 +2,7 @@
2
2
  # ADIwg mdTranslator - Thor CLI for mdtranslator
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-04-07 add 'fgdc' option to reader and writer enum list
5
6
  # Stan Smith 2018-02-26 add 'forceValid' parameter
6
7
  # Stan Smith 2017-04-21 removed inline CSS option
7
8
  # Stan Smith 2015-07-17 added method_options to provide custom CSS
@@ -32,14 +33,23 @@ force output metadata to meet standard, add personalized CSS to headers to HTML
32
33
  and to choose the level of validation for mdJson input files.
33
34
  LONGDESC
34
35
  # define cli options
35
- method_option :reader, :aliases => '-r', :desc => 'Reader to read your input metadata file', :enum => %w{mdJson sbJson}, :required => true
36
- method_option :writer, :aliases => '-w', :desc => 'Writer to create your output metadata file, leave blank to validate input only', :enum => %w{iso19115_2 iso19110 html mdJson sbJson}
37
- method_option :validate, :aliases => '-v', :desc => 'Specify level of validation to be performed', :enum => %w{none normal strict}, :default => 'normal'
38
- method_option :forceValid, :aliases => '-f', :desc => 'Insert tags for required elements missing from input', :type => :boolean, :default => true
39
- method_option :showAllTags, :aliases => '-s', :desc => 'Include tags for unused attributes', :type => :boolean, :default => false
40
- method_option :messages, :aliases => '-m', :desc => 'On error return messages as formatted text or json object', :enum => %w{json text}, :default => 'text'
41
- method_option :returnObject, :aliases => '-o', :desc => 'Return full JSON object generated by translator', :type => :boolean, :default => false
42
- method_option :cssLink, :desc => 'Fully qualified link to a CSS file to customize HTML writer output', :type => :string
36
+ method_option :reader, :aliases => '-r', :desc => 'Reader to read your input metadata file',
37
+ :enum => %w{mdJson sbJson fgdc}, :required => true
38
+ method_option :writer, :aliases => '-w',
39
+ :desc => 'Writer to create your output metadata file, leave blank to validate input only',
40
+ :enum => %w{iso19115_2 iso19110 html mdJson sbJson fgdc}
41
+ method_option :validate, :aliases => '-v', :desc => 'Specify level of validation to be performed',
42
+ :enum => %w{none normal strict}, :default => 'normal'
43
+ method_option :forceValid, :aliases => '-f', :desc => 'Insert tags for required elements missing from input',
44
+ :type => :boolean, :default => true
45
+ method_option :showAllTags, :aliases => '-s', :desc => 'Include tags for unused attributes',
46
+ :type => :boolean, :default => false
47
+ method_option :messages, :aliases => '-m', :desc => 'On error return messages as formatted text or json object',
48
+ :enum => %w{json text}, :default => 'text'
49
+ method_option :returnObject, :aliases => '-o', :desc => 'Return full JSON object generated by translator',
50
+ :type => :boolean, :default => false
51
+ method_option :cssLink, :desc => 'Fully qualified link to a CSS file to customize HTML writer output',
52
+ :type => :string
43
53
 
44
54
  # accept command and options
45
55
  def translate(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.12.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-13 00:00:00.000000000 Z
12
+ date: 2018-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -143,14 +143,14 @@ dependencies:
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 2.4.0
146
+ version: 2.6.2
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: 2.4.0
153
+ version: 2.6.2
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: jbuilder
156
156
  requirement: !ruby/object:Gem::Requirement
@@ -329,6 +329,7 @@ files:
329
329
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb
330
330
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb
331
331
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb
332
+ - lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb
332
333
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb
333
334
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb
334
335
  - lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb
@@ -466,8 +467,7 @@ files:
466
467
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb
467
468
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb
468
469
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb
469
- - lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb
470
- - lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjection.rb
470
+ - lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjectionTags.rb
471
471
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb
472
472
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb
473
473
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb
@@ -475,6 +475,10 @@ files:
475
475
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb
476
476
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb
477
477
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb
478
+ - lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb
479
+ - lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb
480
+ - lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb
481
+ - lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb
478
482
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb
479
483
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb
480
484
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb
@@ -494,6 +498,7 @@ files:
494
498
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb
495
499
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb
496
500
  - lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb
501
+ - lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml
497
502
  - lib/adiwg/mdtranslator/writers/fgdc/readme.md
498
503
  - lib/adiwg/mdtranslator/writers/fgdc/version.rb
499
504
  - lib/adiwg/mdtranslator/writers/html/html_writer.rb
@@ -615,6 +620,7 @@ files:
615
620
  - lib/adiwg/mdtranslator/writers/iso19110/classes/class_series.rb
616
621
  - lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb
617
622
  - lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb
623
+ - lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml
618
624
  - lib/adiwg/mdtranslator/writers/iso19110/readme.md
619
625
  - lib/adiwg/mdtranslator/writers/iso19110/version.rb
620
626
  - lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb
@@ -842,9 +848,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
842
848
  version: '2.2'
843
849
  required_rubygems_version: !ruby/object:Gem::Requirement
844
850
  requirements:
845
- - - ">="
851
+ - - ">"
846
852
  - !ruby/object:Gem::Version
847
- version: '0'
853
+ version: 1.3.1
848
854
  requirements: []
849
855
  rubyforge_project:
850
856
  rubygems_version: 2.6.8
@@ -1,167 +0,0 @@
1
- # FGDC <<Class>> SpatialReference
2
- # FGDC CSDGM writer output in XML
3
-
4
- # History:
5
- # Stan Smith 2018-01-12 original script
6
-
7
- module ADIWG
8
- module Mdtranslator
9
- module Writers
10
- module Fgdc
11
-
12
- class CoordinateInformation
13
-
14
- def initialize(xml, hResponseObj)
15
- @xml = xml
16
- @hResponseObj = hResponseObj
17
- end
18
-
19
- def writeXML(aRepTypes, aResolutions)
20
-
21
- haveCInfo = false
22
- haveCInfo = true unless aRepTypes.empty?
23
- aResolutions.each do |hResolution|
24
- haveCInfo = true if hResolution[:coordinateResolution]
25
- haveCInfo = true if hResolution[:bearingDistanceResolution]
26
- end
27
- unitOfMeasure = nil
28
-
29
- # coordinate information 4.1.2.4 (planci) - planar coordinate information
30
- if haveCInfo
31
- @xml.tag!('planar') do
32
- @xml.tag!('planci') do
33
-
34
- # coordinate information 4.1.2.4.1 (plance) - planar coordinate encoding method (required)
35
- # <- spatialRepresentationTypes[].first
36
- unless aRepTypes.empty?
37
- @xml.tag!('plance', aRepTypes[0])
38
- end
39
- if aRepTypes.empty?
40
- @hResponseObj[:writerPass] = false
41
- @hResponseObj[:writerMessages] << 'Planar Coordinate Information is missing encoding method'
42
- end
43
-
44
- # <- spatialResolutions[] look for coordinateResolution and bearingDistanceResolution
45
- # take first encountered, only one is permitted from file
46
- aResolutions.each do |hResolution|
47
- unless hResolution[:coordinateResolution].empty?
48
- hCoordRes = hResolution[:coordinateResolution]
49
-
50
- # coordinate information 4.1.2.4.2 (coordrep) - coordinate representation
51
- @xml.tag!('coordrep') do
52
-
53
- # coordinate information 4.1.2.4.2.1 (absres) - abscissa resolution (required)
54
- unless hCoordRes[:abscissaResolutionX].nil?
55
- @xml.tag!('absres', hCoordRes[:abscissaResolutionX].to_f)
56
- end
57
- if hCoordRes[:abscissaResolutionX].nil?
58
- @hResponseObj[:writerPass] = false
59
- @hResponseObj[:writerMessages] << 'Coordinate Representation is missing abscissa resolution'
60
- end
61
-
62
- # coordinate information 4.1.2.4.2.2 (ordres) - ordinate resolution (required)
63
- unless hCoordRes[:ordinateResolutionY].nil?
64
- @xml.tag!('ordres', hCoordRes[:ordinateResolutionY].to_f)
65
- end
66
- if hCoordRes[:ordinateResolutionY].nil?
67
- @hResponseObj[:writerPass] = false
68
- @hResponseObj[:writerMessages] << 'Coordinate Representation is missing ordinate resolution'
69
- end
70
-
71
- # coordinate information 4.1.2.4.4 (plandu) - distance unit of measure (required)
72
- unless hCoordRes[:unitOfMeasure].nil?
73
- unitOfMeasure = hCoordRes[:unitOfMeasure]
74
- end
75
- if hCoordRes[:unitOfMeasure].nil?
76
- @hResponseObj[:writerPass] = false
77
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing planar distance units'
78
- end
79
-
80
- end
81
- break
82
- end
83
-
84
- unless hResolution[:bearingDistanceResolution].empty?
85
- hBearRes = hResolution[:bearingDistanceResolution]
86
-
87
- # coordinate information 4.1.2.4.3 (distbrep) - bearing and distance representation
88
- @xml.tag!('distbrep') do
89
-
90
- # coordinate information 4.1.2.4.3.1 (distres) - distance resolution (required)
91
- unless hBearRes[:distanceResolution].nil?
92
- @xml.tag!('distres', hBearRes[:distanceResolution].to_f)
93
- end
94
- if hBearRes[:distanceResolution].nil?
95
- @hResponseObj[:writerPass] = false
96
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing distance resolution'
97
- end
98
-
99
- # coordinate information 4.1.2.4.3.2 (bearres) - bearing resolution (required)
100
- unless hBearRes[:bearingResolution].nil?
101
- @xml.tag!('bearres', hBearRes[:bearingResolution])
102
- end
103
- if hBearRes[:bearingResolution].nil?
104
- @hResponseObj[:writerPass] = false
105
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing bearing resolution'
106
- end
107
-
108
- # coordinate information 4.1.2.4.3.3 (bearunit) - bearing units of measure (required)
109
- unless hBearRes[:bearingUnitOfMeasure].nil?
110
- @xml.tag!('bearunit', hBearRes[:bearingUnitOfMeasure])
111
- end
112
- if hBearRes[:bearingUnitOfMeasure].nil?
113
- @hResponseObj[:writerPass] = false
114
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing bearing units'
115
- end
116
-
117
- # coordinate information 4.1.2.4.3.4 (bearrefd) - bearing units of measure (required)
118
- unless hBearRes[:bearingReferenceDirection].nil?
119
- @xml.tag!('bearrefd', hBearRes[:bearingReferenceDirection])
120
- end
121
- if hBearRes[:bearingReferenceDirection].nil?
122
- @hResponseObj[:writerPass] = false
123
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing bearing reference direction'
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
- @hResponseObj[:writerPass] = false
132
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing bearing reference meridian'
133
- end
134
-
135
- # coordinate information 4.1.2.4.4 (plandu) - distance unit of measure (required)
136
- unless hBearRes[:distanceUnitOfMeasure].nil?
137
- unitOfMeasure = hBearRes[:distanceUnitOfMeasure]
138
- end
139
- if hBearRes[:distanceUnitOfMeasure].nil?
140
- @hResponseObj[:writerPass] = false
141
- @hResponseObj[:writerMessages] << 'Bearing-Distance Representation is missing planar distance units'
142
- end
143
-
144
- end
145
- break
146
-
147
- end
148
- end
149
-
150
- # planar distance units 4.1.2.4.4 (plandu) - (required)
151
- # value and error messages handled in above code
152
- # just write it out here
153
- unless unitOfMeasure.nil?
154
- @xml.tag!('plandu', unitOfMeasure)
155
- end
156
-
157
- end
158
- end
159
- end
160
-
161
- end # writeXML
162
- end # CoordinateInformation
163
-
164
- end
165
- end
166
- end
167
- end