adiwg-mdtranslator 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
- data/lib/adiwg/mdtranslator_cli.rb +21 -4
- metadata +6 -5
@@ -2,62 +2,67 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-13 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
10
|
+
# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
|
11
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
13
|
+
# Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
|
13
14
|
# Stan Smith 2013-11-20 original script
|
14
15
|
|
16
|
+
require_relative '../iso19115_2_writer'
|
15
17
|
require_relative 'class_scope'
|
16
18
|
require_relative 'class_lineage'
|
17
19
|
|
18
20
|
module ADIWG
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
21
|
+
module Mdtranslator
|
22
|
+
module Writers
|
23
|
+
module Iso19115_2
|
24
|
+
|
25
|
+
class DQ_DataQuality
|
26
|
+
|
27
|
+
def initialize(xml, responseObj)
|
28
|
+
@xml = xml
|
29
|
+
@hResponseObj = responseObj
|
30
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
31
|
+
end
|
32
|
+
|
33
|
+
def writeXML(hLineage)
|
34
|
+
|
35
|
+
# classes used
|
36
|
+
scopeClass = DQ_Scope.new(@xml, @hResponseObj)
|
37
|
+
lineClass = LI_Lineage.new(@xml, @hResponseObj)
|
38
|
+
|
39
|
+
outContext = 'data quality'
|
40
|
+
|
41
|
+
@xml.tag!('gmd:DQ_DataQuality') do
|
42
|
+
|
43
|
+
# data quality - scope {DQ_Scope} (required)
|
44
|
+
hScope = hLineage[:resourceScope]
|
45
|
+
unless hScope.empty?
|
46
|
+
@xml.tag!('gmd:scope') do
|
47
|
+
scopeClass.writeXML(hScope, outContext)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if hScope.empty?
|
51
|
+
@NameSpace.issueWarning(60, 'gmd:scope')
|
52
|
+
end
|
53
|
+
|
54
|
+
# date quality - report (moved to ISO 19157)
|
55
|
+
|
56
|
+
# data quality - lineage
|
57
|
+
@xml.tag!('gmd:lineage') do
|
58
|
+
lineClass.writeXML(hLineage)
|
59
|
+
end
|
60
|
+
|
61
|
+
end # gmd:DQ_DataQuality tag
|
62
|
+
end # writeXML
|
63
|
+
end # DQ_DataQuality class
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
63
68
|
end
|
@@ -2,67 +2,70 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
6
|
+
# Stan Smith 2016-11-29 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
10
|
+
# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
|
11
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
13
|
# Stan Smith 2013-11-21 support for date or datetime
|
13
14
|
# Stan Smith 2013-08-26 original script
|
14
15
|
|
16
|
+
require_relative '../iso19115_2_writer'
|
15
17
|
require_relative 'class_codelist'
|
16
18
|
require_relative 'class_gcoDateTime'
|
17
19
|
|
18
20
|
module ADIWG
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
module Mdtranslator
|
22
|
+
module Writers
|
23
|
+
module Iso19115_2
|
22
24
|
|
23
|
-
|
25
|
+
class CI_Date
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
def initialize(xml, hResponseObj)
|
28
|
+
@xml = xml
|
29
|
+
@hResponseObj = hResponseObj
|
30
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
31
|
+
end
|
29
32
|
|
30
|
-
|
33
|
+
def writeXML(hDate, inContext = nil)
|
31
34
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
# classes used
|
36
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
37
|
+
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
|
35
38
|
|
36
|
-
|
37
|
-
|
39
|
+
date = hDate[:date]
|
40
|
+
dateType = hDate[:dateType]
|
38
41
|
|
39
|
-
|
42
|
+
@xml.tag!('gmd:CI_Date') do
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
# date - date (required)
|
45
|
+
unless date.nil?
|
46
|
+
@xml.tag!('gmd:date') do
|
47
|
+
gcoDateTimeClass.writeXML(hDate)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if date.nil?
|
51
|
+
@NameSpace.issueError(70)
|
52
|
+
end
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
# date - date type (required)
|
55
|
+
unless dateType.nil?
|
56
|
+
@xml.tag!('gmd:dateType') do
|
57
|
+
codelistClass.writeXML('gmd', 'iso_dateType', dateType)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if dateType.nil?
|
61
|
+
@NameSpace.issueWarning(71, 'gmd:dateType', inContext)
|
62
|
+
end
|
60
63
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
end # CI_Date tag
|
65
|
+
end # write XML
|
66
|
+
end # CI_Date class
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
68
71
|
end
|
@@ -5,31 +5,31 @@
|
|
5
5
|
# Stan Smith 2015-08-27 copied from 19110 writer
|
6
6
|
|
7
7
|
module ADIWG
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_2
|
11
11
|
|
12
|
-
|
12
|
+
class UnitDefinition
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
18
|
|
19
|
-
|
19
|
+
def writeXML(unit)
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
# create an identity for the unit
|
22
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
23
|
+
unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
|
24
|
+
@xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do
|
25
|
+
@xml.tag!('gml:identifier', {'codeSpace' => ''}, unit)
|
26
|
+
end
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
end
|
28
|
+
end
|
31
29
|
|
32
30
|
end
|
33
|
-
|
34
|
-
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
35
|
end
|
@@ -5,38 +5,38 @@
|
|
5
5
|
# Stan Smith 2015-08-27 copied from 19110 writer
|
6
6
|
|
7
7
|
module ADIWG
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_2
|
11
|
+
|
12
|
+
class DerivedUnit
|
13
|
+
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hDerived)
|
20
|
+
|
21
|
+
# create and identity for the unit
|
22
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
23
|
+
unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
|
24
|
+
@xml.tag!('gml:DerivedUnit', {'gml:id' => unitID}) do
|
25
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hDerived[:codeSpace]}, hDerived[:identifier])
|
26
|
+
@xml.tag!('gml:name', hDerived[:name])
|
27
|
+
@xml.tag!('gml:remarks', hDerived[:remarks])
|
28
|
+
@xml.tag!('gml:catalogSymbol', hDerived[:catalogSymbol])
|
29
|
+
aTerms = hDerived[:derivationUnitTerm]
|
30
|
+
aTerms.each do |term|
|
31
|
+
@xml.tag!('gml:derivationUnitTerm', term)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
38
36
|
|
39
37
|
end
|
40
|
-
|
41
|
-
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
42
|
end
|
@@ -2,70 +2,76 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
6
|
+
# Stan Smith 2016-11-23 refactored for mdTranslator/mdJson 2.0
|
6
7
|
# Stan Smith 2015-07-30 original script.
|
7
8
|
|
9
|
+
require_relative '../iso19115_2_writer'
|
8
10
|
require_relative 'class_codelist'
|
9
11
|
require_relative 'class_measure'
|
10
12
|
|
11
13
|
module ADIWG
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso19115_2
|
15
17
|
|
16
|
-
|
18
|
+
class MD_Dimension
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
def initialize(xml, hResponseObj)
|
21
|
+
@xml = xml
|
22
|
+
@hResponseObj = hResponseObj
|
23
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
24
|
+
end
|
22
25
|
|
23
|
-
|
26
|
+
def writeXML(hDim, inContext = nil)
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
# classes used
|
29
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
30
|
+
measureClass = Measure.new(@xml, @hResponseObj)
|
28
31
|
|
29
|
-
|
32
|
+
outContext = 'dimension'
|
33
|
+
outContext = inContext + ' dimension' unless inContext.nil?
|
30
34
|
|
31
|
-
|
32
|
-
s = hDim[:dimensionType]
|
33
|
-
unless s.nil?
|
34
|
-
@xml.tag!('gmd:dimensionName') do
|
35
|
-
codelistClass.writeXML('gmd', 'iso_dimensionNameType',s)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
if s.nil?
|
39
|
-
@xml.tag!('gmd:dimensionName', {'gco:nilReason'=>'missing'})
|
40
|
-
end
|
35
|
+
@xml.tag!('gmd:MD_Dimension') do
|
41
36
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
37
|
+
# dimension information - dimension type code (required)
|
38
|
+
s = hDim[:dimensionType]
|
39
|
+
unless s.nil?
|
40
|
+
@xml.tag!('gmd:dimensionName') do
|
41
|
+
codelistClass.writeXML('gmd', 'iso_dimensionNameType', s)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
if s.nil?
|
45
|
+
@NameSpace.issueWarning(80, 'gmd:dimensionName', inContext)
|
46
|
+
end
|
52
47
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
48
|
+
# dimension information - dimension size (required)
|
49
|
+
s = hDim[:dimensionSize]
|
50
|
+
unless s.nil?
|
51
|
+
@xml.tag!('gmd:dimensionSize') do
|
52
|
+
@xml.tag!('gco:Integer', s)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
if s.nil?
|
56
|
+
@NameSpace.issueWarning(81, 'gmd:dimensionSize', inContext)
|
57
|
+
end
|
63
58
|
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
# dimension information - dimension resolution
|
60
|
+
hMeasure = hDim[:resolution]
|
61
|
+
unless hMeasure.empty?
|
62
|
+
@xml.tag!('gmd:resolution') do
|
63
|
+
measureClass.writeXML(hMeasure, outContext)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
if hMeasure.empty? && @hResponseObj[:writerShowTags]
|
67
|
+
@xml.tag!('gmd:resolution')
|
68
|
+
end
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
end # MD_Dimension tag
|
71
|
+
end # writeXML
|
72
|
+
end # Md_Dimension class
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
71
77
|
end
|