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,87 +2,91 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-07 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-09-15 added compression method element
|
8
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
9
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
10
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
11
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
11
12
|
# Stan Smith 2013-08-26 original script
|
12
13
|
|
14
|
+
require_relative '../iso19115_2_writer'
|
15
|
+
|
13
16
|
module ADIWG
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
module Mdtranslator
|
18
|
+
module Writers
|
19
|
+
module Iso19115_2
|
17
20
|
|
18
|
-
|
21
|
+
class MD_Format
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
def initialize(xml, hResponseObj)
|
24
|
+
@xml = xml
|
25
|
+
@hResponseObj = hResponseObj
|
26
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
27
|
+
end
|
24
28
|
|
25
|
-
|
29
|
+
def writeXML(hFormat, inContext = nil)
|
26
30
|
|
27
|
-
|
31
|
+
@xml.tag!('gmd:MD_Format') do
|
28
32
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
# get required 19115-2 elements from citation
|
34
|
+
citation = hFormat[:formatSpecification]
|
35
|
+
if citation.empty?
|
36
|
+
name = nil
|
37
|
+
version = nil
|
38
|
+
else
|
39
|
+
name = citation[:title]
|
40
|
+
version = citation[:edition]
|
41
|
+
end
|
38
42
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
# format - name (required)
|
44
|
+
unless name.nil?
|
45
|
+
@xml.tag!('gmd:name') do
|
46
|
+
@xml.tag!('gco:CharacterString', name)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
if name.nil?
|
50
|
+
@NameSpace.issueWarning(120, 'gmd:name', inContext)
|
51
|
+
end
|
48
52
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
# format - version (required)
|
54
|
+
unless version.nil?
|
55
|
+
@xml.tag!('gmd:version') do
|
56
|
+
@xml.tag!('gco:CharacterString', version)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
if version.nil?
|
60
|
+
@NameSpace.issueWarning(121, 'gmd:version', inContext)
|
61
|
+
end
|
58
62
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
# format - amendment number
|
64
|
+
s = hFormat[:amendmentNumber]
|
65
|
+
unless s.nil?
|
66
|
+
@xml.tag!('gmd:amendmentNumber') do
|
67
|
+
@xml.tag!('gco:CharacterString', s)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
71
|
+
@xml.tag!('gmd:amendmentNumber')
|
72
|
+
end
|
69
73
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
74
|
+
# format - compression method
|
75
|
+
s = hFormat[:compressionMethod]
|
76
|
+
unless s.nil?
|
77
|
+
@xml.tag!('gmd:fileDecompressionTechnique') do
|
78
|
+
@xml.tag!('gco:CharacterString', s)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
82
|
+
@xml.tag!('gmd:fileDecompressionTechnique')
|
83
|
+
end
|
80
84
|
|
81
|
-
|
82
|
-
|
83
|
-
|
85
|
+
end # MD_Format tag
|
86
|
+
end # writeXML
|
87
|
+
end # MD_Format class
|
84
88
|
|
85
|
-
|
86
|
-
|
87
|
-
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
88
92
|
end
|
@@ -2,39 +2,43 @@
|
|
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-12-13 original script
|
7
|
+
|
8
|
+
require_relative '../iso19115_2_writer'
|
6
9
|
|
7
10
|
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
|
-
|
38
|
-
|
39
|
-
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso19115_2
|
14
|
+
|
15
|
+
class MD_RepresentativeFraction
|
16
|
+
|
17
|
+
def initialize(xml, hResponseObj)
|
18
|
+
@xml = xml
|
19
|
+
@hResponseObj = hResponseObj
|
20
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
21
|
+
end
|
22
|
+
|
23
|
+
def writeXML(denominator)
|
24
|
+
|
25
|
+
@xml.tag!('gmd:MD_RepresentativeFraction') do
|
26
|
+
|
27
|
+
# representative fraction - denominator
|
28
|
+
unless denominator.nil?
|
29
|
+
@xml.tag!('gmd:denominator') do
|
30
|
+
@xml.tag!('gco:Integer', denominator)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
if denominator.nil?
|
34
|
+
@NameSpace.issueWarning(120, 'gmd:denominator')
|
35
|
+
end
|
36
|
+
|
37
|
+
end # gmd:MD_RepresentativeFraction tag
|
38
|
+
end # writeXML
|
39
|
+
end # MD_RepresentativeFraction class
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
40
44
|
end
|
@@ -2,15 +2,17 @@
|
|
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-12-05 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
|
12
|
+
# Stan Smith 2014-05-30 added multi-point, multi-linestring, multi-polygon support
|
12
13
|
# Stan Smith 2014-05-29 original script
|
13
14
|
|
15
|
+
require_relative '../iso19115_2_writer'
|
14
16
|
require_relative 'class_point'
|
15
17
|
require_relative 'class_lineString'
|
16
18
|
require_relative 'class_polygon'
|
@@ -22,59 +24,62 @@ require_relative 'class_feature'
|
|
22
24
|
require_relative 'class_featureCollection'
|
23
25
|
|
24
26
|
module ADIWG
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
module Mdtranslator
|
28
|
+
module Writers
|
29
|
+
module Iso19115_2
|
28
30
|
|
29
|
-
|
31
|
+
class GeographicElement
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
def initialize(xml, hResponseObj)
|
34
|
+
@xml = xml
|
35
|
+
@hResponseObj = hResponseObj
|
36
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
37
|
+
end
|
35
38
|
|
36
|
-
|
39
|
+
def writeXML(aGeoElement)
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
# classes used
|
42
|
+
pointClass = Point.new(@xml, @hResponseObj)
|
43
|
+
lineClass = LineString.new(@xml, @hResponseObj)
|
44
|
+
polyClass = Polygon.new(@xml, @hResponseObj)
|
45
|
+
multiPointClass = MultiPoint.new(@xml, @hResponseObj)
|
46
|
+
multiLineClass = MultiLineString.new(@xml, @hResponseObj)
|
47
|
+
multiPolyClass = MultiPolygon.new(@xml, @hResponseObj)
|
48
|
+
geoCollectClass = GeometryCollection.new(@xml, @hResponseObj)
|
49
|
+
featureClass = Feature.new(@xml, @hResponseObj)
|
50
|
+
featureCollectClass = FeatureCollection.new(@xml, @hResponseObj)
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
52
|
+
aGeoElement.each do |hGeoElement|
|
53
|
+
@xml.tag!('gmd:polygon') do
|
54
|
+
case hGeoElement[:type]
|
55
|
+
when 'Point'
|
56
|
+
pointClass.writeXML(hGeoElement, {}, nil)
|
57
|
+
when 'LineString'
|
58
|
+
lineClass.writeXML(hGeoElement, {}, nil)
|
59
|
+
when 'Polygon'
|
60
|
+
polyClass.writeXML(hGeoElement, {}, nil)
|
61
|
+
when 'MultiPoint'
|
62
|
+
multiPointClass.writeXML(hGeoElement, {}, nil)
|
63
|
+
when 'MultiLineString'
|
64
|
+
multiLineClass.writeXML(hGeoElement, {}, nil)
|
65
|
+
when 'MultiPolygon'
|
66
|
+
multiPolyClass.writeXML(hGeoElement, {}, nil)
|
67
|
+
when 'GeometryCollection'
|
68
|
+
geoCollectClass.writeXML(hGeoElement, {}, nil)
|
69
|
+
when 'Feature'
|
70
|
+
featureClass.writeXML(hGeoElement)
|
71
|
+
when 'FeatureCollection'
|
72
|
+
featureCollectClass.writeXML(hGeoElement)
|
73
|
+
else
|
74
|
+
@NameSpace.issueNotice(110, "#{hGeoElement[:type]}")
|
72
75
|
end
|
76
|
+
end
|
77
|
+
end
|
73
78
|
|
74
|
-
|
75
|
-
|
79
|
+
end # writeXML
|
80
|
+
end # GeographicElement class
|
76
81
|
|
77
|
-
|
78
|
-
|
79
|
-
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
80
85
|
end
|
@@ -2,81 +2,81 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2016-12-02 original script
|
6
6
|
|
7
7
|
require_relative 'class_boundingBox'
|
8
8
|
require_relative 'class_mdIdentifier'
|
9
9
|
require_relative 'class_geographicElement'
|
10
10
|
|
11
11
|
module ADIWG
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_2
|
15
15
|
|
16
|
-
|
16
|
+
class GeographicExtent
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
def initialize(xml, hResponseObj)
|
19
|
+
@xml = xml
|
20
|
+
@hResponseObj = hResponseObj
|
21
|
+
end
|
22
22
|
|
23
|
-
|
23
|
+
def writeXML(hGeoExtent)
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
# classes used
|
26
|
+
bBoxClass = EX_GeographicBoundingBox.new(@xml, @hResponseObj)
|
27
|
+
idClass = MD_Identifier.new(@xml, @hResponseObj)
|
28
|
+
geoEleClass = GeographicElement.new(@xml, @hResponseObj)
|
29
29
|
|
30
|
-
|
30
|
+
extType = hGeoExtent[:containsData]
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
32
|
+
# geographic element - geographic bounding box
|
33
|
+
# test for user provided bounding box
|
34
|
+
# if empty, take computedBbox
|
35
|
+
hBbox = hGeoExtent[:boundingBox]
|
36
|
+
if hBbox.empty?
|
37
|
+
hBbox = hGeoExtent[:computedBbox]
|
38
|
+
end
|
39
|
+
unless hBbox.empty?
|
40
|
+
@xml.tag!('gmd:geographicElement') do
|
41
|
+
@xml.tag!('gmd:EX_GeographicBoundingBox') do
|
42
|
+
@xml.tag!('gmd:extentTypeCode') do
|
43
|
+
@xml.tag!('gco:Boolean', extType)
|
44
|
+
end
|
45
|
+
bBoxClass.writeXML(hBbox)
|
48
46
|
end
|
47
|
+
end
|
48
|
+
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|
50
|
+
# geographic element - geographic description
|
51
|
+
unless hGeoExtent[:identifier].empty?
|
52
|
+
@xml.tag!('gmd:geographicElement') do
|
53
|
+
@xml.tag!('gmd:EX_GeographicDescription') do
|
54
|
+
@xml.tag!('gmd:extentTypeCode') do
|
55
|
+
@xml.tag!('gco:Boolean', extType)
|
56
|
+
end
|
57
|
+
@xml.tag!('gmd:geographicIdentifier') do
|
58
|
+
idClass.writeXML(hGeoExtent[:identifier], 'geographic extent')
|
59
|
+
end
|
62
60
|
end
|
61
|
+
end
|
62
|
+
end
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
64
|
+
# geographic element - geographic bounding polygon
|
65
|
+
unless hGeoExtent[:geographicElements].empty?
|
66
|
+
@xml.tag!('gmd:geographicElement') do
|
67
|
+
@xml.tag!('gmd:EX_BoundingPolygon') do
|
68
|
+
@xml.tag!('gmd:extentTypeCode') do
|
69
|
+
@xml.tag!('gco:Boolean', extType)
|
70
|
+
end
|
71
|
+
geoEleClass.writeXML(hGeoExtent[:geographicElements])
|
74
72
|
end
|
73
|
+
end
|
74
|
+
end
|
75
75
|
|
76
|
-
|
77
|
-
|
76
|
+
end # writeXML
|
77
|
+
end # GeographicExtent class
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
82
|
end
|