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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
- data/lib/adiwg/mdtranslator/version.rb +8 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
- data/lib/adiwg/mdtranslator_cli.rb +18 -8
- metadata +14 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -2,6 +2,7 @@
|
|
2
2
|
# FGDC CSDGM writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-03-27 refactored error and warning messaging
|
5
6
|
# Stan Smith 2018-01-16 original script
|
6
7
|
|
7
8
|
module ADIWG
|
@@ -14,6 +15,7 @@ module ADIWG
|
|
14
15
|
def initialize(xml, hResponseObj)
|
15
16
|
@xml = xml
|
16
17
|
@hResponseObj = hResponseObj
|
18
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
|
17
19
|
end
|
18
20
|
|
19
21
|
def writeXML(aSpaceRefs)
|
@@ -32,8 +34,7 @@ module ADIWG
|
|
32
34
|
@xml.tag!('depthdn', hVDatum[:datumName])
|
33
35
|
end
|
34
36
|
if hVDatum[:datumName].nil?
|
35
|
-
@
|
36
|
-
@hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing datum name'
|
37
|
+
@NameSpace.issueWarning(460, 'depthdn')
|
37
38
|
end
|
38
39
|
|
39
40
|
# vertical datum 4.2.1.2 (depthres) - depth units resolution (required)
|
@@ -41,8 +42,7 @@ module ADIWG
|
|
41
42
|
@xml.tag!('depthres', hVDatum[:verticalResolution])
|
42
43
|
end
|
43
44
|
if hVDatum[:verticalResolution].nil?
|
44
|
-
@
|
45
|
-
@hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth units resolution'
|
45
|
+
@NameSpace.issueWarning(461, 'depthres')
|
46
46
|
end
|
47
47
|
|
48
48
|
# vertical datum 4.2.1.3 (depthdu) - depth units (required)
|
@@ -50,17 +50,15 @@ module ADIWG
|
|
50
50
|
@xml.tag!('depthdu', hVDatum[:unitOfMeasure])
|
51
51
|
end
|
52
52
|
if hVDatum[:unitOfMeasure].nil?
|
53
|
-
@
|
54
|
-
@hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth units'
|
53
|
+
@NameSpace.issueWarning(462, 'depthdu')
|
55
54
|
end
|
56
55
|
|
57
|
-
# vertical datum 4.2.1.4 (depthem) -
|
56
|
+
# vertical datum 4.2.1.4 (depthem) - encoding method (required)
|
58
57
|
unless hVDatum[:encodingMethod].nil?
|
59
58
|
@xml.tag!('depthem', hVDatum[:encodingMethod])
|
60
59
|
end
|
61
60
|
if hVDatum[:encodingMethod].nil?
|
62
|
-
@
|
63
|
-
@hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth encoding method'
|
61
|
+
@NameSpace.issueWarning(463, 'depthem')
|
64
62
|
end
|
65
63
|
|
66
64
|
end
|
@@ -73,8 +71,7 @@ module ADIWG
|
|
73
71
|
@xml.tag!('altdatum', hVDatum[:datumName])
|
74
72
|
end
|
75
73
|
if hVDatum[:datumName].nil?
|
76
|
-
@
|
77
|
-
@hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing datum name'
|
74
|
+
@NameSpace.issueWarning(464, 'altdatum')
|
78
75
|
end
|
79
76
|
|
80
77
|
# altitude datum 4.2.2.2 (altres) - altitude units resolution (required)
|
@@ -82,8 +79,7 @@ module ADIWG
|
|
82
79
|
@xml.tag!('altres', hVDatum[:verticalResolution])
|
83
80
|
end
|
84
81
|
if hVDatum[:verticalResolution].nil?
|
85
|
-
@
|
86
|
-
@hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth units resolution'
|
82
|
+
@NameSpace.issueWarning(465, 'altres')
|
87
83
|
end
|
88
84
|
|
89
85
|
# altitude datum 4.2.2.3 (altunits) - altitude units (required)
|
@@ -91,8 +87,7 @@ module ADIWG
|
|
91
87
|
@xml.tag!('altunits', hVDatum[:unitOfMeasure])
|
92
88
|
end
|
93
89
|
if hVDatum[:unitOfMeasure].nil?
|
94
|
-
@
|
95
|
-
@hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth units'
|
90
|
+
@NameSpace.issueWarning(466, 'altunits')
|
96
91
|
end
|
97
92
|
|
98
93
|
# altitude datum 4.2.2.4 (altenc) - altitude units (required)
|
@@ -100,8 +95,7 @@ module ADIWG
|
|
100
95
|
@xml.tag!('altenc', hVDatum[:encodingMethod])
|
101
96
|
end
|
102
97
|
if hVDatum[:encodingMethod].nil?
|
103
|
-
@
|
104
|
-
@hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth encoding method'
|
98
|
+
@NameSpace.issueWarning(467, 'altenc')
|
105
99
|
end
|
106
100
|
|
107
101
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# History:
|
4
4
|
# Stan Smith 2017-11-16 original script
|
5
5
|
|
6
|
+
require 'yaml'
|
6
7
|
require 'builder'
|
7
8
|
require_relative 'version'
|
8
9
|
require_relative 'classes/class_fgdc'
|
@@ -17,16 +18,22 @@ module ADIWG
|
|
17
18
|
# make objects available to the instance
|
18
19
|
@intObj = intObj
|
19
20
|
@contacts = intObj[:contacts]
|
21
|
+
@hResponseObj = responseObj
|
22
|
+
|
23
|
+
# load error message array
|
24
|
+
file = File.join(File.dirname(__FILE__), 'fgdc_writer_messages_eng') + '.yml'
|
25
|
+
hMessageList = YAML.load_file(file)
|
26
|
+
@aMessagesList = hMessageList['messageList']
|
20
27
|
|
21
28
|
# set the format of the output file based on the writer
|
22
29
|
responseObj[:writerOutputFormat] = 'xml'
|
23
30
|
responseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Fgdc::VERSION
|
24
31
|
|
25
32
|
# create new XML document
|
26
|
-
xml = Builder::XmlMarkup.new(indent: 3)
|
33
|
+
@xml = Builder::XmlMarkup.new(indent: 3)
|
27
34
|
|
28
35
|
# start writing the FGDC XML record
|
29
|
-
metadataWriter = Fgdc.new(xml, responseObj)
|
36
|
+
metadataWriter = Fgdc.new(@xml, responseObj)
|
30
37
|
metadata = metadataWriter.writeXML(intObj)
|
31
38
|
|
32
39
|
return metadata
|
@@ -56,10 +63,53 @@ module ADIWG
|
|
56
63
|
return aParties
|
57
64
|
end
|
58
65
|
|
59
|
-
def
|
66
|
+
def self.get_intObj
|
60
67
|
return @intObj
|
61
68
|
end
|
62
69
|
|
70
|
+
def self.findMessage(messageId)
|
71
|
+
@aMessagesList.each do |hMessage|
|
72
|
+
if hMessage['id'] == messageId
|
73
|
+
return hMessage['message']
|
74
|
+
end
|
75
|
+
end
|
76
|
+
return nil
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.issueError(messageId, context = nil)
|
80
|
+
message = findMessage(messageId)
|
81
|
+
unless message.nil?
|
82
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
83
|
+
@hResponseObj[:writerMessages] << 'ERROR: FGDC writer: ' + message
|
84
|
+
@hResponseObj[:writerPass] = false
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.issueWarning(messageId, tag = nil, context = nil)
|
89
|
+
message = findMessage(messageId)
|
90
|
+
unless message.nil?
|
91
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
92
|
+
if @hResponseObj[:writerForceValid]
|
93
|
+
if tag.nil?
|
94
|
+
issueError(messageId, context)
|
95
|
+
else
|
96
|
+
@xml.tag!(tag, 'missing')
|
97
|
+
@hResponseObj[:writerMessages] << 'WARNING: FGDC writer: ' + message
|
98
|
+
end
|
99
|
+
else
|
100
|
+
@hResponseObj[:writerMessages] << 'WARNING: FGDC writer: ' + message
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.issueNotice(messageId, context = nil)
|
106
|
+
message = findMessage(messageId)
|
107
|
+
unless message.nil?
|
108
|
+
message += ': CONTEXT is ' + context unless context.nil?
|
109
|
+
@hResponseObj[:writerMessages] << 'NOTICE: FGDC writer: ' + message
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
63
113
|
end
|
64
114
|
end
|
65
115
|
end
|
@@ -0,0 +1,213 @@
|
|
1
|
+
# Writer - messages for FGDC CSDGM FGDC-STD-001-1998
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2018-03-17 original script
|
5
|
+
|
6
|
+
messageList:
|
7
|
+
- {id: 1, message: "contact address type is missing"}
|
8
|
+
- {id: 2, message: "contact address city is missing"}
|
9
|
+
- {id: 3, message: "contact address state is missing"}
|
10
|
+
- {id: 4, message: "contact address postal code is missing"}
|
11
|
+
- {id: 5, message: "contact voice phone is missing"}
|
12
|
+
|
13
|
+
- {id: 10, message: "attribute label is missing"}
|
14
|
+
- {id: 11, message: "attribute definition is missing"}
|
15
|
+
- {id: 12, message: "attribute definition source is missing"}
|
16
|
+
- {id: 13, message: "attribute range value minimum is missing"}
|
17
|
+
- {id: 14, message: "attribute range value maximum is missing"}
|
18
|
+
- {id: 15, message: "attribute date range beginning date is missing"}
|
19
|
+
- {id: 16, message: "attribute date range ending date is missing"}
|
20
|
+
|
21
|
+
- {id: 20, message: "browse graphic name is missing"}
|
22
|
+
- {id: 21, message: "browse graphic description is missing"}
|
23
|
+
- {id: 22, message: "browse graphic file type is missing"}
|
24
|
+
|
25
|
+
- {id: 30, message: "citation originator role is missing"}
|
26
|
+
- {id: 31, message: "citation publication date is missing"}
|
27
|
+
- {id: 32, message: "citation title is missing"}
|
28
|
+
|
29
|
+
- {id: 40, message: "access constraint is missing"}
|
30
|
+
- {id: 41, message: "use constraint is missing"}
|
31
|
+
|
32
|
+
- {id: 50, message: "organization contact name is missing"}
|
33
|
+
- {id: 51, message: "individual contact name is missing"}
|
34
|
+
- {id: 52, message: "contact type is missing"}
|
35
|
+
- {id: 53, message: "individual contact name is missing"}
|
36
|
+
- {id: 54, message: "organization contact name is missing"}
|
37
|
+
- {id: 55, message: "contact address is missing"}
|
38
|
+
|
39
|
+
- {id: 60, message: "description abstract is missing"}
|
40
|
+
- {id: 61, message: "description purpose is missing"}
|
41
|
+
|
42
|
+
- {id: 70, message: "dictionary domain ID was not found"}
|
43
|
+
- {id: 71, message: "enumerated domain value is missing"}
|
44
|
+
- {id: 72, message: "enumerated domain value definition is missing"}
|
45
|
+
- {id: 73, message: "enumerated domain value source is missing"}
|
46
|
+
- {id: 74, message: "codeset domain name is missing"}
|
47
|
+
- {id: 75, message: "codeset domain reference is missing"}
|
48
|
+
- {id: 76, message: "enumerated domain value source is missing"}
|
49
|
+
|
50
|
+
- {id: 80, message: "data dictionary requires at least one detail or overview entity"}
|
51
|
+
|
52
|
+
- {id: 90, message: "entity type label is missing"}
|
53
|
+
- {id: 91, message: "entity type definition is missing"}
|
54
|
+
- {id: 92, message: "entity type definition source is missing"}
|
55
|
+
|
56
|
+
- {id: 100, message: "entity overview definition is missing"}
|
57
|
+
|
58
|
+
- {id: 110, message: "distributor contact is missing"}
|
59
|
+
- {id: 111, message: "distributor liability statement is missing"}
|
60
|
+
|
61
|
+
- {id: 120, message: "offline option media name is missing"}
|
62
|
+
- {id: 121, message: "offline option recording density is missing"}
|
63
|
+
- {id: 122, message: "offline option recording density units are missing"}
|
64
|
+
- {id: 123, message: "offline option recording format is missing"}
|
65
|
+
|
66
|
+
- {id: 130, message: "online option network address is missing"}
|
67
|
+
|
68
|
+
- {id: 140, message: "standard order process fees is missing"}
|
69
|
+
|
70
|
+
- {id: 150, message: "geodetic coordinate system ellipsoid name is missing"}
|
71
|
+
- {id: 151, message: "geodetic coordinate system semi-major axis is missing"}
|
72
|
+
- {id: 152, message: "geodetic coordinate system denominator of flattening ratio is missing"}
|
73
|
+
|
74
|
+
- {id: 160, message: "geographic resolution latitude resolution is missing"}
|
75
|
+
- {id: 161, message: "geographic resolution longitude resolution is missing"}
|
76
|
+
- {id: 162, message: "geographic resolution unit of measure is missing"}
|
77
|
+
|
78
|
+
- {id: 170, message: "geologic age time scale is missing"}
|
79
|
+
- {id: 171, message: "geologic age estimate is missing"}
|
80
|
+
- {id: 172, message: "geologic age range starting age is missing"}
|
81
|
+
- {id: 173, message: "geologic age range ending age is missing"}
|
82
|
+
|
83
|
+
- {id: 180, message: "main resource citation is missing"}
|
84
|
+
- {id: 181, message: "description is missing"}
|
85
|
+
- {id: 182, message: "time period is missing"}
|
86
|
+
- {id: 183, message: "keywords are missing"}
|
87
|
+
- {id: 184, message: "access constraint is missing"}
|
88
|
+
- {id: 185, message: "use constraint is missing"}
|
89
|
+
- {id: 186, message: "multiple taxonomic structures were specified, CSDGM allows for only one"}
|
90
|
+
- {id: 187, message: "the first taxonomic structure was written to the metadata record"}
|
91
|
+
|
92
|
+
- {id: 190, message: "keyword set thesaurus is missing"}
|
93
|
+
|
94
|
+
- {id: 200, message: "lineage source process steps are missing"}
|
95
|
+
|
96
|
+
- {id: 210, message: "lineage method type is missing"}
|
97
|
+
- {id: 211, message: "lineage method description is missing"}
|
98
|
+
- {id: 212, message: "lineage method citation is missing"}
|
99
|
+
|
100
|
+
- {id: 220, message: "lineage method keyword set is missing"}
|
101
|
+
- {id: 221, message: "lineage method keyword set thesaurus is missing"}
|
102
|
+
|
103
|
+
- {id: 230, message: "lineage source abbreviation code (source id) is missing"}
|
104
|
+
- {id: 231, message: "lineage source citation is missing"}
|
105
|
+
- {id: 232, message: "lineage source media type (description) is missing"}
|
106
|
+
- {id: 233, message: "lineage source time period is missing"}
|
107
|
+
- {id: 234, message: "lineage source citation abbreviation (id) is missing"}
|
108
|
+
- {id: 235, message: "lineage source contribution (description) is missing"}
|
109
|
+
|
110
|
+
- {id: 240, message: "lineage process step description is missing"}
|
111
|
+
- {id: 241, message: "lineage process step process date is missing"}
|
112
|
+
|
113
|
+
- {id: 250, message: "local coordinate system description is missing"}
|
114
|
+
- {id: 251, message: "local coordinate system georeference information is missing"}
|
115
|
+
|
116
|
+
- {id: 260, message: "planar coordinate information encoding method is missing"}
|
117
|
+
- {id: 261, message: "coordinate representation abscissa resolution is missing"}
|
118
|
+
- {id: 262, message: "coordinate representation ordinate resolution is missing"}
|
119
|
+
- {id: 263, message: "coordinate representation planar distance units are missing"}
|
120
|
+
- {id: 264, message: "bearing-distance representation distance resolution is missing"}
|
121
|
+
- {id: 265, message: "bearing-distance representation bearing resolution is missing"}
|
122
|
+
- {id: 266, message: "bearing-distance representation bearing units are missing"}
|
123
|
+
- {id: 267, message: "bearing-distance representation bearing reference direction is missing"}
|
124
|
+
- {id: 268, message: "bearing-distance representation bearing reference meridian is missing"}
|
125
|
+
- {id: 269, message: "bearing-distance representation planar distance units are missing"}
|
126
|
+
- {id: 270, message: "planar coordinate information section is missing"}
|
127
|
+
|
128
|
+
- {id: 280, message: "map projection name is missing projection type"}
|
129
|
+
- {id: 281, message: "map projection false easting is missing"}
|
130
|
+
- {id: 282, message: "map projection false northing is missing"}
|
131
|
+
- {id: 283, message: "map projection standard parallel is missing"}
|
132
|
+
- {id: 284, message: "map projection longitude of central meridian is missing"}
|
133
|
+
- {id: 285, message: "map projection latitude of projection origin is missing"}
|
134
|
+
- {id: 286, message: "map projection height of perspective point above surface is missing"}
|
135
|
+
- {id: 287, message: "map projection longitude of projection center is missing"}
|
136
|
+
- {id: 288, message: "map projection latitude of projection center is missing"}
|
137
|
+
- {id: 289, message: "map projection scale factor at equator is missing"}
|
138
|
+
- {id: 290, message: "map projection scale factor at center line is missing"}
|
139
|
+
- {id: 291, message: "map projection scale factor at projection origin is missing"}
|
140
|
+
- {id: 292, message: "map projection scale factor at central meridian is missing"}
|
141
|
+
- {id: 293, message: "map projection oblique line azimuth angle is missing"}
|
142
|
+
- {id: 294, message: "map projection oblique line measure point longitude is missing"}
|
143
|
+
- {id: 295, message: "map projection oblique line azimuth information is missing"}
|
144
|
+
- {id: 296, message: "map projection oblique line point latitude is missing"}
|
145
|
+
- {id: 297, message: "map projection oblique line point longitude is missing"}
|
146
|
+
- {id: 298, message: "map projection straight vertical longitude from pole is missing"}
|
147
|
+
- {id: 299, message: "map projection landsat number is missing"}
|
148
|
+
- {id: 300, message: "map projection landsat path is missing"}
|
149
|
+
- {id: 301, message: "map projection other projection description is missing"}
|
150
|
+
- {id: 302, message: "map projection local planar description is missing"}
|
151
|
+
- {id: 303, message: "map projection local planar georeference information is missing"}
|
152
|
+
|
153
|
+
- {id: 310, message: "map grid universal transverse mercator zone is missing"}
|
154
|
+
- {id: 311, message: "map grid universal polar stereographic zone is missing"}
|
155
|
+
- {id: 312, message: "map grid state plane coordinate system zone is missing"}
|
156
|
+
- {id: 313, message: "map grid equal arc-second coordinate system zone is missing"}
|
157
|
+
|
158
|
+
- {id: 320, message: "metadata creation date is missing"}
|
159
|
+
- {id: 321, message: "metadata contact is missing"}
|
160
|
+
|
161
|
+
- {id: 330, message: "publication place is missing"}
|
162
|
+
- {id: 331, message: "publication name is missing"}
|
163
|
+
|
164
|
+
- {id: 340, message: "security classification system is missing"}
|
165
|
+
- {id: 341, message: "security classification is missing"}
|
166
|
+
- {id: 342, message: "security handling instructions are missing"}
|
167
|
+
|
168
|
+
- {id: 350, message: "lineage section is missing"}
|
169
|
+
|
170
|
+
- {id: 360, message: "series name is missing"}
|
171
|
+
- {id: 361, message: "series issue is missing"}
|
172
|
+
|
173
|
+
- {id: 370, message: "spatial domain geographic description is missing"}
|
174
|
+
- {id: 371, message: "altitude bounding box minimum altitude is missing"}
|
175
|
+
- {id: 372, message: "altitude bounding box maximum altitude is missing"}
|
176
|
+
- {id: 373, message: "spatial domain bounding box is missing"}
|
177
|
+
|
178
|
+
- {id: 380, message: "raster spatial organization raster type is missing"}
|
179
|
+
|
180
|
+
- {id: 390, message: "progress is missing"}
|
181
|
+
- {id: 391, message: "maintenance frequency is missing"}
|
182
|
+
- {id: 392, message: "status section is missing"}
|
183
|
+
|
184
|
+
- {id: 400, message: "taxonomic classification is missing"}
|
185
|
+
|
186
|
+
- {id: 410, message: "taxonomic classification taxon rank is missing"}
|
187
|
+
- {id: 411, message: "taxonomic classification taxon value (latin name) is missing"}
|
188
|
+
|
189
|
+
- {id: 420, message: "taxonomy keyword set thesaurus is missing"}
|
190
|
+
- {id: 421, message: "taxonomy keyword set must have at least one keyword"}
|
191
|
+
- {id: 422, message: "taxonomy keyword set is missing"}
|
192
|
+
|
193
|
+
- {id: 430, message: "taxonomic classification system citation is missing"}
|
194
|
+
- {id: 431, message: "taxonomic classification system is missing"}
|
195
|
+
- {id: 432, message: "taxonomic procedures are missing"}
|
196
|
+
- {id: 433, message: "taxonomic voucher specimen is missing"}
|
197
|
+
- {id: 434, message: "taxonomic voucher repository is missing"}
|
198
|
+
|
199
|
+
- {id: 440, message: "time period age and date items are missing"}
|
200
|
+
- {id: 441, message: "time period must be either geologic age or conventional dates, not both"}
|
201
|
+
- {id: 442, message: "time period will default to conventional date"}
|
202
|
+
- {id: 443, message: "time info currentness is missing"}
|
203
|
+
|
204
|
+
- {id: 450, message: "distribution format name is missing"}
|
205
|
+
|
206
|
+
- {id: 460, message: "vertical depth datum name is missing"}
|
207
|
+
- {id: 461, message: "vertical depth resolution is missing"}
|
208
|
+
- {id: 462, message: "vertical depth units of measure is missing"}
|
209
|
+
- {id: 463, message: "vertical depth encoding method is missing"}
|
210
|
+
- {id: 464, message: "vertical altitude datum name is missing"}
|
211
|
+
- {id: 465, message: "vertical altitude resolution is missing"}
|
212
|
+
- {id: 466, message: "vertical altitude units of measure is missing"}
|
213
|
+
- {id: 467, message: "vertical altitude encoding method is missing"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# fgdc version history
|
2
|
-
# Stan Smith
|
2
|
+
# Stan Smith 1.1.0 2018-03-22 refactored message system and minor bug fixes
|
3
|
+
# Stan Smith 1.0.0 2017-11-16 original script
|
3
4
|
|
4
5
|
module ADIWG
|
5
6
|
module Mdtranslator
|
@@ -7,7 +8,7 @@ module ADIWG
|
|
7
8
|
module Fgdc
|
8
9
|
|
9
10
|
# current version of fgdc writer
|
10
|
-
VERSION = '1.
|
11
|
+
VERSION = '1.1.0'
|
11
12
|
|
12
13
|
end
|
13
14
|
end
|
@@ -5,6 +5,7 @@
|
|
5
5
|
# Stan Smith 2017-08-31 refactored for mdJson 2.3 schema update
|
6
6
|
# Stan Smith 2017-04-04 original script
|
7
7
|
|
8
|
+
require_relative 'html_responsibility'
|
8
9
|
require_relative 'html_onlineResource'
|
9
10
|
|
10
11
|
module ADIWG
|
@@ -21,6 +22,7 @@ module ADIWG
|
|
21
22
|
def writeHtml(hAllocation)
|
22
23
|
|
23
24
|
# classes used
|
25
|
+
responsibilityClass = Html_Responsibility.new(@html)
|
24
26
|
onlineClass = Html_OnlineResource.new(@html)
|
25
27
|
|
26
28
|
# allocation - id
|
@@ -75,7 +77,17 @@ module ADIWG
|
|
75
77
|
@html.br
|
76
78
|
end
|
77
79
|
|
78
|
-
# allocation -
|
80
|
+
# allocation - responsible parties [] {responsibleParty}
|
81
|
+
hAllocation[:responsibleParties].each do |hResponsibility|
|
82
|
+
@html.details do
|
83
|
+
@html.summary(hResponsibility[:roleName], 'class' => 'h5')
|
84
|
+
@html.section(:class => 'block') do
|
85
|
+
responsibilityClass.writeHtml(hResponsibility)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# allocation - online resource [] {onlineResource}
|
79
91
|
hAllocation[:onlineResources].each do |hOnline|
|
80
92
|
@html.details do
|
81
93
|
@html.summary('Online Resource', {'class' => 'h5'})
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# resource information
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-06 changed taxonomy to an array
|
5
6
|
# Stan Smith 2017-05-19 removed iso topicCategory (now presented as keywords)
|
6
7
|
# Stan Smith 2017-03-25 refactored for mdTranslator 2.0
|
7
8
|
# Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
|
@@ -337,7 +338,16 @@ module ADIWG
|
|
337
338
|
@html.details do
|
338
339
|
@html.summary('Taxonomy', {'id' => 'resourceInfo-taxonomy', 'class' => 'h3'})
|
339
340
|
@html.section(:class => 'block') do
|
340
|
-
|
341
|
+
counter = 0
|
342
|
+
hResource[:taxonomy].each do |hTaxonomy|
|
343
|
+
counter += 1
|
344
|
+
@html.details do
|
345
|
+
@html.summary('Taxonomic Structure '+counter.to_s, 'class' => 'h5')
|
346
|
+
@html.section(:class => 'block') do
|
347
|
+
taxonomyClass.writeHtml(hTaxonomy)
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
341
351
|
end
|
342
352
|
end
|
343
353
|
end
|
@@ -38,6 +38,16 @@ module ADIWG
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
# taxonomy - taxonomic class
|
42
|
+
unless hTaxonomy[:taxonClass].empty?
|
43
|
+
@html.details do
|
44
|
+
@html.summary('Taxonomic Classification', {'class' => 'h5'})
|
45
|
+
@html.section(:class => 'block') do
|
46
|
+
taxonomicClass.writeHtml(hTaxonomy[:taxonClass])
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
41
51
|
# taxonomy - identification procedures
|
42
52
|
unless hTaxonomy[:idProcedure].nil?
|
43
53
|
@html.em('Identification Procedures: ')
|
@@ -80,16 +90,6 @@ module ADIWG
|
|
80
90
|
end
|
81
91
|
end
|
82
92
|
|
83
|
-
# taxonomy - taxonomic class
|
84
|
-
unless hTaxonomy[:taxonClass].empty?
|
85
|
-
@html.details do
|
86
|
-
@html.summary('Taxonomic Classification', {'class' => 'h5'})
|
87
|
-
@html.section(:class => 'block') do
|
88
|
-
taxonomicClass.writeHtml(hTaxonomy[:taxonClass])
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
93
|
# taxonomy - identification references
|
94
94
|
hTaxonomy[:idReferences].each do |hReference|
|
95
95
|
@html.details do
|
@@ -30,16 +30,16 @@ module ADIWG
|
|
30
30
|
@html.br
|
31
31
|
end
|
32
32
|
|
33
|
-
# taxonomic classification -
|
33
|
+
# taxonomic classification - level
|
34
34
|
unless hTaxon[:taxonRank].nil?
|
35
|
-
@html.em('Taxonomic
|
35
|
+
@html.em('Taxonomic Level: ')
|
36
36
|
@html.text!(hTaxon[:taxonRank])
|
37
37
|
@html.br
|
38
38
|
end
|
39
39
|
|
40
|
-
# taxonomic classification -
|
40
|
+
# taxonomic classification - name
|
41
41
|
unless hTaxon[:taxonValue].nil?
|
42
|
-
@html.em('Taxonomic
|
42
|
+
@html.em('Taxonomic Name: ')
|
43
43
|
@html.text!(hTaxon[:taxonValue])
|
44
44
|
@html.br
|
45
45
|
end
|
@@ -2,41 +2,41 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
6
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
7
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
8
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
5
9
|
# Stan Smith 2014-12-03 original script
|
6
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
|
-
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
8
|
-
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
-
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
10
10
|
|
11
11
|
module ADIWG
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19110
|
15
15
|
|
16
|
-
|
16
|
+
class BaseUnit
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
def initialize(xml, responseObj)
|
19
|
+
@xml = xml
|
20
|
+
@hResponseObj = responseObj
|
21
|
+
end
|
22
22
|
|
23
|
-
|
23
|
+
def writeXML(hBase)
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
# create and identity for the unit
|
26
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
27
|
+
unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
|
28
|
+
@xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
|
29
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
|
30
|
+
@xml.tag!('gml:name', hBase[:name])
|
31
|
+
@xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
|
32
|
+
@xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
|
33
|
+
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
end
|
35
|
+
end
|
38
36
|
|
39
37
|
end
|
40
|
-
|
41
|
-
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
42
|
end
|
@@ -2,8 +2,10 @@
|
|
2
2
|
# 19110 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-03-30 refactored error and warning messaging
|
5
6
|
# Stan Smith 2017-11-02 original script.
|
6
7
|
|
8
|
+
require_relative '../iso19110_writer'
|
7
9
|
require_relative 'class_codelist'
|
8
10
|
require_relative 'class_responsibleParty'
|
9
11
|
require_relative 'class_date'
|
@@ -20,6 +22,7 @@ module ADIWG
|
|
20
22
|
def initialize(xml, hResponseObj)
|
21
23
|
@xml = xml
|
22
24
|
@hResponseObj = hResponseObj
|
25
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
23
26
|
end
|
24
27
|
|
25
28
|
def writeXML(hCitation)
|
@@ -38,7 +41,7 @@ module ADIWG
|
|
38
41
|
# citation - title (required)
|
39
42
|
s = hCitation[:title]
|
40
43
|
if s.nil?
|
41
|
-
@
|
44
|
+
@NameSpace.issueWarning(1, 'gmd:title')
|
42
45
|
else
|
43
46
|
@xml.tag!('gmd:title') do
|
44
47
|
@xml.tag!('gco:CharacterString', s)
|
@@ -64,7 +67,7 @@ module ADIWG
|
|
64
67
|
end
|
65
68
|
end
|
66
69
|
if aDate.empty?
|
67
|
-
@
|
70
|
+
@NameSpace.issueWarning(2,'gmd:date')
|
68
71
|
end
|
69
72
|
|
70
73
|
# citation - edition
|