adiwg-mdtranslator 2.9.2 → 2.10.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 +30 -2
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +8 -8
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +179 -160
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +16 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_citation.rb +14 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +36 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_digitalForm.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_distribution.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityAttribute.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geologicAge.rb +6 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +58 -12
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +51 -12
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +46 -9
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalPlanar.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb +10 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_offlineOption.rb +16 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineOption.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb +9 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_pointVector.rb +21 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +8 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_publication.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +14 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_security.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_series.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +20 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +32 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +20 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/version.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +10 -10
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -16
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb +55 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb +85 -85
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_associatedResource.rb +91 -92
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attribute.rb +212 -212
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb +43 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_boundingBox.rb +11 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +17 -17
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +26 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +13 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +8 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb +77 -77
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +54 -54
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +35 -35
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb +70 -70
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +15 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distributor.rb +53 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_duration.rb +92 -91
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +10 -10
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +28 -18
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityForeignKey.rb +58 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb +52 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_extent.rb +70 -56
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_featureCollection.rb +64 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_funding.rb +9 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geoJson.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicExtent.rb +12 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +6 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geologicAge.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryCollection.rb +63 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryFeature.rb +84 -84
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryObject.rb +50 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryProperties.rb +57 -57
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +115 -100
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georeferenceableRepresentation.rb +85 -82
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb +78 -78
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gridRepresentation.rb +61 -56
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_identifier.rb +72 -72
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb +106 -107
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +55 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb +87 -83
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb +73 -74
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +11 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_measure.rb +56 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_medium.rb +88 -88
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +106 -105
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +4 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +7 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_onlineResource.rb +60 -61
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_party.rb +57 -57
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_phone.rb +49 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_processStep.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +31 -30
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +16 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_releasability.rb +53 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceUsage.rb +95 -95
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb +67 -67
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb +47 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb +68 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb +50 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb +38 -38
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +6 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb +77 -75
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +8 -14
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +71 -72
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +46 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +118 -116
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_temporalExtent.rb +48 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInstant.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInterval.rb +50 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +21 -14
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +86 -75
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorObject.rb +45 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb +45 -33
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +28 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb +59 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_voucher.rb +43 -43
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +6 -2
- data/lib/adiwg/mdtranslator/version.rb +9 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureConstraint.rb +50 -46
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +53 -43
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +58 -58
- data/lib/adiwg/mdtranslator.rb +177 -165
- data/lib/adiwg/mdtranslator_cli.rb +8 -3
- metadata +2 -2
@@ -37,8 +37,7 @@ module ADIWG
|
|
37
37
|
if paramCount == 4
|
38
38
|
return hProjection
|
39
39
|
else
|
40
|
-
hResponseObj[:readerExecutionMessages] << '
|
41
|
-
return nil
|
40
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Stereographic projection is missing one or more parameters'
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb
CHANGED
@@ -38,8 +38,7 @@ module ADIWG
|
|
38
38
|
if paramCount == 5
|
39
39
|
return hProjection
|
40
40
|
else
|
41
|
-
hResponseObj[:readerExecutionMessages] << '
|
42
|
-
return nil
|
41
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Transverse Mercator projection is missing one or more parameters'
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
@@ -32,8 +32,7 @@ module ADIWG
|
|
32
32
|
if paramCount == 3
|
33
33
|
return hProjection
|
34
34
|
else
|
35
|
-
hResponseObj[:readerExecutionMessages] << '
|
36
|
-
return nil
|
35
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Van Der Grinten projection is missing one or more parameters'
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
@@ -25,22 +25,28 @@ module ADIWG
|
|
25
25
|
intMetadataClass = InternalMetadata.new
|
26
26
|
hAttribute = intMetadataClass.newEntityAttribute
|
27
27
|
|
28
|
-
# entity attribute 5.1.2.1 (attrlabl) - attribute name
|
28
|
+
# entity attribute 5.1.2.1 (attrlabl) - attribute name (required)
|
29
29
|
# -> dataDictionary.entities.attributes.attributeCode
|
30
30
|
code = xAttribute.xpath('./attrlabl').text
|
31
31
|
unless code.empty?
|
32
32
|
hAttribute[:attributeName] = code
|
33
33
|
hAttribute[:attributeCode] = code
|
34
34
|
end
|
35
|
+
if code.empty?
|
36
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: attribute label is missing'
|
37
|
+
end
|
35
38
|
|
36
|
-
# entity attribute 5.1.2.2 (attrdef) - attribute definition
|
39
|
+
# entity attribute 5.1.2.2 (attrdef) - attribute definition (required)
|
37
40
|
# -> dataDictionary.entities.attributes.attributeDefinition
|
38
41
|
definition = xAttribute.xpath('./attrdef').text
|
39
42
|
unless definition.empty?
|
40
43
|
hAttribute[:attributeDefinition] = definition
|
41
44
|
end
|
45
|
+
if definition.empty?
|
46
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: attribute definition is missing'
|
47
|
+
end
|
42
48
|
|
43
|
-
# entity attribute 5.1.2.3 (attrdefs) - attribute definition source
|
49
|
+
# entity attribute 5.1.2.3 (attrdefs) - attribute definition source (required)
|
44
50
|
# -> dataDictionary.entities.attributes.attributeReference.title
|
45
51
|
reference = xAttribute.xpath('./attrdefs').text
|
46
52
|
unless reference.empty?
|
@@ -48,8 +54,11 @@ module ADIWG
|
|
48
54
|
hCitation[:title] = reference
|
49
55
|
hAttribute[:attributeReference] = hCitation
|
50
56
|
end
|
57
|
+
if reference.empty?
|
58
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: attribute reference source is missing'
|
59
|
+
end
|
51
60
|
|
52
|
-
# entity attribute 5.1.2.4 (attrdomv) - attribute domain value
|
61
|
+
# entity attribute 5.1.2.4 (attrdomv) - attribute domain value (required)
|
53
62
|
axDomain = xAttribute.xpath('./attrdomv')
|
54
63
|
unless axDomain.empty?
|
55
64
|
|
@@ -88,6 +97,9 @@ module ADIWG
|
|
88
97
|
end
|
89
98
|
|
90
99
|
end
|
100
|
+
if axDomain.empty?
|
101
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: attribute domain is missing'
|
102
|
+
end
|
91
103
|
|
92
104
|
# add domainId to attribute
|
93
105
|
# fgdc allows multiple domain definitions
|
@@ -46,28 +46,41 @@ module ADIWG
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
49
|
+
havePR = false
|
49
50
|
unless aContacts.empty?
|
50
51
|
hResponsibility = Responsibility.unpack(aContacts, 'originator', hResponseObj)
|
51
52
|
unless hResponsibility.nil?
|
52
53
|
hCitation[:responsibleParties] << hResponsibility
|
54
|
+
havePR = true
|
53
55
|
end
|
54
56
|
end
|
57
|
+
unless havePR
|
58
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: citation originator is missing'
|
59
|
+
end
|
55
60
|
|
56
|
-
# citation 8.2/8.3 (pubdate/pubtime) - publication date/time {date} (required) {time} (optional)
|
61
|
+
# citation 8.2/8.3 (pubdate/pubtime) - publication date/time {date} (required) - {time} (optional)
|
62
|
+
haveDate = false
|
57
63
|
pubDate = xCiteInfo.xpath('./pubdate').text
|
58
64
|
pubTime = xCiteInfo.xpath('./pubtime').text
|
59
65
|
unless pubDate.empty?
|
60
66
|
hDate = Date.unpack(pubDate, pubTime, 'publication', hResponseObj)
|
61
67
|
unless hDate.nil?
|
62
68
|
hCitation[:dates] << hDate
|
69
|
+
haveDate = true
|
63
70
|
end
|
64
71
|
end
|
72
|
+
unless haveDate
|
73
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: citation publication date is missing'
|
74
|
+
end
|
65
75
|
|
66
76
|
# citation 8.4 (title) - citation title (required)
|
67
77
|
title = xCiteInfo.xpath('./title').text
|
68
78
|
unless title.empty?
|
69
79
|
hCitation[:title] = title
|
70
80
|
end
|
81
|
+
if title.empty?
|
82
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: citation title is missing'
|
83
|
+
end
|
71
84
|
|
72
85
|
# citation 8.5 (edition) - edition
|
73
86
|
edition = xCiteInfo.xpath('./edition').text
|
@@ -32,14 +32,17 @@ module ADIWG
|
|
32
32
|
hDomain[:domainDescription] = 'FGDC codeSet domain'
|
33
33
|
|
34
34
|
|
35
|
-
# entity attribute 5.1.2.4.3.1 (codesetn) - codeset name
|
35
|
+
# entity attribute 5.1.2.4.3.1 (codesetn) - codeset name (required)
|
36
36
|
# -> dataDictionary.domains.commonName
|
37
37
|
name = xCodeSet.xpath('./codesetn').text
|
38
38
|
unless name.empty?
|
39
39
|
hDomain[:domainName] = name
|
40
40
|
end
|
41
|
+
if name.empty?
|
42
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: codeset domain name is missing'
|
43
|
+
end
|
41
44
|
|
42
|
-
# entity attribute 5.1.2.4.3.2 (codesets) - codeset source
|
45
|
+
# entity attribute 5.1.2.4.3.2 (codesets) - codeset source name (required)
|
43
46
|
# -> dataDictionary.domains.domainReference.title
|
44
47
|
hCitation = intMetadataClass.newCitation
|
45
48
|
title = xCodeSet.xpath('./codesets').text
|
@@ -47,6 +50,9 @@ module ADIWG
|
|
47
50
|
hCitation[:title] = title
|
48
51
|
hDomain[:domainReference] = hCitation
|
49
52
|
end
|
53
|
+
if title.empty?
|
54
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: codeset domain source is missing'
|
55
|
+
end
|
50
56
|
|
51
57
|
aDomains << hDomain
|
52
58
|
|
@@ -63,7 +63,6 @@ module ADIWG
|
|
63
63
|
# person primary 10.1.2 (cntorg) - name of organization
|
64
64
|
personName = xPerson.xpath('./cntper').text
|
65
65
|
orgName = xPerson.xpath('./cntorg').text
|
66
|
-
return nil if personName.empty?
|
67
66
|
|
68
67
|
end
|
69
68
|
|
@@ -76,10 +75,21 @@ module ADIWG
|
|
76
75
|
# organization primary 10.1.2 (cntorg) - name of organization
|
77
76
|
personName = xOrg.xpath('./cntper').text
|
78
77
|
orgName = xOrg.xpath('./cntorg').text
|
79
|
-
return nil if orgName.empty?
|
80
78
|
|
81
79
|
end
|
82
80
|
|
81
|
+
# error handling
|
82
|
+
if contactType.nil?
|
83
|
+
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: contact is neither person or organization'
|
84
|
+
return nil
|
85
|
+
end
|
86
|
+
if contactType == 'person' && personName == ''
|
87
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact person name is missing'
|
88
|
+
end
|
89
|
+
if contactType == 'organization' && orgName == ''
|
90
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact organization name is missing'
|
91
|
+
end
|
92
|
+
|
83
93
|
# add new contacts to contact array
|
84
94
|
unless contactType.nil?
|
85
95
|
personId = Fgdc.add_contact(personName, false) unless personName.empty?
|
@@ -106,15 +116,18 @@ module ADIWG
|
|
106
116
|
hContact[:positionName] = position
|
107
117
|
end
|
108
118
|
|
109
|
-
# contact 10.4 (cntaddr) - contact address []
|
119
|
+
# contact 10.4 (cntaddr) - contact address [] (required)
|
110
120
|
axAddress = xContactInfo.xpath('./cntaddr')
|
111
121
|
unless axAddress.empty?
|
112
122
|
axAddress.each do |xAddress|
|
113
123
|
hAddress = intMetadataClass.newAddress
|
114
124
|
|
115
|
-
# address 10.4.1 (addrtype) - address type
|
125
|
+
# address 10.4.1 (addrtype) - address type (required)
|
116
126
|
addType = xAddress.xpath('./addrtype').text
|
117
127
|
hAddress[:addressTypes] << addType unless addType.empty?
|
128
|
+
if addType.empty?
|
129
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact address type is missing'
|
130
|
+
end
|
118
131
|
|
119
132
|
# address 10.4.2 (address) - address lines []
|
120
133
|
axAddLines = xAddress.xpath('./address')
|
@@ -125,17 +138,26 @@ module ADIWG
|
|
125
138
|
end
|
126
139
|
end
|
127
140
|
|
128
|
-
# address 10.4.3 (city) - city
|
141
|
+
# address 10.4.3 (city) - city (required)
|
129
142
|
city = xAddress.xpath('./city').text
|
130
143
|
hAddress[:city] = city unless city.empty?
|
144
|
+
if city.empty?
|
145
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact address city is missing'
|
146
|
+
end
|
131
147
|
|
132
|
-
# address 10.4.4 (state) - state
|
148
|
+
# address 10.4.4 (state) - state (required)
|
133
149
|
state = xAddress.xpath('./state').text
|
134
150
|
hAddress[:adminArea] = state unless state.empty?
|
151
|
+
if state.empty?
|
152
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact address state is missing'
|
153
|
+
end
|
135
154
|
|
136
|
-
# address 10.4.5 (postal) - postal code
|
155
|
+
# address 10.4.5 (postal) - postal code (required)
|
137
156
|
postal = xAddress.xpath('./postal').text
|
138
157
|
hAddress[:postalCode] = postal unless postal.empty?
|
158
|
+
if postal.empty?
|
159
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact address zip code is missing'
|
160
|
+
end
|
139
161
|
|
140
162
|
# address 10.4.6 (country) - country
|
141
163
|
country = xAddress.xpath('./country').text
|
@@ -165,8 +187,11 @@ module ADIWG
|
|
165
187
|
|
166
188
|
end
|
167
189
|
end
|
190
|
+
if axAddress.empty?
|
191
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact address is missing'
|
192
|
+
end
|
168
193
|
|
169
|
-
# contact 10.5 (cntvoice) - contact voice phone number []
|
194
|
+
# contact 10.5 (cntvoice) - contact voice phone number [] (required)
|
170
195
|
axVoice = xContactInfo.xpath('./cntvoice')
|
171
196
|
unless axVoice.empty?
|
172
197
|
axVoice.each do |xPhone|
|
@@ -176,6 +201,9 @@ module ADIWG
|
|
176
201
|
end
|
177
202
|
end
|
178
203
|
end
|
204
|
+
if axVoice.empty?
|
205
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: contact voice phone is missing'
|
206
|
+
end
|
179
207
|
|
180
208
|
# contact 10.6 (cnttdd) - contact TDD/TTY phone number []
|
181
209
|
axTDD = xContactInfo.xpath('./cnttdd')
|
@@ -24,13 +24,13 @@ module ADIWG
|
|
24
24
|
hDate = intMetadataClass.newDate
|
25
25
|
|
26
26
|
if date.nil? || date == ''
|
27
|
-
hResponseObj[:readerExecutionMessages] << '
|
27
|
+
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: date missing from dateType creation'
|
28
28
|
hResponseObj[:readerExecutionPass] = false
|
29
29
|
return nil
|
30
30
|
end
|
31
31
|
|
32
32
|
if type.nil? || type == ''
|
33
|
-
hResponseObj[:readerExecutionMessages] << '
|
33
|
+
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: role missing from dateType creation'
|
34
34
|
hResponseObj[:readerExecutionPass] = false
|
35
35
|
return nil
|
36
36
|
end
|
@@ -23,7 +23,7 @@ module ADIWG
|
|
23
23
|
hDateTime = intMetadataClass.newDateTime
|
24
24
|
|
25
25
|
if date.nil? || date == ''
|
26
|
-
hResponseObj[:readerExecutionMessages] << '
|
26
|
+
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: date missing from dateTime creation'
|
27
27
|
hResponseObj[:readerExecutionPass] = false
|
28
28
|
return nil
|
29
29
|
end
|
@@ -87,7 +87,7 @@ module ADIWG
|
|
87
87
|
# if dateTimeFromString fails, [0] = nil; [1] = 'ERROR'
|
88
88
|
aDateTimeReturn = AdiwgDateTimeFun.dateTimeFromString(dtIn)
|
89
89
|
if aDateTimeReturn[1] == 'ERROR'
|
90
|
-
hResponseObj[:readerExecutionMessages] << '
|
90
|
+
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: Conversion of dateTime string to object failed'
|
91
91
|
hResponseObj[:readerExecutionPass] = false
|
92
92
|
return nil
|
93
93
|
end
|
@@ -24,13 +24,16 @@ module ADIWG
|
|
24
24
|
intMetadataClass = InternalMetadata.new
|
25
25
|
hTransfer = intMetadataClass.newTransferOption
|
26
26
|
|
27
|
-
# distribution 6.4.2.1 (digtinfo) - digital transfer information
|
27
|
+
# distribution 6.4.2.1 (digtinfo) - digital transfer information (required)
|
28
28
|
xTranInfo = xDigiForm.xpath('./digtinfo')
|
29
29
|
unless xTranInfo.empty?
|
30
30
|
TransferInfo.unpack(xTranInfo, hTransfer, techPre, hResponseObj)
|
31
31
|
end
|
32
|
+
if xTranInfo.empty?
|
33
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: order process transfer info is missing'
|
34
|
+
end
|
32
35
|
|
33
|
-
# distribution 6.4.2.2 (digtopt) - digital transfer option
|
36
|
+
# distribution 6.4.2.2 (digtopt) - digital transfer option (required)
|
34
37
|
xDigiOption = xDigiForm.xpath('./digtopt')
|
35
38
|
unless xDigiOption.empty?
|
36
39
|
|
@@ -57,6 +60,9 @@ module ADIWG
|
|
57
60
|
end
|
58
61
|
|
59
62
|
end
|
63
|
+
if xDigiOption.empty?
|
64
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: order process transfer option is missing'
|
65
|
+
end
|
60
66
|
|
61
67
|
return hTransfer
|
62
68
|
|
@@ -25,7 +25,7 @@ module ADIWG
|
|
25
25
|
hDistribution = intMetadataClass.newDistribution
|
26
26
|
hDistributor = intMetadataClass.newDistributor
|
27
27
|
|
28
|
-
# distribution 6.1 (distrib) - distributor {contact}
|
28
|
+
# distribution 6.1 (distrib) - distributor {contact} (required)
|
29
29
|
# -> distribution.distributor.contact.responsibility(distributor)
|
30
30
|
xContact = xDistribution.xpath('./distrib')
|
31
31
|
unless xContact.empty?
|
@@ -35,6 +35,9 @@ module ADIWG
|
|
35
35
|
hDistributor[:contact] = hResponsibility
|
36
36
|
end
|
37
37
|
end
|
38
|
+
if xContact.empty?
|
39
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: distribution distributor is missing'
|
40
|
+
end
|
38
41
|
|
39
42
|
# distribution 6.2 (resdesc) - resource description
|
40
43
|
# -> distribution.description
|
@@ -43,12 +46,15 @@ module ADIWG
|
|
43
46
|
hDistribution[:description] = description
|
44
47
|
end
|
45
48
|
|
46
|
-
# distribution 6.3 (distliab) - distribution liability
|
49
|
+
# distribution 6.3 (distliab) - distribution liability (required)
|
47
50
|
# -> distribution.liabilityStatement
|
48
51
|
liability = xDistribution.xpath('./distliab').text
|
49
52
|
unless liability.empty?
|
50
53
|
hDistribution[:liabilityStatement] = liability
|
51
54
|
end
|
55
|
+
if liability.empty?
|
56
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: distribution liability is missing'
|
57
|
+
end
|
52
58
|
|
53
59
|
# distribution 6.6 (techpreq) - technical prerequisites
|
54
60
|
# -> distribution.distributor[all].transferOption[all].distributionFormat[all].technicalPrerequisite
|
@@ -32,21 +32,27 @@ module ADIWG
|
|
32
32
|
hEntity = intMetadataClass.newEntity
|
33
33
|
hEntity[:entityId] = UUIDTools::UUID.random_create.to_s
|
34
34
|
|
35
|
-
# entity attribute 5.1.1.1 (enttypl) - entity name
|
35
|
+
# entity attribute 5.1.1.1 (enttypl) - entity name (required)
|
36
36
|
# -> dataDictionary.entities.entityCode
|
37
37
|
code = xEntity.xpath('./enttypl').text
|
38
38
|
unless code.empty?
|
39
39
|
hEntity[:entityCode] = code
|
40
40
|
end
|
41
|
+
if code.empty?
|
42
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: entity type name is missing'
|
43
|
+
end
|
41
44
|
|
42
|
-
# entity attribute 5.1.1.2 (enttypd) - entity definition
|
45
|
+
# entity attribute 5.1.1.2 (enttypd) - entity definition (required)
|
43
46
|
# -> dataDictionary.entities.entityDefinition
|
44
47
|
definition = xEntity.xpath('./enttypd').text
|
45
48
|
unless definition.empty?
|
46
49
|
hEntity[:entityDefinition] = definition
|
47
50
|
end
|
51
|
+
if definition.empty?
|
52
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: entity type definition is missing'
|
53
|
+
end
|
48
54
|
|
49
|
-
# entity attribute 5.1.1.3 (enttypds) - entity definition source
|
55
|
+
# entity attribute 5.1.1.3 (enttypds) - entity definition source (required)
|
50
56
|
# -> dataDictionary.entities.entityReference.title
|
51
57
|
reference = xEntity.xpath('./enttypds').text
|
52
58
|
unless reference.empty?
|
@@ -54,6 +60,9 @@ module ADIWG
|
|
54
60
|
hCitation[:title] = reference
|
55
61
|
hEntity[:entityReferences] << hCitation
|
56
62
|
end
|
63
|
+
if reference.empty?
|
64
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: entity type definition source is missing'
|
65
|
+
end
|
57
66
|
|
58
67
|
# entity attribute 5.1.2 (attr) - characteristics of an attribute
|
59
68
|
axAttribute = xDetail.xpath('./attr')
|
@@ -24,12 +24,15 @@ module ADIWG
|
|
24
24
|
hEntity[:entityName] = 'Entity Overview'
|
25
25
|
hEntity[:entityCode] = 'overview'
|
26
26
|
|
27
|
-
# entity attribute 5.2.1 (eaover) - entity attribute overview
|
27
|
+
# entity attribute 5.2.1 (eaover) - entity attribute overview (required)
|
28
28
|
# -> dataDictionary.entities.entityDefinition
|
29
29
|
definition = xOverview.xpath('./eaover').text
|
30
30
|
unless definition.empty?
|
31
31
|
hEntity[:entityDefinition] = definition
|
32
32
|
end
|
33
|
+
if definition.empty?
|
34
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: entityAttribute overview definition is missing'
|
35
|
+
end
|
33
36
|
|
34
37
|
# entity attribute 5.2.2 (eadetcit) - entity attribute detail citation []
|
35
38
|
# -> dataDictionary.entities.entityReference.title
|
@@ -32,28 +32,37 @@ module ADIWG
|
|
32
32
|
axValues.each do |xValue|
|
33
33
|
hItem = intMetadataClass.newDomainItem
|
34
34
|
|
35
|
-
# entity attribute 5.1.2.4.1.1 (edomv) - enumerated domain value
|
35
|
+
# entity attribute 5.1.2.4.1.1 (edomv) - enumerated domain value (required)
|
36
36
|
# -> dataDictionary.domainItems.itemValue
|
37
37
|
value = xValue.xpath('./edomv').text
|
38
38
|
unless value.empty?
|
39
39
|
hItem[:itemName] = value
|
40
40
|
hItem[:itemValue] = value
|
41
41
|
end
|
42
|
+
if value.empty?
|
43
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: enumerated domain value is missing'
|
44
|
+
end
|
42
45
|
|
43
|
-
# entity attribute 5.1.2.4.1.2 (edomvd) - enumerated domain value definition
|
46
|
+
# entity attribute 5.1.2.4.1.2 (edomvd) - enumerated domain value definition (required)
|
44
47
|
# -> dataDictionary.domainItems.itemDefinition
|
45
48
|
definition = xValue.xpath('./edomvd').text
|
46
49
|
unless definition.empty?
|
47
50
|
hItem[:itemDefinition] = definition
|
48
51
|
end
|
52
|
+
if definition.empty?
|
53
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: enumerated domain value definition is missing'
|
54
|
+
end
|
49
55
|
|
50
|
-
# entity attribute 5.1.2.4.1.3 (edomvds) - enumerated domain value definition source
|
56
|
+
# entity attribute 5.1.2.4.1.3 (edomvds) - enumerated domain value definition source (required)
|
51
57
|
source = xValue.xpath('./edomvds').text
|
52
58
|
unless source.empty?
|
53
59
|
hCitation = intMetadataClass.newCitation
|
54
60
|
hCitation[:title] = source
|
55
61
|
hItem[:itemReference] = hCitation
|
56
62
|
end
|
63
|
+
if source.empty?
|
64
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: enumerated domain value definition source is missing'
|
65
|
+
end
|
57
66
|
|
58
67
|
hDomain[:domainItems] << hItem
|
59
68
|
|
@@ -53,7 +53,7 @@ module ADIWG
|
|
53
53
|
Identification.unpack(xIdInfo, intObj, hResponseObj)
|
54
54
|
end
|
55
55
|
if xIdInfo.empty?
|
56
|
-
hResponseObj[:readerExecutionMessages] << 'FGDC
|
56
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: identification information section (idinfo) missing'
|
57
57
|
end
|
58
58
|
|
59
59
|
# metadata (dataqual 2) - data quality
|
@@ -103,7 +103,7 @@ module ADIWG
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
if xMetaInfo.empty?
|
106
|
-
hResponseObj[:readerExecutionMessages] << 'FGDC
|
106
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: metadata information section (metainfo) missing'
|
107
107
|
end
|
108
108
|
|
109
109
|
return intObj
|
@@ -14,7 +14,7 @@ module ADIWG
|
|
14
14
|
|
15
15
|
module GeodeticReference
|
16
16
|
|
17
|
-
def self.unpack(xHorizontalRef)
|
17
|
+
def self.unpack(xHorizontalRef, hResponseObj)
|
18
18
|
|
19
19
|
# instance classes needed in script
|
20
20
|
intMetadataClass = InternalMetadata.new
|
@@ -29,19 +29,25 @@ module ADIWG
|
|
29
29
|
hGeodetic[:datumName] = datumName
|
30
30
|
end
|
31
31
|
|
32
|
-
# geodetic model 4.1.4.2 (ellips) - ellipsoid name
|
32
|
+
# geodetic model 4.1.4.2 (ellips) - ellipsoid name (required)
|
33
33
|
# -> referenceSystemParameters.geodetic.ellipsoidName
|
34
34
|
ellipsoidName = xGeodetic.xpath('./ellips').text
|
35
35
|
unless ellipsoidName.empty?
|
36
36
|
hGeodetic[:ellipsoidName] = ellipsoidName
|
37
37
|
end
|
38
|
+
if ellipsoidName.empty?
|
39
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference ellipsoid name is missing'
|
40
|
+
end
|
38
41
|
|
39
|
-
# geodetic model 4.1.4.3 (semiaxis) - semi-major axis
|
42
|
+
# geodetic model 4.1.4.3 (semiaxis) - semi-major axis (required)
|
40
43
|
# -> referenceSystemParameters.geodetic.semiMajorAxis
|
41
44
|
semiAxis = xGeodetic.xpath('./semiaxis').text
|
42
45
|
unless semiAxis.empty?
|
43
46
|
hGeodetic[:semiMajorAxis] = semiAxis.to_f
|
44
47
|
end
|
48
|
+
if semiAxis.empty?
|
49
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference semi-major axis is missing'
|
50
|
+
end
|
45
51
|
|
46
52
|
# geodetic model 4.1.2.4.4 (plandu) - distance units
|
47
53
|
# take value from the first 'planar' section with 'plandu' specified
|
@@ -58,12 +64,15 @@ module ADIWG
|
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
61
|
-
# geodetic model 4.1.4.4 (denflat) - denominator of flattening ratio
|
67
|
+
# geodetic model 4.1.4.4 (denflat) - denominator of flattening ratio (required)
|
62
68
|
# -> referenceSystemParameters.geodetic.denominatorOfFlatteningRatio
|
63
69
|
flattening = xGeodetic.xpath('./denflat').text
|
64
70
|
unless flattening.empty?
|
65
71
|
hGeodetic[:denominatorOfFlatteningRatio] = flattening.to_f
|
66
72
|
end
|
73
|
+
if flattening.empty?
|
74
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference flattening ratio is missing'
|
75
|
+
end
|
67
76
|
|
68
77
|
hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
|
69
78
|
hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
|
@@ -14,7 +14,7 @@ module ADIWG
|
|
14
14
|
|
15
15
|
module GeographicResolution
|
16
16
|
|
17
|
-
def self.unpack(xGeographic)
|
17
|
+
def self.unpack(xGeographic, hResponseObj)
|
18
18
|
|
19
19
|
# instance classes needed in script
|
20
20
|
intMetadataClass = InternalMetadata.new
|
@@ -22,26 +22,35 @@ module ADIWG
|
|
22
22
|
hResolution = intMetadataClass.newSpatialResolution
|
23
23
|
hGeoResolution = intMetadataClass.newGeographicResolution
|
24
24
|
|
25
|
-
# geographic reference 4.1.1.1 (latres) - latitude resolution
|
25
|
+
# geographic reference 4.1.1.1 (latres) - latitude resolution (required)
|
26
26
|
# -> spatialResolution.geographicResolution.latitudeResolution
|
27
27
|
latResolution = xGeographic.xpath('./latres').text
|
28
28
|
unless latResolution.empty?
|
29
29
|
hGeoResolution[:latitudeResolution] = latResolution.to_f
|
30
30
|
end
|
31
|
+
if latResolution.empty?
|
32
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic latitude resolution is missing'
|
33
|
+
end
|
31
34
|
|
32
|
-
# geographic reference 4.1.1.2 (longres) - longitude resolution
|
35
|
+
# geographic reference 4.1.1.2 (longres) - longitude resolution (required)
|
33
36
|
# -> spatialResolution.geographicResolution.longitudeResolution
|
34
37
|
longResolution = xGeographic.xpath('./longres').text
|
35
38
|
unless longResolution.empty?
|
36
39
|
hGeoResolution[:longitudeResolution] = longResolution.to_f
|
37
40
|
end
|
41
|
+
if longResolution.empty?
|
42
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic longitude resolution is missing'
|
43
|
+
end
|
38
44
|
|
39
|
-
# geographic reference 4.1.1.3 (geogunit) - latitude/longitude units
|
45
|
+
# geographic reference 4.1.1.3 (geogunit) - latitude/longitude units (required)
|
40
46
|
# -> spatialResolution.geographicResolution.unitOfMeasure
|
41
47
|
unitMeasure = xGeographic.xpath('./geogunit').text
|
42
48
|
unless unitMeasure.empty?
|
43
49
|
hGeoResolution[:unitOfMeasure] = unitMeasure
|
44
50
|
end
|
51
|
+
if unitMeasure.empty?
|
52
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic latitude/longitude units are missing'
|
53
|
+
end
|
45
54
|
|
46
55
|
hResolution[:geographicResolution] = hGeoResolution
|
47
56
|
|
@@ -26,12 +26,18 @@ module ADIWG
|
|
26
26
|
unless scale.empty?
|
27
27
|
intGeoAge[:ageTimeScale] = scale
|
28
28
|
end
|
29
|
+
if scale.empty?
|
30
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO geologic age time scale is missing'
|
31
|
+
end
|
29
32
|
|
30
33
|
# geologic age bio (geolest) - age estimate (required)
|
31
34
|
estimate = xGeoAge.xpath('./geolest').text
|
32
35
|
unless estimate.empty?
|
33
36
|
intGeoAge[:ageEstimate] = estimate
|
34
37
|
end
|
38
|
+
if estimate.empty?
|
39
|
+
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO geologic age estimate is missing'
|
40
|
+
end
|
35
41
|
|
36
42
|
# geologic age bio (geolun) - age estimate uncertainty
|
37
43
|
uncertain = xGeoAge.xpath('./geolun').text
|