module ADIWG::Mdtranslator::Readers::Fgdc::ProjectionCommon
Public Class Methods
unpackFalseNE(xParams, hProjection)
click to toggle source
false northing and easting(xParams, hProjection, hResponseObj)
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 62 def self.unpackFalseNE(xParams, hProjection) paramCount = 0 falseE = xParams.xpath('./feast').text unless falseE.empty? hProjection[:falseEasting] = falseE.to_f paramCount += 1 end falseN = xParams.xpath('./fnorth').text unless falseN.empty? hProjection[:falseNorthing] = falseN.to_f paramCount += 1 end return paramCount end
unpackHeightAS(xParams, hProjection)
click to toggle source
height of perspective point above surface
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 78 def self.unpackHeightAS(xParams, hProjection) heightAS = xParams.xpath('./heightpt').text unless heightAS.empty? hProjection[:heightOfProspectivePointAboveSurface] = heightAS.to_f return 1 end return 0 end
unpackLandSat(xParams, hProjection)
click to toggle source
landsat number
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 218 def self.unpackLandSat(xParams, hProjection) landsatN = xParams.xpath('./landsat').text unless landsatN.empty? hProjection[:landsatNumber] = landsatN.to_i return 1 end return 0 end
unpackLandSatPath(xParams, hProjection)
click to toggle source
landsat path number
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 228 def self.unpackLandSatPath(xParams, hProjection) landsatP = xParams.xpath('./pathnum').text unless landsatP.empty? hProjection[:landsatPath] = landsatP.to_i return 1 end return 0 end
unpackLatPC(xParams, hProjection)
click to toggle source
latitude of projection center
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 98 def self.unpackLatPC(xParams, hProjection) latPC = xParams.xpath('./latprjc').text unless latPC.empty? hProjection[:latitudeOfProjectionCenter] = latPC.to_f return 1 end return 0 end
unpackLatPO(xParams, hProjection)
click to toggle source
latitude of projection origin
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 52 def self.unpackLatPO(xParams, hProjection) latPO = xParams.xpath('./latprjo').text unless latPO.empty? hProjection[:latitudeOfProjectionOrigin] = latPO.to_f return 1 end return 0 end
unpackLongCM(xParams, hProjection)
click to toggle source
longitude of central meridian
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 42 def self.unpackLongCM(xParams, hProjection) longCM = xParams.xpath('./longcm').text unless longCM.empty? hProjection[:longitudeOfCentralMeridian] = longCM.to_f return 1 end return 0 end
unpackLongPC(xParams, hProjection)
click to toggle source
longitude of projection center
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 88 def self.unpackLongPC(xParams, hProjection) longPC = xParams.xpath('./longpc').text unless longPC.empty? hProjection[:longitudeOfProjectionCenter] = longPC.to_f return 1 end return 0 end
unpackObliqueLA(xParams, hProjection)
click to toggle source
oblique line azimuth
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 148 def self.unpackObliqueLA(xParams, hProjection) xObliqueLA = xParams.xpath('./obqlazim') unless xObliqueLA.empty? paramCount = 0 lineAzimuth = xObliqueLA.xpath('./azimangl').text unless lineAzimuth.empty? hProjection[:azimuthAngle] = lineAzimuth.to_f paramCount += 1 end lineLong = xObliqueLA.xpath('./azimptl').text unless lineLong.empty? hProjection[:azimuthMeasurePointLongitude] = lineLong.to_f paramCount += 1 end return paramCount end return 0 end
unpackObliqueLP(xParams, hProjection)
click to toggle source
oblique line point
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 168 def self.unpackObliqueLP(xParams, hProjection) xObliqueLP = xParams.xpath('./obqlpt') unless xObliqueLP.empty? paramCount = 0 hPoint1 = @intMetadataClass.newObliqueLinePoint hPoint2 = @intMetadataClass.newObliqueLinePoint lat1 = xObliqueLP.xpath('./obqllat[1]').text unless lat1.empty? hPoint1[:obliqueLineLatitude] = lat1.to_f paramCount += 1 end long1 = xObliqueLP.xpath('./obqllong[1]').text unless long1.empty? hPoint1[:obliqueLineLongitude] = long1.to_f paramCount += 1 end lat2 = xObliqueLP.xpath('./obqllat[2]').text unless lat2.empty? hPoint2[:obliqueLineLatitude] = lat2.to_f paramCount += 1 end long2 = xObliqueLP.xpath('./obqllong[2]').text unless long2.empty? hPoint2[:obliqueLineLongitude] = long2.to_f paramCount += 1 end if paramCount == 4 hProjection[:obliqueLinePoints] << hPoint1 hProjection[:obliqueLinePoints] << hPoint2 return hProjection[:obliqueLinePoints].length end end return 0 end
unpackOtherProjection(xParams, hProjection)
click to toggle source
other projection
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 238 def self.unpackOtherProjection(xParams, hProjection) other = xParams.xpath('./otherprj').text unless other.empty? hProjection[:projectionIdentifier][:identifier] = 'other' hProjection[:projectionIdentifier][:description] = other return 1 end return 0 end
unpackSFCM(xParams, hProjection)
click to toggle source
scale factor at central meridian
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 128 def self.unpackSFCM(xParams, hProjection) sFCM = xParams.xpath('./sfctrmer').text unless sFCM.empty? hProjection[:scaleFactorAtCentralMeridian] = sFCM.to_f return 1 end return 0 end
unpackSFCenter(xParams, hProjection)
click to toggle source
scale factor at center line
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 118 def self.unpackSFCenter(xParams, hProjection) sFCenter = xParams.xpath('./sfctrlin').text unless sFCenter.empty? hProjection[:scaleFactorAtCenterLine] = sFCenter.to_f return 1 end return 0 end
unpackSFEquator(xParams, hProjection)
click to toggle source
scale factor at equator
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 108 def self.unpackSFEquator(xParams, hProjection) sFEquator = xParams.xpath('./sfequat').text unless sFEquator.empty? hProjection[:scaleFactorAtEquator] = sFEquator.to_f return 1 end return 0 end
unpackSFPO(xParams, hProjection)
click to toggle source
scale factor at projection origin
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 138 def self.unpackSFPO(xParams, hProjection) sFProjectO = xParams.xpath('./sfprjorg').text unless sFProjectO.empty? hProjection[:scaleFactorAtProjectionOrigin] = sFProjectO.to_f return 1 end return 0 end
unpackStandParallel(xParams, hProjection)
click to toggle source
standard parallels
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 21 def self.unpackStandParallel(xParams, hProjection) paramCount = 0 aStandP = xParams.xpath('./stdparll') unless aStandP.empty? aStandP.each_with_index do |xStandP, index| standP = xStandP.text unless standP.empty? if index == 0 hProjection[:standardParallel1] = standP.to_f paramCount += 1 else hProjection[:standardParallel2] = standP.to_f paramCount += 1 end end end end return paramCount end
unpackVSLong(xParams, hProjection)
click to toggle source
straight vertical longitude from pole
# File lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb, line 208 def self.unpackVSLong(xParams, hProjection) sVLongP = xParams.xpath('./svlong').text unless sVLongP.empty? hProjection[:straightVerticalLongitudeFromPole] = sVLongP.to_f return 1 end return 0 end