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
@@ -1,46 +1,69 @@
|
|
1
1
|
# ISO <<CodeLists>> gmd:MD_ScopeCode
|
2
2
|
|
3
|
-
# from http://
|
3
|
+
# from http://mdtranslator.herokuapp.com/api/codelists?format=xml
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-08-09 original script
|
6
6
|
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
+
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
def writeXML(codeName)
|
14
|
-
case(codeName)
|
15
|
-
when 'attribute' then codeID = '001'
|
16
|
-
when 'attributeType' then codeID = '002'
|
17
|
-
when 'collectionHardware' then codeID = '003'
|
18
|
-
when 'collectionSession' then codeID = '004'
|
19
|
-
when 'dataset' then codeID = '005'
|
20
|
-
when 'series' then codeID = '006'
|
21
|
-
when 'nonGeographicDataset' then codeID = '007'
|
22
|
-
when 'dimensionGroup' then codeID = '008'
|
23
|
-
when 'feature' then codeID = '009'
|
24
|
-
when 'featureType' then codeID = '010'
|
25
|
-
when 'propertyType' then codeID = '011'
|
26
|
-
when 'fieldSession' then codeID = '012'
|
27
|
-
when 'software' then codeID = '013'
|
28
|
-
when 'service' then codeID = '014'
|
29
|
-
when 'model' then codeID = '015'
|
30
|
-
when 'tile' then codeID = '016'
|
31
|
-
else
|
32
|
-
codeID = 'non-ISO codeName'
|
33
|
-
end
|
34
|
-
|
35
|
-
# write xml
|
36
|
-
@xml.tag!('gmd:MD_ScopeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode',
|
37
|
-
:codeListValue=>"#{codeName}",
|
38
|
-
:codeSpace=>"#{codeID}"})
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso
|
42
14
|
|
15
|
+
class MD_ScopeCode
|
16
|
+
def initialize(xml)
|
17
|
+
@xml = xml
|
18
|
+
end
|
43
19
|
|
20
|
+
def writeXML(codeName)
|
21
|
+
case (codeName)
|
22
|
+
when 'attribute' then
|
23
|
+
codeID = '001'
|
24
|
+
when 'attributeType' then
|
25
|
+
codeID = '002'
|
26
|
+
when 'collectionHardware' then
|
27
|
+
codeID = '003'
|
28
|
+
when 'collectionSession' then
|
29
|
+
codeID = '004'
|
30
|
+
when 'dataset' then
|
31
|
+
codeID = '005'
|
32
|
+
when 'series' then
|
33
|
+
codeID = '006'
|
34
|
+
when 'nonGeographicDataset' then
|
35
|
+
codeID = '007'
|
36
|
+
when 'dimensionGroup' then
|
37
|
+
codeID = '008'
|
38
|
+
when 'feature' then
|
39
|
+
codeID = '009'
|
40
|
+
when 'featureType' then
|
41
|
+
codeID = '010'
|
42
|
+
when 'propertyType' then
|
43
|
+
codeID = '011'
|
44
|
+
when 'fieldSession' then
|
45
|
+
codeID = '012'
|
46
|
+
when 'software' then
|
47
|
+
codeID = '013'
|
48
|
+
when 'service' then
|
49
|
+
codeID = '014'
|
50
|
+
when 'model' then
|
51
|
+
codeID = '015'
|
52
|
+
when 'tile' then
|
53
|
+
codeID = '016'
|
54
|
+
else
|
55
|
+
codeID = 'non-ISO codeName'
|
56
|
+
end
|
44
57
|
|
58
|
+
# write xml
|
59
|
+
@xml.tag!('gmd:MD_ScopeCode', {:codeList => 'http://mdtranslator.herokuapp.com/api/codelists?format=xml#MD_ScopeCode',
|
60
|
+
:codeListValue => "#{codeName}",
|
61
|
+
:codeSpace => "#{codeID}"})
|
62
|
+
end
|
45
63
|
|
64
|
+
end
|
46
65
|
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -1,36 +1,49 @@
|
|
1
1
|
# ISO <<CodeLists>> gmd:MD_SpatialRepresentationTypeCode
|
2
2
|
|
3
|
-
# from http://
|
3
|
+
# from http://mdtranslator.herokuapp.com/api/codelists?format=xml
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-10-21 original script
|
6
6
|
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
+
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso
|
14
|
+
|
15
|
+
class MD_SpatialRepresentationTypeCode
|
16
|
+
def initialize(xml)
|
17
|
+
@xml = xml
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(codeName)
|
21
|
+
case (codeName)
|
22
|
+
when 'vector' then
|
23
|
+
codeID = '001'
|
24
|
+
when 'grid' then
|
25
|
+
codeID = '002'
|
26
|
+
when 'textTable' then
|
27
|
+
codeID = '003'
|
28
|
+
when 'tin' then
|
29
|
+
codeID = '004'
|
30
|
+
when 'stereoModel' then
|
31
|
+
codeID = '005'
|
32
|
+
when 'video' then
|
33
|
+
codeID = '006'
|
34
|
+
else
|
35
|
+
codeID = 'non-ISO codeName'
|
36
|
+
end
|
37
|
+
|
38
|
+
# write xml
|
39
|
+
@xml.tag!('gmd:MD_SpatialRepresentationTypeCode', {:codeList => 'http://mdtranslator.herokuapp.com/api/codelists?format=xml#MD_SpatialRepresentationTypeCode',
|
40
|
+
:codeListValue => "#{codeName}",
|
41
|
+
:codeSpace => "#{codeID}"})
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
31
49
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
@@ -1,50 +1,57 @@
|
|
1
1
|
# ISO <<CodeLists>> gmd:MD_TopicCategoryCode
|
2
2
|
# Enumeration
|
3
3
|
|
4
|
-
# from http://
|
4
|
+
# from http://mdtranslator.herokuapp.com/api/codelists?format=xml
|
5
5
|
# History:
|
6
6
|
# Stan Smith 2013-10-21 original script
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
+
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso
|
14
|
+
|
15
|
+
class MD_TopicCategoryCode
|
16
|
+
def initialize(xml)
|
17
|
+
@xml = xml
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(codeName)
|
21
|
+
case (codeName)
|
22
|
+
when 'farming',
|
23
|
+
'biota',
|
24
|
+
'boundaries',
|
25
|
+
'climatologyMeteorologyAtmosphere',
|
26
|
+
'economy',
|
27
|
+
'elevation',
|
28
|
+
'environment',
|
29
|
+
'geoscientificInformation',
|
30
|
+
'health',
|
31
|
+
'imageryBaseMapsEarthCover',
|
32
|
+
'intelligenceMilitary',
|
33
|
+
'inlandWaters',
|
34
|
+
'location',
|
35
|
+
'oceans',
|
36
|
+
'planningCadastre',
|
37
|
+
'society',
|
38
|
+
'structure',
|
39
|
+
'transportation',
|
40
|
+
'utilitiesCommunication'
|
41
|
+
else
|
42
|
+
# topics not in the standard ISO list will not pass validation
|
43
|
+
# the domain is validated by the XSD
|
44
|
+
# this codelist cannot be extended
|
45
|
+
return
|
46
|
+
end
|
47
|
+
|
48
|
+
# write xml
|
49
|
+
@xml.tag!('gmd:MD_TopicCategoryCode', codeName)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
45
57
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
@@ -3,25 +3,36 @@
|
|
3
3
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-03 original script
|
6
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
6
7
|
|
7
|
-
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso
|
8
12
|
|
9
|
-
|
10
|
-
@xml = xml
|
11
|
-
end
|
13
|
+
class BaseUnit
|
12
14
|
|
13
|
-
|
15
|
+
def initialize(xml)
|
16
|
+
@xml = xml
|
17
|
+
end
|
14
18
|
|
15
|
-
|
16
|
-
$idCount = $idCount.succ
|
17
|
-
unitID = 'unit' + $idCount
|
18
|
-
@xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
|
19
|
-
@xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
|
20
|
-
@xml.tag!('gml:name', hBase[:name])
|
21
|
-
@xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
|
22
|
-
@xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
|
23
|
-
end
|
19
|
+
def writeXML(hBase)
|
24
20
|
|
25
|
-
|
21
|
+
# create and identity for the unit
|
22
|
+
$idCount = $idCount.succ
|
23
|
+
unitID = 'unit' + $idCount
|
24
|
+
@xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
|
25
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
|
26
|
+
@xml.tag!('gml:name', hBase[:name])
|
27
|
+
@xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
|
28
|
+
@xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
|
29
|
+
end
|
26
30
|
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
27
38
|
end
|
@@ -3,51 +3,62 @@
|
|
3
3
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-03 original script
|
6
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
def writeXML(hConv)
|
14
|
-
|
15
|
-
# create and identity for the unit
|
16
|
-
$idCount = $idCount.succ
|
17
|
-
unitID = 'unit' + $idCount
|
18
|
-
|
19
|
-
@xml.tag!('gml:ConventionalUnit', {'gml:id' => unitID}) do
|
20
|
-
@xml.tag!('gml:identifier', {'codeSpace' => hConv[:codeSpace]}, hConv[:identifier])
|
21
|
-
@xml.tag!('gml:name', hConv[:name])
|
22
|
-
@xml.tag!('gml:catalogSymbol', hConv[:catalogSymbol])
|
23
|
-
@xml.tag!('gml:conversionToPreferredUnit', {'uom' => hConv[:preferredUnit]}) do
|
24
|
-
|
25
|
-
# two methods of conversion are available
|
26
|
-
# factor and formula
|
27
|
-
if !hConv[:factor].nil?
|
28
|
-
# factor:
|
29
|
-
# y = factor * x
|
30
|
-
# y is in preferred units
|
31
|
-
# x is in provided units
|
32
|
-
# factor is conversion to preferred units
|
33
|
-
@xml.tag!('gml:factor', hConv[:factor])
|
34
|
-
else
|
35
|
-
# formula:
|
36
|
-
# y = (a + bx) / (c + dx)
|
37
|
-
# y is in preferred units
|
38
|
-
# x is in provided units
|
39
|
-
# a,b,c,d are constants to convert to preferred units
|
40
|
-
@xml.tag!('gml:formula') do
|
41
|
-
@xml.tag!('gml:a', hConv[:a])
|
42
|
-
@xml.tag!('gml:b', hConv[:b])
|
43
|
-
@xml.tag!('gml:c', hConv[:c])
|
44
|
-
@xml.tag!('gml:d', hConv[:d])
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso
|
52
12
|
|
13
|
+
class ConventionalUnit
|
14
|
+
|
15
|
+
def initialize(xml)
|
16
|
+
@xml = xml
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hConv)
|
20
|
+
|
21
|
+
# create and identity for the unit
|
22
|
+
$idCount = $idCount.succ
|
23
|
+
unitID = 'unit' + $idCount
|
24
|
+
|
25
|
+
@xml.tag!('gml:ConventionalUnit', {'gml:id' => unitID}) do
|
26
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hConv[:codeSpace]}, hConv[:identifier])
|
27
|
+
@xml.tag!('gml:name', hConv[:name])
|
28
|
+
@xml.tag!('gml:catalogSymbol', hConv[:catalogSymbol])
|
29
|
+
@xml.tag!('gml:conversionToPreferredUnit', {'uom' => hConv[:preferredUnit]}) do
|
30
|
+
|
31
|
+
# two methods of conversion are available
|
32
|
+
# factor and formula
|
33
|
+
if !hConv[:factor].nil?
|
34
|
+
# factor:
|
35
|
+
# y = factor * x
|
36
|
+
# y is in preferred units
|
37
|
+
# x is in provided units
|
38
|
+
# factor is conversion to preferred units
|
39
|
+
@xml.tag!('gml:factor', hConv[:factor])
|
40
|
+
else
|
41
|
+
# formula:
|
42
|
+
# y = (a + bx) / (c + dx)
|
43
|
+
# y is in preferred units
|
44
|
+
# x is in provided units
|
45
|
+
# a,b,c,d are constants to convert to preferred units
|
46
|
+
@xml.tag!('gml:formula') do
|
47
|
+
@xml.tag!('gml:a', hConv[:a])
|
48
|
+
@xml.tag!('gml:b', hConv[:b])
|
49
|
+
@xml.tag!('gml:c', hConv[:c])
|
50
|
+
@xml.tag!('gml:d', hConv[:d])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
53
64
|
end
|
@@ -3,22 +3,33 @@
|
|
3
3
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2014-12-03 original script
|
6
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
6
7
|
|
7
|
-
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso
|
8
12
|
|
9
|
-
|
10
|
-
@xml = xml
|
11
|
-
end
|
13
|
+
class UnitDefinition
|
12
14
|
|
13
|
-
|
15
|
+
def initialize(xml)
|
16
|
+
@xml = xml
|
17
|
+
end
|
14
18
|
|
15
|
-
|
16
|
-
$idCount = $idCount.succ
|
17
|
-
unitID = 'unit' + $idCount
|
18
|
-
@xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do
|
19
|
-
@xml.tag!('gml:identifier', {'codeSpace' => ''}, unit)
|
20
|
-
end
|
19
|
+
def writeXML(unit)
|
21
20
|
|
22
|
-
|
21
|
+
# create and identity for the unit
|
22
|
+
$idCount = $idCount.succ
|
23
|
+
unitID = 'unit' + $idCount
|
24
|
+
@xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do
|
25
|
+
@xml.tag!('gml:identifier', {'codeSpace' => ''}, unit)
|
26
|
+
end
|
23
27
|
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
24
35
|
end
|