-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from stansmith907/dev
Fix bug that returns first identifier as parentId when no SB namespace is found
- Loading branch information
Showing
165 changed files
with
9,248 additions
and
698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Reader - fgdc to internal data structure | ||
# unpack fgdc map projection - albers | ||
|
||
# History: | ||
# Stan Smith 2017-10-04 original script | ||
|
||
require 'nokogiri' | ||
require 'adiwg/mdtranslator/internal/internal_metadata_obj' | ||
require_relative 'projection_common' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Readers | ||
module Fgdc | ||
|
||
module AlbersProjection | ||
|
||
def self.unpack(xParams, hProjection, hResponseObj) | ||
|
||
# map projection 4.1.2.1.2 (albers) - Albers Conical Equal Area | ||
unless xParams.empty? | ||
paramCount = 0 | ||
hProjection[:projectionName] = 'albers' | ||
|
||
# -> ReferenceSystemParameters.projection.standardParallel1 | ||
# -> ReferenceSystemParameters.projection.standardParallel2 | ||
paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj) | ||
|
||
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian | ||
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj) | ||
|
||
# -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin | ||
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj) | ||
|
||
# -> ReferenceSystemParameters.projection.falseEasting | ||
# -> ReferenceSystemParameters.projection.falseNorthing | ||
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj) | ||
|
||
# verify parameter count | ||
if paramCount == 6 | ||
return hProjection | ||
else | ||
hResponseObj[:readerExecutionMessages] << 'albers projection is missing one or more parameters' | ||
return nil | ||
end | ||
end | ||
|
||
return nil | ||
|
||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end | ||
end |
53 changes: 53 additions & 0 deletions
53
lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Reader - fgdc to internal data structure | ||
# unpack fgdc map projection - azimuth equidistant | ||
|
||
# History: | ||
# Stan Smith 2017-10-16 original script | ||
|
||
require 'nokogiri' | ||
require 'adiwg/mdtranslator/internal/internal_metadata_obj' | ||
require_relative 'projection_common' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Readers | ||
module Fgdc | ||
|
||
module AzimuthEquidistantProjection | ||
|
||
def self.unpack(xParams, hProjection, hResponseObj) | ||
|
||
# map projection 4.1.2.1.3 (azimequi) - Azimuthal Equidistant | ||
unless xParams.empty? | ||
paramCount = 0 | ||
hProjection[:projectionName] = 'azimuthal equidistant' | ||
|
||
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian | ||
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj) | ||
|
||
# -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin | ||
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj) | ||
|
||
# -> ReferenceSystemParameters.projection.falseEasting | ||
# -> ReferenceSystemParameters.projection.falseNorthing | ||
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj) | ||
|
||
# verify parameter count | ||
if paramCount == 4 | ||
return hProjection | ||
else | ||
hResponseObj[:readerExecutionMessages] << 'azimuth equidistant projection is missing one or more parameters' | ||
return nil | ||
end | ||
end | ||
|
||
return nil | ||
|
||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.