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,55 +2,58 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
5
6
|
# Stan Smith 2016-12-08 original script.
|
6
7
|
|
8
|
+
require_relative '../iso19115_2_writer'
|
7
9
|
require_relative 'class_codelist'
|
8
10
|
|
9
11
|
module ADIWG
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_2
|
15
|
+
|
16
|
+
class MD_GeometricObjects
|
17
|
+
|
18
|
+
def initialize(xml, hResponseObj)
|
19
|
+
@xml = xml
|
20
|
+
@hResponseObj = hResponseObj
|
21
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
22
|
+
end
|
23
|
+
|
24
|
+
def writeXML(hGeoObj)
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
28
|
+
|
29
|
+
@xml.tag!('gmd:MD_GeometricObjects') do
|
30
|
+
|
31
|
+
# geometric object - object type (required)
|
32
|
+
s = hGeoObj[:objectType]
|
33
|
+
if s.nil?
|
34
|
+
@NameSpace.issueWarning(150, 'gmd:geometricObjectType', 'spatial representation')
|
35
|
+
else
|
36
|
+
@xml.tag!('gmd:geometricObjectType') do
|
37
|
+
codelistClass.writeXML('gmd', 'iso_geometricObjectType', s)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# geometric object - object count
|
42
|
+
s = hGeoObj[:objectCount]
|
43
|
+
unless s.nil?
|
44
|
+
@xml.tag!('gmd:geometricObjectCount') do
|
45
|
+
@xml.tag!('gco:Integer', s.to_s)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
49
|
+
@xml.tag!('gmd:geometricObjectCount')
|
50
|
+
end
|
51
|
+
|
52
|
+
end # gmd:MD_GeometricObjects tag
|
53
|
+
end # writeXML
|
54
|
+
end # MD_GeometricObjects class
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
56
59
|
end
|
@@ -2,8 +2,10 @@
|
|
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-06 original script
|
6
7
|
|
8
|
+
require_relative '../iso19115_2_writer'
|
7
9
|
require_relative 'class_point'
|
8
10
|
require_relative 'class_lineString'
|
9
11
|
require_relative 'class_polygon'
|
@@ -13,78 +15,81 @@ require_relative 'class_multiPolygon'
|
|
13
15
|
require_relative 'class_featureProperties'
|
14
16
|
|
15
17
|
module ADIWG
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
module Mdtranslator
|
19
|
+
module Writers
|
20
|
+
module Iso19115_2
|
19
21
|
|
20
|
-
|
22
|
+
class GeometryCollection
|
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(hGeoObject, hProperties, objId)
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
# classes used
|
33
|
+
pointClass = Point.new(@xml, @hResponseObj)
|
34
|
+
lineClass = LineString.new(@xml, @hResponseObj)
|
35
|
+
polyClass = Polygon.new(@xml, @hResponseObj)
|
36
|
+
multiPointClass = MultiPoint.new(@xml, @hResponseObj)
|
37
|
+
multiLineClass = MultiLineString.new(@xml, @hResponseObj)
|
38
|
+
multiPolyClass = MultiPolygon.new(@xml, @hResponseObj)
|
39
|
+
geoPropClass = FeatureProperties.new(@xml, @hResponseObj)
|
37
40
|
|
38
|
-
|
39
|
-
|
41
|
+
# geometry collection attributes
|
42
|
+
attributes = {}
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
# geometry collection attributes - gml:id (required)
|
45
|
+
if objId.nil?
|
46
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
47
|
+
objId = 'geometryCollection' + @hResponseObj[:writerMissingIdCount]
|
48
|
+
else
|
49
|
+
objId.gsub!(/[^0-9a-zA-Z]/, '')
|
50
|
+
end
|
51
|
+
attributes['gml:id'] = objId
|
49
52
|
|
50
|
-
|
51
|
-
|
53
|
+
# geometry collection attributes - srsName (GeoJSON is WGS84)
|
54
|
+
attributes[:srsName] = 'WGS84'
|
52
55
|
|
53
|
-
|
56
|
+
@xml.tag!('gml:MultiGeometry', attributes) do
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
58
|
+
# geometry collection - properties for Feature
|
59
|
+
unless hProperties.empty?
|
60
|
+
geoPropClass.writeXML(hProperties)
|
61
|
+
end
|
59
62
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
63
|
+
# geometry collection - geometry objects (required)
|
64
|
+
@xml.tag!('gml:geometryMembers') do
|
65
|
+
unless hGeoObject[:geometryObjects].empty?
|
66
|
+
aObjects = hGeoObject[:geometryObjects]
|
67
|
+
aObjects.each do |hGeoObj|
|
68
|
+
case hGeoObj[:type]
|
69
|
+
when 'Point'
|
70
|
+
pointClass.writeXML(hGeoObj, {}, nil)
|
71
|
+
when 'LineString'
|
72
|
+
lineClass.writeXML(hGeoObj, {}, nil)
|
73
|
+
when 'Polygon'
|
74
|
+
polyClass.writeXML(hGeoObj, {}, nil)
|
75
|
+
when 'MultiPoint'
|
76
|
+
multiPointClass.writeXML(hGeoObj, {}, nil)
|
77
|
+
when 'MultiLineString'
|
78
|
+
multiLineClass.writeXML(hGeoObj, {}, nil)
|
79
|
+
when 'MultiPolygon'
|
80
|
+
multiPolyClass.writeXML(hGeoObj, {}, nil)
|
81
|
+
else
|
82
|
+
@NameSpace.issueNotice(160, "#{hGeoObj[:type]}")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
82
87
|
|
83
|
-
|
84
|
-
|
85
|
-
|
88
|
+
end # gml:MultiGeometry tag
|
89
|
+
end # writeXML
|
90
|
+
end # GeometryCollection class
|
86
91
|
|
87
|
-
|
88
|
-
|
89
|
-
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
90
95
|
end
|
@@ -2,120 +2,123 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
5
6
|
# Stan Smith 2016-12-08 original script.
|
6
7
|
|
8
|
+
require_relative '../iso19115_2_writer'
|
7
9
|
require_relative 'class_grid'
|
8
10
|
require_relative 'class_point'
|
9
11
|
|
10
12
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso19115_2
|
16
|
+
|
17
|
+
class MD_Georectified
|
18
|
+
|
19
|
+
def initialize(xml, hResponseObj)
|
20
|
+
@xml = xml
|
21
|
+
@hResponseObj = hResponseObj
|
22
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
23
|
+
end
|
24
|
+
|
25
|
+
def writeXML(hGeoRec)
|
26
|
+
|
27
|
+
# classes used
|
28
|
+
gridClass = Grid.new(@xml, @hResponseObj)
|
29
|
+
pointClass = Point.new(@xml, @hResponseObj)
|
30
|
+
|
31
|
+
@xml.tag!('gmd:MD_Georectified') do
|
32
|
+
|
33
|
+
# georectified - add grid info
|
34
|
+
hGrid = hGeoRec[:gridRepresentation]
|
35
|
+
gridClass.writeXML(hGrid, 'georectified representation')
|
36
|
+
|
37
|
+
# georectified - checkpoint availability
|
38
|
+
s = hGeoRec[:checkPointAvailable]
|
39
|
+
@xml.tag!('gmd:checkPointAvailability') do
|
40
|
+
@xml.tag!('gco:Boolean', s)
|
41
|
+
end
|
42
|
+
|
43
|
+
# georectified - checkpoint description
|
44
|
+
s = hGeoRec[:checkPointDescription]
|
45
|
+
unless s.nil?
|
46
|
+
@xml.tag!('gmd:checkPointDescription') do
|
47
|
+
@xml.tag!('gco:CharacterString', s)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
51
|
+
@xml.tag!('gmd:checkPointDescription')
|
52
|
+
end
|
53
|
+
|
54
|
+
# georectified - corner points (required)
|
55
|
+
# note: 2 - 4 points are required, but XSD only allows 1
|
56
|
+
# ... coordinates are flattened into one multi-dimensional point
|
57
|
+
aCoords = hGeoRec[:cornerPoints]
|
58
|
+
unless aCoords.empty?
|
59
|
+
aCoords = aCoords.flatten
|
60
|
+
hPoint = {}
|
61
|
+
hPoint[:type] = 'Point'
|
62
|
+
hPoint[:coordinates] = aCoords
|
63
|
+
@xml.tag!('gmd:cornerPoints') do
|
64
|
+
pointClass.writeXML(hPoint, {}, nil)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
if aCoords.empty?
|
68
|
+
@NameSpace.issueWarning(170, 'gmd:cornerPoints', 'spatial representation')
|
69
|
+
end
|
70
|
+
|
71
|
+
# georectified - center point
|
72
|
+
aCoords = hGeoRec[:centerPoint]
|
73
|
+
unless aCoords.empty?
|
74
|
+
hPoint = {}
|
75
|
+
hPoint[:type] = 'Point'
|
76
|
+
hPoint[:coordinates] = aCoords
|
77
|
+
@xml.tag!('gmd:centerPoint') do
|
78
|
+
pointClass.writeXML(hPoint, {}, nil)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
if aCoords.empty? && @hResponseObj[:writerShowTags]
|
82
|
+
@xml.tag!('gmd:centerPoint')
|
83
|
+
end
|
84
|
+
|
85
|
+
# georectified - point in pixel (required)
|
86
|
+
s = hGeoRec[:pointInPixel]
|
87
|
+
if s.nil?
|
88
|
+
@NameSpace.issueWarning(171, 'gmd:pointInPixel', 'spatial representation')
|
89
|
+
else
|
90
|
+
@xml.tag!('gmd:pointInPixel') do
|
91
|
+
@xml.tag!('gmd:MD_PixelOrientationCode', s)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# georectified - transformation dimension description
|
96
|
+
s = hGeoRec[:transformationDimensionDescription]
|
97
|
+
unless s.nil?
|
98
|
+
@xml.tag!('gmd:transformationDimensionDescription') do
|
99
|
+
@xml.tag!('gco:CharacterString', s)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
103
|
+
@xml.tag!('gmd:transformationDimensionDescription')
|
104
|
+
end
|
105
|
+
|
106
|
+
# georectified - transformation dimension mapping
|
107
|
+
s = hGeoRec[:transformationDimensionMapping]
|
108
|
+
unless s.nil?
|
109
|
+
@xml.tag!('gmd:transformationDimensionMapping') do
|
110
|
+
@xml.tag!('gco:CharacterString', s)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
114
|
+
@xml.tag!('gmd:transformationDimensionMapping')
|
115
|
+
end
|
116
|
+
|
117
|
+
end # gmd:MD_Georectified tag
|
118
|
+
end # writeXML
|
119
|
+
end # MD_Georectified class
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
121
124
|
end
|