adiwg-mdtranslator 0.10.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/Rakefile +4 -1
- data/adiwg-mdtranslator.gemspec +10 -8
- data/bin/mdtranslator +8 -2
- data/lib/adiwg/mdtranslator.rb +72 -147
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +538 -538
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +78 -78
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +153 -74
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +41 -108
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_additionalDocumentation.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_address.rb +89 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_associatedResource.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_boundingBox.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_citation.rb +122 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_contacts.rb +150 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_coordinates.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataDictionary.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataQuality.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dateTime.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_descriptiveKeyword.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dictionaryInfo.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_distributionInfo.rb +161 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domain.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domainItem.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entity.rb +103 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityAttribute.rb +102 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityForeignKey.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityIndex.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_extent.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoCoordSystem.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoProperties.rb +100 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geographicElement.rb +179 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_legalConstraint.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineString.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_mdJson.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadata.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataExtension.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataInfo.rb +123 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_onlineResource.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_phone.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_point.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_polygon.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_processStep.rb +75 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resolution.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb +46 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceIdentifier.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceInfo.rb +328 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceMaintenance.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceSpecificUsage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_responsibleParty.rb +48 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_securityConstraint.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_source.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_spatialReference.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonClass.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonomy.rb +94 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_temporalElement.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timeInstant.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timePeriod.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_verticalElement.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb +49 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/validator.rb +43 -0
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +55 -0
- data/lib/adiwg/mdtranslator/version.rb +15 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_address.rb +107 -86
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +68 -57
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_browseGraphic.rb +57 -46
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +149 -138
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +83 -72
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +334 -322
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +46 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +47 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +42 -31
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +29 -18
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +87 -76
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +113 -102
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +44 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +121 -110
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb +45 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +45 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicBoundingBox.rb +78 -67
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +41 -30
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +58 -49
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +65 -54
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineString.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +62 -51
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +54 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +154 -143
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +138 -127
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +37 -26
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +79 -68
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_point.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_polygon.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +80 -69
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +38 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_resolution.rb +51 -40
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +88 -77
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb +75 -63
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonClassification.rb +55 -44
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_telephone.rb +73 -62
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timeInstant.rb +36 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb +42 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_useConstraints.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_verticalExtent.rb +52 -41
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +39 -28
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +82 -47
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +42 -24
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +56 -34
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +34 -19
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +46 -27
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +55 -36
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +44 -26
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +68 -38
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +32 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +42 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +58 -31
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +44 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +47 -32
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +52 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +58 -35
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +43 -30
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +51 -44
- data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +56 -45
- data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +23 -12
- data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +223 -212
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +174 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +41 -12
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +347 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +151 -119
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +63 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_additionalDocumentation.rb +84 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_address.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_associatedResource.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb +66 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_citation.rb +115 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_contact.rb +137 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_onlineResource.rb +47 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_phone.rb +128 -0
- data/test/readers/mdJson/v0_9/tc_translation.rb +82 -0
- data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +222 -0
- metadata +87 -60
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_additionalDocumentation.rb +0 -36
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_address.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_associatedResource.rb +0 -66
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_boundingBox.rb +0 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_browseGraphic.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_citation.rb +0 -104
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_contacts.rb +0 -121
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_coordinates.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataQuality.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dateTime.rb +0 -27
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_descriptiveKeyword.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_distributionInfo.rb +0 -150
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +0 -92
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +0 -91
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_extent.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb +0 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoProperties.rb +0 -89
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geographicElement.rb +0 -168
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_legalConstraint.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineString.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadata.rb +0 -77
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataExtension.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataInfo.rb +0 -112
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_onlineResource.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_phone.rb +0 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_point.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_polygon.rb +0 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_processStep.rb +0 -64
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resolution.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceFormat.rb +0 -35
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceIdentifier.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceInfo.rb +0 -317
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceMaintenance.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceSpecificUsage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_responsibleParty.rb +0 -37
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_securityConstraint.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_source.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_spatialReference.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonClass.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonomy.rb +0 -83
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_temporalElement.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timeInstant.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timePeriod.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_verticalElement.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_voucher.rb +0 -38
- data/lib/adiwg/mdtranslator/validator.rb +0 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +0 -171
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_MImetadata.rb +0 -333
- data/test/tc_translation.rb +0 -73
@@ -3,118 +3,129 @@
|
|
3
3
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-02 original script
|
6
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
6
7
|
|
7
8
|
require 'class_featureConstraint'
|
8
9
|
require 'class_featureAttribute'
|
9
10
|
|
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
|
-
|
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
|
-
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso
|
15
|
+
|
16
|
+
class FC_FeatureType
|
17
|
+
|
18
|
+
def initialize(xml)
|
19
|
+
@xml = xml
|
20
|
+
end
|
21
|
+
|
22
|
+
def writeXML(hEntity)
|
23
|
+
|
24
|
+
# classes used
|
25
|
+
fConClass = $WriterNS::FC_Constraint.new(@xml)
|
26
|
+
fAttClass = $WriterNS::FC_FeatureAttribute.new(@xml)
|
27
|
+
|
28
|
+
# create and identity for the entity
|
29
|
+
$idCount = $idCount.succ
|
30
|
+
entityID = 'entity' + $idCount
|
31
|
+
@xml.tag!('gfc:FC_FeatureType', {'id' => entityID}) do
|
32
|
+
|
33
|
+
# feature type - type name - required
|
34
|
+
# use entity common name
|
35
|
+
s = hEntity[:entityName]
|
36
|
+
if !s.nil?
|
37
|
+
@xml.tag!('gfc:typeName') do
|
38
|
+
@xml.tag!('gco:LocalName', s)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
@xml.tag!('gfc:typeName', {'gco:nilReason' => 'missing'})
|
42
|
+
end
|
43
|
+
|
44
|
+
# feature type - definition
|
45
|
+
s = hEntity[:entityDefinition]
|
46
|
+
if !s.nil?
|
47
|
+
@xml.tag!('gfc:definition') do
|
48
|
+
@xml.tag!('gco:CharacterString', s)
|
49
|
+
end
|
50
|
+
elsif $showAllTags
|
51
|
+
@xml.tag!('gfc:definition')
|
52
|
+
end
|
53
|
+
|
54
|
+
# feature type - code
|
55
|
+
# use entity code name
|
56
|
+
s = hEntity[:entityCode]
|
57
|
+
if !s.nil?
|
58
|
+
@xml.tag!('gfc:code') do
|
59
|
+
@xml.tag!('gco:CharacterString', s)
|
60
|
+
end
|
61
|
+
elsif $showAllTags
|
62
|
+
@xml.tag!('gfc:code')
|
63
|
+
end
|
64
|
+
|
65
|
+
# feature type - isAbstract - required
|
66
|
+
# defaulted to false, value not available in internal object
|
67
|
+
@xml.tag!('gfc:isAbstract') do
|
68
|
+
@xml.tag!('gco:Boolean', 'false')
|
69
|
+
end
|
70
|
+
|
71
|
+
# feature type - feature catalogue - required
|
72
|
+
# 'role that links this feature type to the feature catalogue that contains it'
|
73
|
+
# confusing, allow definition of another feature catalogue here
|
74
|
+
# just set to nilReason = 'inapplicable' (recommended by NOAA)
|
75
|
+
@xml.tag!('gfc:featureCatalogue', {'gco:nilReason' => 'inapplicable'})
|
76
|
+
|
77
|
+
# feature type - constrained by
|
78
|
+
# use to define primary key, foreign keys, and indexes
|
79
|
+
# pass primary key
|
80
|
+
aPKs = hEntity[:primaryKey]
|
81
|
+
if !aPKs.empty?
|
82
|
+
@xml.tag!('gfc:constrainedBy') do
|
83
|
+
fConClass.writeXML('pk', aPKs)
|
84
|
+
end
|
85
|
+
elsif $showAllTags
|
86
|
+
@xml.tag!('gfc:constrainedBy')
|
87
|
+
end
|
88
|
+
|
89
|
+
# pass indexes
|
90
|
+
aIndexes = hEntity[:indexes]
|
91
|
+
if !aIndexes.empty?
|
92
|
+
aIndexes.each do |hIndex|
|
93
|
+
@xml.tag!('gfc:constrainedBy') do
|
94
|
+
fConClass.writeXML('index', hIndex)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# pass foreign keys
|
100
|
+
aFKs = hEntity[:foreignKeys]
|
101
|
+
if !aFKs.empty?
|
102
|
+
aFKs.each do |hFK|
|
103
|
+
@xml.tag!('gfc:constrainedBy') do
|
104
|
+
fConClass.writeXML('fk', hFK)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# feature type - character of characteristics
|
110
|
+
# used to define entity attributes
|
111
|
+
aAttributes = hEntity[:attributes]
|
112
|
+
if !aAttributes.empty?
|
113
|
+
aAttributes.each do |hAttribute|
|
114
|
+
@xml.tag!('gfc:carrierOfCharacteristics') do
|
115
|
+
fAttClass.writeXML(hAttribute)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
elsif $showAllTags
|
119
|
+
@xml.tag!('gfc:carrierOfCharacteristics')
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
120
131
|
end
|
@@ -3,38 +3,49 @@
|
|
3
3
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-08-26 original script
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
6
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso
|
12
|
+
|
13
|
+
class MD_Format
|
14
|
+
|
15
|
+
def initialize(xml)
|
16
|
+
@xml = xml
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(rFormat)
|
20
|
+
|
21
|
+
@xml.tag!('gmd:MD_Format') do
|
22
|
+
|
23
|
+
# format - name - required
|
24
|
+
s = rFormat[:formatName]
|
25
|
+
if s.nil?
|
26
|
+
@xml.tag!('gmd:name', {'gco:nilReason' => 'missing'})
|
27
|
+
else
|
28
|
+
@xml.tag!('gmd:name') do
|
29
|
+
@xml.tag!('gco:CharacterString', s)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# format - version - required
|
34
|
+
s = rFormat[:formatVersion]
|
35
|
+
if s.nil?
|
36
|
+
@xml.tag!('gmd:version', {'gco:nilReason' => 'unknown'})
|
37
|
+
else
|
38
|
+
@xml.tag!('gmd:version') do
|
39
|
+
@xml.tag!('gco:CharacterString', s)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
40
51
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# ISO <<Class>> GenericMetaData
|
2
2
|
# writer output in XML
|
3
3
|
# generic metadata only supports ...
|
4
|
-
|
5
|
-
|
4
|
+
# time instant
|
5
|
+
# time period
|
6
6
|
|
7
7
|
# History:
|
8
8
|
# Stan Smith 2013-11-04 original script
|
@@ -10,56 +10,65 @@
|
|
10
10
|
# ... use replaced by creating new geographic extents for geometries
|
11
11
|
# ... containing supplemental identifier, temporal, and vertical information
|
12
12
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
13
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
13
14
|
|
14
15
|
require 'module_dateTimeFun'
|
15
16
|
require 'class_timeInstant'
|
16
17
|
require 'class_timePeriod'
|
17
18
|
|
18
|
-
|
19
|
+
module ADIWG
|
20
|
+
module Mdtranslator
|
21
|
+
module Writers
|
22
|
+
module Iso
|
19
23
|
|
20
|
-
|
21
|
-
@xml = xml
|
22
|
-
end
|
24
|
+
class GenericMetaData
|
23
25
|
|
24
|
-
|
26
|
+
def initialize(xml)
|
27
|
+
@xml = xml
|
28
|
+
end
|
25
29
|
|
26
|
-
|
27
|
-
timeIClass = TimeInstant.new(@xml)
|
28
|
-
timePClass = TimePeriod.new(@xml)
|
30
|
+
def writeXML(aTempExt)
|
29
31
|
|
30
|
-
|
32
|
+
# classes used
|
33
|
+
timeIClass = $WriterNS::TimeInstant.new(@xml)
|
34
|
+
timePClass = $WriterNS::TimePeriod.new(@xml)
|
31
35
|
|
32
|
-
|
36
|
+
@xml.tag!('gml:GenericMetaData') do
|
33
37
|
|
34
|
-
|
35
|
-
hTimeD = hTempExt[:date]
|
36
|
-
unless hTimeD.empty?
|
37
|
-
date = hTimeD[:dateTime]
|
38
|
-
dateResolution = hTimeD[:dateResolution]
|
39
|
-
s = AdiwgDateTimeFun.stringDateFromDateTime(date, dateResolution)
|
40
|
-
if s != 'ERROR'
|
41
|
-
@xml.tag!('gco:Date', s)
|
42
|
-
end
|
43
|
-
end
|
38
|
+
aTempExt.each do |hTempExt|
|
44
39
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
# metadata - data
|
41
|
+
hTimeD = hTempExt[:date]
|
42
|
+
unless hTimeD.empty?
|
43
|
+
date = hTimeD[:dateTime]
|
44
|
+
dateResolution = hTimeD[:dateResolution]
|
45
|
+
s = AdiwgDateTimeFun.stringDateFromDateTime(date, dateResolution)
|
46
|
+
if s != 'ERROR'
|
47
|
+
@xml.tag!('gco:Date', s)
|
48
|
+
end
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
# metadata - time instant
|
52
|
+
hTimeI = hTempExt[:timeInstant]
|
53
|
+
unless hTimeI.empty?
|
54
|
+
timeIClass.writeXML(hTimeI)
|
55
|
+
end
|
56
56
|
|
57
|
-
|
57
|
+
# metadata - time period
|
58
|
+
hTimeP = hTempExt[:timePeriod]
|
59
|
+
unless hTimeP.empty?
|
60
|
+
timePClass.writeXML(hTimeP)
|
61
|
+
end
|
58
62
|
|
59
|
-
|
63
|
+
end
|
60
64
|
|
61
|
-
|
65
|
+
end
|
62
66
|
|
63
|
-
end
|
67
|
+
end
|
64
68
|
|
69
|
+
end
|
65
70
|
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -4,71 +4,82 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-11-01 original script
|
6
6
|
# Stan Smith 2014-05-30 hElement attributes changed for version 0.5.0
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Iso
|
13
|
+
|
14
|
+
class EX_GeographicBoundingBox
|
15
|
+
|
16
|
+
def initialize(xml)
|
17
|
+
@xml = xml
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(hElement)
|
21
|
+
|
22
|
+
extentType = hElement[:elementIncludeData]
|
23
|
+
hBBox = hElement[:elementGeometry][:geometry]
|
24
|
+
|
25
|
+
@xml.tag!('gmd:EX_GeographicBoundingBox') do
|
26
|
+
|
27
|
+
# bounding box - extent type - required
|
28
|
+
if extentType.nil?
|
29
|
+
@xml.tag!('gmd:extentTypeCode', {'gco:nilReason' => 'missing'})
|
30
|
+
else
|
31
|
+
@xml.tag!('gmd:extentTypeCode') do
|
32
|
+
@xml.tag!('gco:Boolean', extentType)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# bounding box - west longitude - required
|
37
|
+
s = hBBox[:westLong]
|
38
|
+
if s.nil?
|
39
|
+
@xml.tag!('gmd:westBoundLongitude', {'gco:nilReason' => 'missing'})
|
40
|
+
else
|
41
|
+
@xml.tag!('gmd:westBoundLongitude') do
|
42
|
+
@xml.tag!('gco:Decimal', s)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# bounding box - east longitude - required
|
47
|
+
s = hBBox[:eastLong]
|
48
|
+
if s.nil?
|
49
|
+
@xml.tag!('gmd:eastBoundLongitude', {'gco:nilReason' => 'missing'})
|
50
|
+
else
|
51
|
+
@xml.tag!('gmd:eastBoundLongitude') do
|
52
|
+
@xml.tag!('gco:Decimal', s)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# bounding box - south latitude - required
|
57
|
+
s = hBBox[:southLat]
|
58
|
+
if s.nil?
|
59
|
+
@xml.tag!('gmd:southBoundLatitude', {'gco:nilReason' => 'missing'})
|
60
|
+
else
|
61
|
+
@xml.tag!('gmd:southBoundLatitude') do
|
62
|
+
@xml.tag!('gco:Decimal', s)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# bounding box - north latitude - required
|
67
|
+
s = hBBox[:northLat]
|
68
|
+
if s.nil?
|
69
|
+
@xml.tag!('gmd:northBoundLatitude', {'gco:nilReason' => 'missing'})
|
70
|
+
else
|
71
|
+
@xml.tag!('gmd:northBoundLatitude') do
|
72
|
+
@xml.tag!('gco:Decimal', s)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|