module ADIWG::Mdtranslator::Readers::Fgdc::SpatialOrganization
Public Class Methods
unpack(xSpatialOrg, hResourceInfo, hResponseObj)
click to toggle source
# File lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialOrganization.rb, line 19 def self.unpack(xSpatialOrg, hResourceInfo, hResponseObj) # instance classes needed in script intMetadataClass = InternalMetadata.new # spatial organization 3.1 (indspref) - indirect spatial reference # -> resourceInfo.spatialReferenceSystems.systemIdentifier.identifier per NOAA # -> however definitions are not close indirect = xSpatialOrg.xpath('./indspref').text unless indirect.empty? hSystem = intMetadataClass.newSpatialReferenceSystem hIdentifier = intMetadataClass.newIdentifier hIdentifier[:identifier] = 'indirect' hIdentifier[:namespace] = 'FGDC' hIdentifier[:description] = indirect hSystem[:systemIdentifier] = hIdentifier hResourceInfo[:spatialReferenceSystems] << hSystem end # spatial organization 3.2 (direct) - direct spatial reference method # -> resourceInfo.spatialRepresentationTypes, translate FGDC to ISO as: # -> point = vector do 3.3 # -> vector = vector do 3.3 # -> raster = grid do 3.4 direct = xSpatialOrg.xpath('./direct').text unless direct.empty? type = 'point' if direct == 'Point' type = 'vector' if direct == 'Vector' type = 'grid' if direct == 'Raster' hResourceInfo[:spatialRepresentationTypes] << type # spatial organization 3.3 (ptvctinfo) - point and vector object if type == 'vector' || type == 'point' xPtVec = xSpatialOrg.xpath('./ptvctinf') unless xPtVec.empty? PointVector.unpack(xPtVec, hResourceInfo, hResponseObj) end end # spatial organization 3.4 (rastinfo) - raster object if type == 'grid' xRaster = xSpatialOrg.xpath('./rastinfo') unless xRaster.empty? Raster.unpack(xRaster, hResourceInfo, hResponseObj) end end end return hResourceInfo end