adiwg-mdtranslator 2.13.3 → 2.14.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 +3 -3
- data/CHANGELOG.md +11 -4
- data/Rakefile +14 -14
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +14 -14
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_equalArcSecond.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_other.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_statePlane.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_ups.rb +58 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_utm.rb +58 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +23 -22
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +20 -20
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +6 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +8 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalPlanar.rb → module_localPlanar.rb} +16 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +23 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +21 -144
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +48 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapCoordinateInfo.rb → module_planarCoordinateInfo.rb} +23 -11
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +5 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +6 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader_messages_eng.yml +20 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +41 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +36 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +39 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +20 -8
- data/lib/adiwg/mdtranslator/version.rb +11 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +30 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjectionTags.rb +164 -109
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +60 -61
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +12 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +87 -99
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +16 -41
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +12 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +9 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +2 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +13 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +16 -30
- data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +8 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +68 -57
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +9 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +13 -12
- data/lib/adiwg/mdtranslator/writers/html/sections/html_usage.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +9 -15
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +12 -15
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +9 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +2 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +21 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +4 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +2 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_identifier.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_localProjection.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_obliqueLinePoint.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -9
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +10 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +21 -0
- metadata +17 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +0 -42
@@ -2,10 +2,12 @@
|
|
2
2
|
# unpack fgdc map projection - parameter set
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
8
9
|
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
10
|
+
require_relative 'projection_common'
|
9
11
|
|
10
12
|
module ADIWG
|
11
13
|
module Mdtranslator
|
@@ -18,63 +20,61 @@ module ADIWG
|
|
18
20
|
|
19
21
|
# map projection 4.1.2.1.23 (mapprojp) - projection parameter set
|
20
22
|
unless xParams.empty?
|
21
|
-
hProjection[:projection] = 'parameters'
|
22
|
-
hProjection[:projectionName] = 'Projection Parameter Set'
|
23
23
|
|
24
24
|
# -> ReferenceSystemParameters.projection.standardParallel1
|
25
25
|
# -> ReferenceSystemParameters.projection.standardParallel2
|
26
|
-
ProjectionCommon.unpackStandParallel(xParams, hProjection
|
26
|
+
ProjectionCommon.unpackStandParallel(xParams, hProjection)
|
27
27
|
|
28
28
|
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
|
29
|
-
ProjectionCommon.unpackLongCM(xParams, hProjection
|
29
|
+
ProjectionCommon.unpackLongCM(xParams, hProjection)
|
30
30
|
|
31
31
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
|
32
|
-
ProjectionCommon.unpackLatPO(xParams, hProjection
|
32
|
+
ProjectionCommon.unpackLatPO(xParams, hProjection)
|
33
33
|
|
34
34
|
# -> ReferenceSystemParameters.projection.falseEasting
|
35
35
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
36
|
-
ProjectionCommon.unpackFalseNE(xParams, hProjection
|
36
|
+
ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
37
37
|
|
38
38
|
# -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
|
39
|
-
ProjectionCommon.unpackHeightAS(xParams, hProjection
|
39
|
+
ProjectionCommon.unpackHeightAS(xParams, hProjection)
|
40
40
|
|
41
41
|
# -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
|
42
|
-
ProjectionCommon.unpackLongPC(xParams, hProjection
|
42
|
+
ProjectionCommon.unpackLongPC(xParams, hProjection)
|
43
43
|
|
44
44
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
|
45
|
-
ProjectionCommon.unpackLatPC(xParams, hProjection
|
45
|
+
ProjectionCommon.unpackLatPC(xParams, hProjection)
|
46
46
|
|
47
47
|
# -> ReferenceSystemParameters.projection.scaleFactorAtEquator
|
48
|
-
ProjectionCommon.unpackSFEquator(xParams, hProjection
|
48
|
+
ProjectionCommon.unpackSFEquator(xParams, hProjection)
|
49
49
|
|
50
50
|
# -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
|
51
|
-
ProjectionCommon.unpackSFCenter(xParams, hProjection
|
51
|
+
ProjectionCommon.unpackSFCenter(xParams, hProjection)
|
52
52
|
|
53
53
|
# -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
|
54
|
-
ProjectionCommon.unpackSFCM(xParams, hProjection
|
54
|
+
ProjectionCommon.unpackSFCM(xParams, hProjection)
|
55
55
|
|
56
56
|
# -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
|
57
|
-
ProjectionCommon.unpackSFPO(xParams, hProjection
|
57
|
+
ProjectionCommon.unpackSFPO(xParams, hProjection)
|
58
58
|
|
59
59
|
# -> oblique line azimuth ( azimuthAngle && azimuthMeasurePointLongitude )
|
60
60
|
# -> ReferenceSystemParameters.projection.azimuthAngle
|
61
61
|
# -> ReferenceSystemParameters.projection.azimuthMeasurePointLongitude
|
62
|
-
ProjectionCommon.unpackObliqueLA(xParams, hProjection
|
62
|
+
ProjectionCommon.unpackObliqueLA(xParams, hProjection)
|
63
63
|
|
64
64
|
# -> oblique line point 2( obliqueLinePoint{} )
|
65
|
-
ProjectionCommon.unpackObliqueLP(xParams, hProjection
|
65
|
+
ProjectionCommon.unpackObliqueLP(xParams, hProjection)
|
66
66
|
|
67
67
|
# -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
|
68
|
-
ProjectionCommon.unpackVSLong(xParams, hProjection
|
68
|
+
ProjectionCommon.unpackVSLong(xParams, hProjection)
|
69
69
|
|
70
70
|
# -> ReferenceSystemParameters.projection.landsatNumber
|
71
|
-
ProjectionCommon.unpackLandSat(xParams, hProjection
|
71
|
+
ProjectionCommon.unpackLandSat(xParams, hProjection)
|
72
72
|
|
73
73
|
# -> ReferenceSystemParameters.projection.landsatPath
|
74
|
-
ProjectionCommon.unpackLandSatPath(xParams, hProjection
|
74
|
+
ProjectionCommon.unpackLandSatPath(xParams, hProjection)
|
75
75
|
|
76
|
-
# -> ReferenceSystemParameters.projection.
|
77
|
-
ProjectionCommon.unpackOtherProjection(xParams, hProjection
|
76
|
+
# -> ReferenceSystemParameters.projection.projectionIdentifier.description
|
77
|
+
ProjectionCommon.unpackOtherProjection(xParams, hProjection)
|
78
78
|
|
79
79
|
return hProjection
|
80
80
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - polar stereographic
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-17 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,31 +21,30 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.15 (polarst) - Polar Stereographic
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'polarStereo'
|
24
|
-
hProjection[:projectionName] = 'Polar Stereographic'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
|
27
|
-
paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> [ standardParallel1 | scaleFactorAtProjectionOrigin ]
|
30
29
|
# -> ReferenceSystemParameters.projection.standardParallel1
|
31
|
-
paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection
|
30
|
+
paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
|
32
31
|
|
33
32
|
# -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
|
34
|
-
paramCount += ProjectionCommon.unpackSFPO(xParams, hProjection
|
33
|
+
paramCount += ProjectionCommon.unpackSFPO(xParams, hProjection)
|
35
34
|
|
36
35
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
|
37
|
-
paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection
|
36
|
+
paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
|
38
37
|
|
39
38
|
# -> ReferenceSystemParameters.projection.falseEasting
|
40
39
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
41
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
40
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
42
41
|
|
43
42
|
# verify parameter count
|
44
43
|
if paramCount == 4
|
45
44
|
return hProjection
|
46
45
|
else
|
47
|
-
hResponseObj[:readerExecutionMessages] <<
|
46
|
+
hResponseObj[:readerExecutionMessages] <<
|
47
|
+
'WARNING: FGDC reader: Polar Stereographic projection is missing one or more parameters'
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - polyconic
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-17 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,24 +21,23 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.16 (polycon) - Polyconic
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'polyconic'
|
24
|
-
hProjection[:projectionName] = 'Polyconic'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
|
27
|
-
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
|
30
|
-
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection
|
29
|
+
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
|
31
30
|
|
32
31
|
# -> ReferenceSystemParameters.projection.falseEasting
|
33
32
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
34
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
33
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
35
34
|
|
36
35
|
# verify parameter count
|
37
36
|
if paramCount == 4
|
38
37
|
return hProjection
|
39
38
|
else
|
40
|
-
hResponseObj[:readerExecutionMessages] <<
|
39
|
+
hResponseObj[:readerExecutionMessages] <<
|
40
|
+
'WARNING: FGDC reader: Polyconic projection is missing one or more parameters'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - robinson
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,21 +21,20 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.17 (robinson) - Robinson
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'robinson'
|
24
|
-
hProjection[:projectionName] = 'Robinson'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
|
27
|
-
paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> ReferenceSystemParameters.projection.falseEasting
|
30
29
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
31
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
30
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
32
31
|
|
33
32
|
# verify parameter count
|
34
33
|
if paramCount == 3
|
35
34
|
return hProjection
|
36
35
|
else
|
37
|
-
hResponseObj[:readerExecutionMessages] <<
|
36
|
+
hResponseObj[:readerExecutionMessages] <<
|
37
|
+
'WARNING: FGDC reader: Robinson projection is missing one or more parameters'
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - sinusoidal
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,21 +21,20 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.18 (sinusoid) - Sinusoidal
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'sinusoidal'
|
24
|
-
hProjection[:projectionName] = 'Sinusoidal'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
|
27
|
-
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> ReferenceSystemParameters.projection.falseEasting
|
30
29
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
31
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
30
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
32
31
|
|
33
32
|
# verify parameter count
|
34
33
|
if paramCount == 3
|
35
34
|
return hProjection
|
36
35
|
else
|
37
|
-
hResponseObj[:readerExecutionMessages] <<
|
36
|
+
hResponseObj[:readerExecutionMessages] <<
|
37
|
+
'WARNING: Sinusoidal projection is missing one or more parameters'
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - space oblique
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,24 +21,23 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.19 (spaceobq) - Space Oblique Mercator (Landsat)
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'spaceOblique'
|
24
|
-
hProjection[:projectionName] = 'Space Oblique Mercator (Landsat)'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.landsatNumber
|
27
|
-
paramCount += ProjectionCommon.unpackLandSat(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackLandSat(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> ReferenceSystemParameters.projection.landsatPath
|
30
|
-
paramCount += ProjectionCommon.unpackLandSatPath(xParams, hProjection
|
29
|
+
paramCount += ProjectionCommon.unpackLandSatPath(xParams, hProjection)
|
31
30
|
|
32
31
|
# -> ReferenceSystemParameters.projection.falseEasting
|
33
32
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
34
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
33
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
35
34
|
|
36
35
|
# verify parameter count
|
37
36
|
if paramCount == 4
|
38
37
|
return hProjection
|
39
38
|
else
|
40
|
-
hResponseObj[:readerExecutionMessages] <<
|
39
|
+
hResponseObj[:readerExecutionMessages] <<
|
40
|
+
'WARNING: Space Oblique projection is missing one or more parameters'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - stereographic
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -20,24 +21,23 @@ module ADIWG
|
|
20
21
|
# map projection 4.1.2.1.20 (stereo) - Stereographic
|
21
22
|
unless xParams.empty?
|
22
23
|
paramCount = 0
|
23
|
-
hProjection[:projection] = 'stereographic'
|
24
|
-
hProjection[:projectionName] = 'Stereographic'
|
25
24
|
|
26
25
|
# -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
|
27
|
-
paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection
|
26
|
+
paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
|
28
27
|
|
29
28
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
|
30
|
-
paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection
|
29
|
+
paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
|
31
30
|
|
32
31
|
# -> ReferenceSystemParameters.projection.falseEasting
|
33
32
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
34
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
33
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
35
34
|
|
36
35
|
# verify parameter count
|
37
36
|
if paramCount == 4
|
38
37
|
return hProjection
|
39
38
|
else
|
40
|
-
hResponseObj[:readerExecutionMessages] <<
|
39
|
+
hResponseObj[:readerExecutionMessages] <<
|
40
|
+
'WARNING: FGDC reader: Stereographic projection is missing one or more parameters'
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - transverse mercator
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-04 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -19,26 +20,25 @@ module ADIWG
|
|
19
20
|
# map projection 4.1.2.1.21 (transmer) - Transverse Mercator
|
20
21
|
unless xParams.empty?
|
21
22
|
paramCount = 0
|
22
|
-
hProjection[:projection] = 'transverseMercator'
|
23
|
-
hProjection[:projectionName] = 'Transverse Mercator'
|
24
23
|
|
25
24
|
# -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
|
26
|
-
paramCount += ProjectionCommon.unpackSFCM(xParams, hProjection
|
25
|
+
paramCount += ProjectionCommon.unpackSFCM(xParams, hProjection)
|
27
26
|
|
28
27
|
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
|
29
|
-
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection
|
28
|
+
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
|
30
29
|
|
31
30
|
# -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
|
32
|
-
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection
|
31
|
+
paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
|
33
32
|
|
34
33
|
# -> ReferenceSystemParameters.projection.falseEasting
|
35
34
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
36
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
35
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
37
36
|
|
38
37
|
if paramCount == 5
|
39
38
|
return hProjection
|
40
39
|
else
|
41
|
-
hResponseObj[:readerExecutionMessages] <<
|
40
|
+
hResponseObj[:readerExecutionMessages] <<
|
41
|
+
'WARNING: FGDC reader: Transverse Mercator projection is missing one or more parameters'
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map projection - van der grinten
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-03 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-18 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -19,20 +20,19 @@ module ADIWG
|
|
19
20
|
# map projection 4.1.2.1.22 (vdgrin) - van der Grinten
|
20
21
|
unless xParams.empty?
|
21
22
|
paramCount = 0
|
22
|
-
hProjection[:projection] = 'grinten'
|
23
|
-
hProjection[:projectionName] = 'van der Grinten'
|
24
23
|
|
25
24
|
# -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
|
26
|
-
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection
|
25
|
+
paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
|
27
26
|
|
28
27
|
# -> ReferenceSystemParameters.projection.falseEasting
|
29
28
|
# -> ReferenceSystemParameters.projection.falseNorthing
|
30
|
-
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection
|
29
|
+
paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
|
31
30
|
|
32
31
|
if paramCount == 3
|
33
32
|
return hProjection
|
34
33
|
else
|
35
|
-
hResponseObj[:readerExecutionMessages] <<
|
34
|
+
hResponseObj[:readerExecutionMessages] <<
|
35
|
+
'WARNING: FGDC reader: Van Der Grinten projection is missing one or more parameters'
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc horizontal data geodetic reference
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-09-26 deprecate datumName and ellipsoidName from mdJSON
|
5
6
|
# Stan Smith 2017-12-29 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -23,20 +24,25 @@ module ADIWG
|
|
23
24
|
xGeodetic = xHorizontalRef.xpath('./geodetic')
|
24
25
|
|
25
26
|
# geodetic model 4.1.4.1 (horizdn) - horizontal datum name
|
26
|
-
# -> referenceSystemParameters.geodetic.
|
27
|
+
# -> referenceSystemParameters.geodetic.datumIdentifier.identifier
|
27
28
|
datumName = xGeodetic.xpath('./horizdn').text
|
28
29
|
unless datumName.empty?
|
29
|
-
hGeodetic[:
|
30
|
+
hGeodetic[:datumIdentifier] = intMetadataClass.newIdentifier
|
31
|
+
hGeodetic[:datumIdentifier][:identifier] = datumName
|
32
|
+
hGeodetic[:datumIdentifier][:name] = datumName
|
30
33
|
end
|
31
34
|
|
32
35
|
# geodetic model 4.1.4.2 (ellips) - ellipsoid name (required)
|
33
|
-
# -> referenceSystemParameters.geodetic.
|
36
|
+
# -> referenceSystemParameters.geodetic.ellipsoidIdentifier.identifier
|
34
37
|
ellipsoidName = xGeodetic.xpath('./ellips').text
|
35
38
|
unless ellipsoidName.empty?
|
36
|
-
hGeodetic[:
|
39
|
+
hGeodetic[:ellipsoidIdentifier] = intMetadataClass.newIdentifier
|
40
|
+
hGeodetic[:ellipsoidIdentifier][:identifier] = ellipsoidName
|
41
|
+
hGeodetic[:ellipsoidIdentifier][:name] = ellipsoidName
|
37
42
|
end
|
38
43
|
if ellipsoidName.empty?
|
39
|
-
hResponseObj[:readerExecutionMessages] <<
|
44
|
+
hResponseObj[:readerExecutionMessages] <<
|
45
|
+
'WARNING: FGDC reader: geodetic reference ellipsoid name is missing'
|
40
46
|
end
|
41
47
|
|
42
48
|
# geodetic model 4.1.4.3 (semiaxis) - semi-major axis (required)
|
@@ -46,7 +52,8 @@ module ADIWG
|
|
46
52
|
hGeodetic[:semiMajorAxis] = semiAxis.to_f
|
47
53
|
end
|
48
54
|
if semiAxis.empty?
|
49
|
-
hResponseObj[:readerExecutionMessages] <<
|
55
|
+
hResponseObj[:readerExecutionMessages] <<
|
56
|
+
'WARNING: FGDC reader: geodetic reference radius of semi-major axis is missing'
|
50
57
|
end
|
51
58
|
|
52
59
|
# geodetic model 4.1.2.4.4 (plandu) - distance units
|
@@ -71,7 +78,8 @@ module ADIWG
|
|
71
78
|
hGeodetic[:denominatorOfFlatteningRatio] = flattening.to_f
|
72
79
|
end
|
73
80
|
if flattening.empty?
|
74
|
-
hResponseObj[:readerExecutionMessages] <<
|
81
|
+
hResponseObj[:readerExecutionMessages] <<
|
82
|
+
'WARNING: FGDC reader: geodetic reference denominator flattening ratio is missing'
|
75
83
|
end
|
76
84
|
|
77
85
|
hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
|
@@ -29,7 +29,8 @@ module ADIWG
|
|
29
29
|
hGeoResolution[:latitudeResolution] = latResolution.to_f
|
30
30
|
end
|
31
31
|
if latResolution.empty?
|
32
|
-
hResponseObj[:readerExecutionMessages] <<
|
32
|
+
hResponseObj[:readerExecutionMessages] <<
|
33
|
+
'WARNING: FGDC reader: geographic latitude resolution is missing'
|
33
34
|
end
|
34
35
|
|
35
36
|
# geographic reference 4.1.1.2 (longres) - longitude resolution (required)
|
@@ -39,7 +40,8 @@ module ADIWG
|
|
39
40
|
hGeoResolution[:longitudeResolution] = longResolution.to_f
|
40
41
|
end
|
41
42
|
if longResolution.empty?
|
42
|
-
hResponseObj[:readerExecutionMessages] <<
|
43
|
+
hResponseObj[:readerExecutionMessages] <<
|
44
|
+
'WARNING: FGDC reader: geographic longitude resolution is missing'
|
43
45
|
end
|
44
46
|
|
45
47
|
# geographic reference 4.1.1.3 (geogunit) - latitude/longitude units (required)
|
@@ -49,7 +51,8 @@ module ADIWG
|
|
49
51
|
hGeoResolution[:unitOfMeasure] = unitMeasure
|
50
52
|
end
|
51
53
|
if unitMeasure.empty?
|
52
|
-
hResponseObj[:readerExecutionMessages] <<
|
54
|
+
hResponseObj[:readerExecutionMessages] <<
|
55
|
+
'WARNING: FGDC reader: geographic latitude/longitude units are missing'
|
53
56
|
end
|
54
57
|
|
55
58
|
hResolution[:geographicResolution] = hGeoResolution
|
@@ -2,14 +2,15 @@
|
|
2
2
|
# unpack fgdc horizontal planar data reference
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-04 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-03 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
8
9
|
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
9
10
|
require_relative 'module_mapProjection'
|
10
11
|
require_relative 'module_mapGridSystem'
|
11
|
-
require_relative '
|
12
|
-
require_relative '
|
12
|
+
require_relative 'module_localPlanar'
|
13
|
+
require_relative 'module_planarCoordinateInfo'
|
13
14
|
|
14
15
|
module ADIWG
|
15
16
|
module Mdtranslator
|
@@ -22,7 +23,9 @@ module ADIWG
|
|
22
23
|
|
23
24
|
# instance classes needed in script
|
24
25
|
intMetadataClass = InternalMetadata.new
|
25
|
-
|
26
|
+
hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
|
27
|
+
hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
|
28
|
+
hProjection = {}
|
26
29
|
|
27
30
|
# get distance unit of measure for use in map projections and grid systems
|
28
31
|
distanceUnits = nil
|
@@ -52,9 +55,8 @@ module ADIWG
|
|
52
55
|
hProjection = MapLocalPlanar.unpack(xMapLocal, hResponseObj)
|
53
56
|
end
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
|
58
|
+
# packing
|
59
|
+
unless hProjection.empty?
|
58
60
|
unless distanceUnits.nil?
|
59
61
|
hProjection[:falseEastingNorthingUnits] = distanceUnits
|
60
62
|
end
|
@@ -39,7 +39,7 @@ module ADIWG
|
|
39
39
|
# horizontal reference 4.1.3 (local) - local coordinate system
|
40
40
|
xLocal = xHorizontalRef.xpath('./local')
|
41
41
|
unless xLocal.empty?
|
42
|
-
hReferenceSystem =
|
42
|
+
hReferenceSystem = MapLocalSystem.unpack(xLocal, hResponseObj)
|
43
43
|
unless hReferenceSystem.nil?
|
44
44
|
hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
|
45
45
|
end
|
data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalPlanar.rb → module_localPlanar.rb}
RENAMED
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc map grid coordinate system
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-04 refactor mdJson projection object
|
5
6
|
# Stan Smith 2017-10-04 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -18,28 +19,35 @@ module ADIWG
|
|
18
19
|
# instance classes needed in script
|
19
20
|
intMetadataClass = InternalMetadata.new
|
20
21
|
hProjection = intMetadataClass.newProjection
|
22
|
+
hIdentifier = intMetadataClass.newIdentifier
|
23
|
+
hLocal = intMetadataClass.newLocal
|
24
|
+
hProjection[:projectionIdentifier] = hIdentifier
|
25
|
+
hProjection[:local] = hLocal
|
21
26
|
|
22
|
-
|
23
|
-
|
27
|
+
hIdentifier[:identifier] = 'localPlanar'
|
28
|
+
hIdentifier[:name] = 'Local Planar Coordinate System'
|
29
|
+
hLocal[:fixedToEarth] = true
|
24
30
|
|
25
31
|
# local planar 4.1.2.3.1 (localpd) - local planar description (required)
|
26
|
-
# -> ReferenceSystemParameters.projection.
|
32
|
+
# -> ReferenceSystemParameters.projection.local.description
|
27
33
|
description = xMapLocal.xpath('./localpd').text
|
28
34
|
unless description.empty?
|
29
|
-
|
35
|
+
hLocal[:description] = description
|
30
36
|
end
|
31
37
|
if description.empty?
|
32
|
-
hResponseObj[:readerExecutionMessages] <<
|
38
|
+
hResponseObj[:readerExecutionMessages] <<
|
39
|
+
'WARNING: FGDC reader: local planar coordinate system description is missing'
|
33
40
|
end
|
34
41
|
|
35
42
|
# local planar 4.1.2.3.2 (localpgi) - local planar georeference information (required)
|
36
|
-
# -> ReferenceSystemParameters.projection.
|
43
|
+
# -> ReferenceSystemParameters.projection.local.georeference
|
37
44
|
georeference = xMapLocal.xpath('./localpgi').text
|
38
45
|
unless georeference.empty?
|
39
|
-
|
46
|
+
hLocal[:georeference] = georeference
|
40
47
|
end
|
41
48
|
if georeference.empty?
|
42
|
-
hResponseObj[:readerExecutionMessages] <<
|
49
|
+
hResponseObj[:readerExecutionMessages] <<
|
50
|
+
'WARNING: FGDC reader: local planar coordinate system georeference information is missing'
|
43
51
|
end
|
44
52
|
|
45
53
|
return hProjection
|