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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialOrganization.rb', line 19
def self.unpack(xSpatialOrg, hResourceInfo, hResponseObj)
intMetadataClass = InternalMetadata.new
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
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
if type == 'vector' || type == 'point'
xPtVec = xSpatialOrg.xpath('./ptvctinf')
unless xPtVec.empty?
PointVector.unpack(xPtVec, hResourceInfo, hResponseObj)
end
end
if type == 'grid'
xRaster = xSpatialOrg.xpath('./rastinfo')
unless xRaster.empty?
Raster.unpack(xRaster, hResourceInfo, hResponseObj)
end
end
end
return hResourceInfo
end
|