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,115 +2,118 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-12 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 2014-12-12 refactored to handle namespacing readers and writers
|
11
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
11
12
|
# Stan Smith 2013-11-19 original script.
|
12
13
|
|
14
|
+
require_relative '../iso19115_2_writer'
|
13
15
|
require_relative 'class_responsibleParty'
|
14
16
|
|
15
17
|
module ADIWG
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
module Mdtranslator
|
19
|
+
module Writers
|
20
|
+
module Iso19115_2
|
19
21
|
|
20
|
-
|
22
|
+
class MD_Usage
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
def initialize(xml, hResponseObj)
|
25
|
+
@xml = xml
|
26
|
+
@hResponseObj = hResponseObj
|
27
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
28
|
+
end
|
26
29
|
|
27
|
-
|
30
|
+
def writeXML(hUsage)
|
28
31
|
|
29
|
-
|
30
|
-
|
32
|
+
# classes used in MD_Usage
|
33
|
+
partyClass = CI_ResponsibleParty.new(@xml, @hResponseObj)
|
31
34
|
|
32
|
-
|
35
|
+
@xml.tag!('gmd:MD_Usage') do
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
# usage - specific usage (required)
|
38
|
+
s = hUsage[:specificUsage]
|
39
|
+
unless s.nil?
|
40
|
+
@xml.tag!('gmd:specificUsage') do
|
41
|
+
@xml.tag!('gco:CharacterString', s)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
if s.nil?
|
45
|
+
@NameSpace.issueWarning(320, 'gmd:specificUsage')
|
46
|
+
end
|
44
47
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
48
|
+
# usage - dateTime [0]
|
49
|
+
aTimes = hUsage[:temporalExtents]
|
50
|
+
dateStr = nil
|
51
|
+
unless aTimes.empty?
|
52
|
+
hTime = aTimes[0]
|
53
|
+
unless hTime.empty?
|
54
|
+
hInstant = hTime[:timeInstant]
|
55
|
+
hPeriod = hTime[:timePeriod]
|
56
|
+
unless hInstant.empty?
|
57
|
+
hDateTime = hInstant[:timeInstant]
|
58
|
+
timeInstant = hDateTime[:dateTime]
|
59
|
+
timeResolution = hDateTime[:dateResolution]
|
60
|
+
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(timeInstant, timeResolution)
|
61
|
+
hPeriod = {}
|
62
|
+
end
|
63
|
+
unless hPeriod.empty?
|
64
|
+
hStart = hPeriod[:startDateTime]
|
65
|
+
hEnd = hPeriod[:endDateTime]
|
66
|
+
if !hStart.empty?
|
67
|
+
dateTime = hStart[:dateTime]
|
68
|
+
timeResolution = hStart[:dateResolution]
|
69
|
+
else
|
70
|
+
dateTime = hEnd[:dateTime]
|
71
|
+
timeResolution = hEnd[:dateResolution]
|
72
|
+
end
|
73
|
+
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(dateTime, timeResolution)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
unless dateStr.nil?
|
78
|
+
@xml.tag!('gmd:usageDateTime') do
|
79
|
+
@xml.tag!('gco:DateTime', dateStr)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
if dateStr.nil? && @hResponseObj[:writerShowTags]
|
83
|
+
@xml.tag!('gmd:usageDateTime')
|
84
|
+
end
|
82
85
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
86
|
+
# usage - user determined limitations
|
87
|
+
s = hUsage[:userLimitation]
|
88
|
+
unless s.nil?
|
89
|
+
@xml.tag!('gmd:userDeterminedLimitations') do
|
90
|
+
@xml.tag!('gco:CharacterString', s)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
94
|
+
@xml.tag!('gmd:userDeterminedLimitations')
|
95
|
+
end
|
93
96
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
97
|
+
# usage - user contact info (required (optional -1)) [{CI_ResponsibleParty}]
|
98
|
+
aParties = hUsage[:userContacts]
|
99
|
+
aParties.each do |hRParty|
|
100
|
+
role = hRParty[:roleName]
|
101
|
+
aParties = hRParty[:parties]
|
102
|
+
aParties.each do |hParty|
|
103
|
+
@xml.tag!('gmd:userContactInfo') do
|
104
|
+
partyClass.writeXML(role, hParty, 'resource specific usage')
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
if aParties.empty?
|
109
|
+
@NameSpace.issueWarning(321, 'gmd:userContactInfo')
|
110
|
+
end
|
108
111
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
+
end # gmd:MD_Usage tag
|
113
|
+
end # writeXML
|
114
|
+
end # MD_Usage class
|
112
115
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
116
119
|
end
|
@@ -2,45 +2,45 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
5
|
+
# Stan Smith 2016-12-13 refactored for mdTranslator/mdJson 2.0
|
6
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
7
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
8
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
9
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
10
10
|
# Stan Smith 2013-10-31 original script
|
11
11
|
|
12
12
|
module ADIWG
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso19115_2
|
16
|
+
|
17
|
+
class MD_Constraints
|
18
|
+
|
19
|
+
def initialize(xml, hResponseObj)
|
20
|
+
@xml = xml
|
21
|
+
@hResponseObj = hResponseObj
|
22
|
+
end
|
23
|
+
|
24
|
+
def writeXML(hConstraint)
|
25
|
+
|
26
|
+
@xml.tag!('gmd:MD_Constraints') do
|
27
|
+
|
28
|
+
# use constraints - use limitation []
|
29
|
+
aCons = hConstraint[:useLimitation]
|
30
|
+
aCons.each do |useCon|
|
31
|
+
@xml.tag!('gmd:useLimitation') do
|
32
|
+
@xml.tag!('gco:CharacterString', useCon)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
if aCons.empty?
|
36
|
+
@xml.tag!('gmd:useLimitation')
|
37
|
+
end
|
38
|
+
|
39
|
+
end # gmd:MD_Constraints tag
|
40
|
+
end # writeXML
|
41
|
+
end # MD_Constraints class
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
46
|
end
|
@@ -8,52 +8,52 @@ require_relative 'class_codelist'
|
|
8
8
|
require_relative 'class_geometricObjects'
|
9
9
|
|
10
10
|
module ADIWG
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso19115_2
|
14
|
+
|
15
|
+
class MD_VectorSpatialRepresentation
|
16
|
+
|
17
|
+
def initialize(xml, hResponseObj)
|
18
|
+
@xml = xml
|
19
|
+
@hResponseObj = hResponseObj
|
20
|
+
end
|
21
|
+
|
22
|
+
def writeXML(hVector)
|
23
|
+
|
24
|
+
# classes used
|
25
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
26
|
+
geoObjClass = MD_GeometricObjects.new(@xml, @hResponseObj)
|
27
|
+
|
28
|
+
@xml.tag!('gmd:MD_VectorSpatialRepresentation') do
|
29
|
+
|
30
|
+
# vector representation - topology level
|
31
|
+
s = hVector[:topologyLevel]
|
32
|
+
unless s.nil?
|
33
|
+
@xml.tag!('gmd:topologyLevel') do
|
34
|
+
codelistClass.writeXML('gmd', 'iso_topologyLevel', s)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
38
|
+
@xml.tag!('gmd:topologyLevel')
|
39
|
+
end
|
40
|
+
|
41
|
+
# vector representation - geometric objects [{MD_GeometricObjects}]
|
42
|
+
aGeoObjs = hVector[:vectorObject]
|
43
|
+
aGeoObjs.each do |hGeoObj|
|
44
|
+
@xml.tag!('gmd:geometricObjects') do
|
45
|
+
geoObjClass.writeXML(hGeoObj)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
if aGeoObjs.empty? && @hResponseObj[:writerShowTags]
|
49
|
+
@xml.tag!('gmd:geometricObjects')
|
50
|
+
end
|
51
|
+
|
52
|
+
end # gmd:MD_VectorSpatialRepresentation tag
|
53
|
+
end # writeXML
|
54
|
+
end # MD_VectorSpatialRepresentation class
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
59
|
end
|
@@ -2,86 +2,90 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-01 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 2014-12-12 refactored to handle namespacing readers and writers
|
10
11
|
# Stan Smith 2013-11-15 original script
|
11
12
|
|
13
|
+
require_relative '../iso19115_2_writer'
|
14
|
+
|
12
15
|
module ADIWG
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
module Mdtranslator
|
17
|
+
module Writers
|
18
|
+
module Iso19115_2
|
16
19
|
|
17
|
-
|
20
|
+
class EX_VerticalExtent
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
def initialize(xml, hResponseObj)
|
23
|
+
@xml = xml
|
24
|
+
@hResponseObj = hResponseObj
|
25
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
26
|
+
end
|
23
27
|
|
24
|
-
|
28
|
+
def writeXML(hVertEle)
|
25
29
|
|
26
|
-
|
30
|
+
@xml.tag!('gmd:EX_VerticalExtent') do
|
27
31
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
# vertical extent - minimum value (required)
|
33
|
+
s = hVertEle[:minValue]
|
34
|
+
if s.nil?
|
35
|
+
@NameSpace.issueWarning(330, 'gmd:minimumValue')
|
36
|
+
else
|
37
|
+
@xml.tag!('gmd:minimumValue') do
|
38
|
+
@xml.tag!('gco:Real', s)
|
39
|
+
end
|
40
|
+
end
|
37
41
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
# vertical extent - maximum value (required)
|
43
|
+
s = hVertEle[:maxValue]
|
44
|
+
if s.nil?
|
45
|
+
@NameSpace.issueWarning(331, 'gmd:maximumValue')
|
46
|
+
else
|
47
|
+
@xml.tag!('gmd:maximumValue') do
|
48
|
+
@xml.tag!('gco:Real', s)
|
49
|
+
end
|
50
|
+
end
|
47
51
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
52
|
+
# vertical extent - vertical crs (attributes only) (required)
|
53
|
+
attributes = {}
|
54
|
+
title = nil
|
55
|
+
href = nil
|
56
|
+
hSpaceRef = hVertEle[:crsId]
|
57
|
+
unless hSpaceRef.empty?
|
58
|
+
hIdentifier = hSpaceRef[:systemIdentifier]
|
59
|
+
unless hIdentifier.empty?
|
60
|
+
title = hIdentifier[:identifier]
|
61
|
+
href = hIdentifier[:namespace]
|
62
|
+
hCitation = hIdentifier[:citation]
|
63
|
+
unless hCitation.empty?
|
64
|
+
hOnline = hCitation[:onlineResources][0]
|
65
|
+
unless hOnline.empty?
|
66
|
+
href = hOnline[:olResURI]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
unless href.nil?
|
72
|
+
attributes['xlink:href'] = href
|
73
|
+
end
|
74
|
+
unless title.nil?
|
75
|
+
attributes['xlink:title'] = title
|
76
|
+
end
|
77
|
+
unless attributes.empty?
|
78
|
+
@xml.tag!('gmd:verticalCRS', attributes)
|
79
|
+
end
|
80
|
+
if attributes.empty?
|
81
|
+
@NameSpace.issueWarning(332, 'gmd:verticalCRS')
|
82
|
+
end
|
79
83
|
|
80
|
-
|
81
|
-
|
82
|
-
|
84
|
+
end # EX_VerticalExtent tag
|
85
|
+
end # writeXML
|
86
|
+
end # EX_VerticalExtent class
|
83
87
|
|
84
|
-
|
85
|
-
|
86
|
-
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
87
91
|
end
|