adiwg-mdtranslator 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -1
- data/Rakefile +1 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +10 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +100 -86
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_timePeriod.rb +3 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/readme.md +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +157 -157
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_body.rb +4 -7
- data/lib/adiwg/mdtranslator/version.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +87 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +172 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +164 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +54 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +49 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +78 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +54 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +152 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +99 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +67 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +47 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +200 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +102 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +49 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/readme.md +22 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/html/version.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +29 -27
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_mdJson.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/version.rb +3 -5
- data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +21 -9
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_sbJson.rb +21 -3
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_tag.rb +27 -7
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_webLink.rb +17 -4
- data/lib/adiwg/mdtranslator/writers/sbJson/version.rb +1 -4
- data/lib/adiwg/mdtranslator.rb +5 -4
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95997a263659c300096fdde23a9b106fc0087077
|
4
|
+
data.tar.gz: 2c5744f3015d572bbf3cd42b61edd658351c6120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b367d5f133db2bc2927e0a729028bcf04680bbdc6fbf101c5705a7643ae7b6452b474f1d4bc8d994bef4c82e6e9f63f8f0d1c8245cadd3af5f1764590d98a18d
|
7
|
+
data.tar.gz: d0746f77b488309360f28bfb1b3131eefc3b77b3b2a2a162889511facd5e073113a2cf3bc4541708ae41f2655b8ff53b1255b5920eab4a4286417ee39207a7a5
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,29 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v2.6.
|
3
|
+
## [v2.6.1](https://github.com/adiwg/mdTranslator/tree/v2.6.1)
|
4
4
|
|
5
|
+
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.6.0...v2.6.1)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Include citation.onlineResource and metadataOnlineResource in webLinks [\#165](https://github.com/adiwg/mdTranslator/issues/165)
|
10
|
+
|
11
|
+
**Fixed bugs:**
|
12
|
+
|
13
|
+
- sbJSON identifier objects are not unique [\#162](https://github.com/adiwg/mdTranslator/issues/162)
|
14
|
+
- Metadata identifier is not written to sbJSON [\#160](https://github.com/adiwg/mdTranslator/issues/160)
|
15
|
+
|
16
|
+
**Closed issues:**
|
17
|
+
|
18
|
+
- add 'Agreement Number' to sbJson budget facet [\#166](https://github.com/adiwg/mdTranslator/issues/166)
|
19
|
+
- handle 80 character keyword length in sbJson writer [\#164](https://github.com/adiwg/mdTranslator/issues/164)
|
20
|
+
- sbJson reader should not import short abstract [\#163](https://github.com/adiwg/mdTranslator/issues/163)
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- Patches and enhancements to sbJson reader and writer [\#167](https://github.com/adiwg/mdTranslator/pull/167) ([stansmith907](https://github.com/stansmith907))
|
25
|
+
|
26
|
+
## [v2.6.0](https://github.com/adiwg/mdTranslator/tree/v2.6.0) (2017-11-11)
|
5
27
|
[Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.5.0...v2.6.0)
|
6
28
|
|
7
29
|
**Fixed bugs:**
|
data/Rakefile
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc contact
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2017-11-27 add support for 'memberOfOrgs'
|
5
6
|
# Stan Smith 2017-08-25 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -24,6 +25,8 @@ module ADIWG
|
|
24
25
|
contactType = nil
|
25
26
|
personName = ''
|
26
27
|
orgName = ''
|
28
|
+
personId = nil
|
29
|
+
orgId = nil
|
27
30
|
xContactInfo = xContact.xpath('./cntinfo')
|
28
31
|
unless xContactInfo.empty?
|
29
32
|
|
@@ -60,6 +63,13 @@ module ADIWG
|
|
60
63
|
hContact = Fgdc.get_contact_by_id(personId) if contactType == 'person'
|
61
64
|
hContact = Fgdc.get_contact_by_id(orgId) if contactType == 'organization'
|
62
65
|
|
66
|
+
# contact - member of organization
|
67
|
+
if contactType == 'person'
|
68
|
+
unless orgId.nil?
|
69
|
+
hContact[:memberOfOrgs] << orgId
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
63
73
|
# contact 10.3 (cntpos) - contact position
|
64
74
|
position = xContactInfo.xpath('./cntpos').text
|
65
75
|
if contactType == 'person'
|
@@ -21,7 +21,7 @@ module ADIWG
|
|
21
21
|
# instance classes needed in script
|
22
22
|
intMetadataClass = InternalMetadata.new
|
23
23
|
|
24
|
-
#
|
24
|
+
# keywords 1.6.1 (theme) - thematic keywords {keyword}
|
25
25
|
axTheme = xKeywords.xpath('./theme')
|
26
26
|
unless axTheme.empty?
|
27
27
|
axTheme.each do |xTheme|
|
@@ -50,7 +50,7 @@ module ADIWG
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# if keyword thesaurus is 'ISO 19115 Topic Category'
|
53
|
-
# convert to ISO topic categories
|
53
|
+
# also convert to ISO topic categories
|
54
54
|
if hKeyword[:thesaurus][:title] == 'ISO 19115 Topic Category'
|
55
55
|
hKeyword[:keywords].each do |hKeyObj|
|
56
56
|
hResourceInfo[:topicCategories] << hKeyObj[:keyword]
|
@@ -65,7 +65,7 @@ module ADIWG
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
#
|
68
|
+
# keywords 1.6.2 (place) - place keywords {keyword}
|
69
69
|
axPlace = xKeywords.xpath('./place')
|
70
70
|
unless axPlace.empty?
|
71
71
|
axPlace.each do |xPlace|
|
@@ -100,7 +100,7 @@ module ADIWG
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
#
|
103
|
+
# keywords 1.6.3 (stratum) - stratum keywords {keyword}
|
104
104
|
axStratum = xKeywords.xpath('./stratum')
|
105
105
|
unless axStratum.empty?
|
106
106
|
axStratum.each do |xStratum|
|
@@ -135,7 +135,7 @@ module ADIWG
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
-
#
|
138
|
+
# keywords 1.6.4 (temporal) - temporal keywords {keyword}
|
139
139
|
axTemporal = xKeywords.xpath('./temporal')
|
140
140
|
unless axTemporal.empty?
|
141
141
|
axTemporal.each do |xTemporal|
|
@@ -170,7 +170,7 @@ module ADIWG
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
-
#
|
173
|
+
# keywords bio (keywtax) - taxonomy keywords {keyword}
|
174
174
|
nodeName = xKeywords.xpath('./*').first.name
|
175
175
|
if nodeName == 'keywtax'
|
176
176
|
hKeyword = intMetadataClass.newKeyword
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# unpack fgdc spatial domain
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2017-11-25 fix: allows multiple bounding polygons
|
5
6
|
# Stan Smith 2017-08-22 original script
|
6
7
|
|
7
8
|
require 'nokogiri'
|
@@ -59,14 +60,15 @@ module ADIWG
|
|
59
60
|
|
60
61
|
# instance classes needed in script
|
61
62
|
intMetadataClass = InternalMetadata.new
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
hIntExtent = intMetadataClass.newExtent
|
64
|
+
hIntGeoExtent = intMetadataClass.newGeographicExtent
|
65
|
+
hIntExtent[:geographicExtents] << hIntGeoExtent
|
66
|
+
hIntExtent[:description] = 'FGDC spatial domain'
|
65
67
|
|
66
68
|
# spatial domain bio (descgeog) - geographic description
|
67
69
|
description = xDomain.xpath('./descgeog').text
|
68
70
|
unless description.empty?
|
69
|
-
|
71
|
+
hIntGeoExtent[:description] = description
|
70
72
|
end
|
71
73
|
|
72
74
|
# spatial domain 1.5.1 (bounding) - bounding box
|
@@ -101,103 +103,115 @@ module ADIWG
|
|
101
103
|
|
102
104
|
end
|
103
105
|
|
104
|
-
|
106
|
+
hIntGeoExtent[:boundingBox] = hBbox
|
105
107
|
end
|
106
108
|
|
107
|
-
# spatial domain 1.5.2 (dsgpoly) - data set geographic polygon
|
108
|
-
|
109
|
-
unless
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
109
|
+
# spatial domain 1.5.2 (dsgpoly) - data set geographic polygon []
|
110
|
+
axPoly = xDomain.xpath('//dsgpoly')
|
111
|
+
unless axPoly.empty?
|
112
|
+
|
113
|
+
# start new feature collection
|
114
|
+
hIntCollect = intMetadataClass.newFeatureCollection
|
115
|
+
hIntCollect[:type] = 'FeatureCollection'
|
116
|
+
hCollection = {
|
117
|
+
'type' => 'FeatureCollection',
|
118
|
+
'features' => []
|
119
|
+
}
|
120
|
+
|
121
|
+
axPoly.each do |xPoly|
|
122
|
+
|
123
|
+
# place the polygon in a feature
|
124
|
+
polygon = []
|
125
|
+
|
126
|
+
# polygon 1.5.2.1 (dsgpolyo) - polygon outer ring
|
127
|
+
xOring = xPoly.xpath('./dsgpolyo')
|
128
|
+
unless xOring.empty?
|
129
|
+
|
130
|
+
# outer ring 1.5.2.1.1 (grngpoin) - g ring point
|
131
|
+
# outer ring 1.5.2.1.2 (gring) - g ring
|
132
|
+
# outer ring must be counterclockwise
|
133
|
+
aOutCoords = process_polygon(xOring)
|
134
|
+
unless aOutCoords.empty?
|
135
|
+
if AdiwgCoordinates.is_polygon_clockwise(aOutCoords)
|
136
|
+
aOutCoords.reverse!
|
137
|
+
end
|
138
|
+
polygon << aOutCoords
|
124
139
|
end
|
125
|
-
polygon << aOutCoords
|
126
|
-
end
|
127
140
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
+
# first ring must be outer
|
142
|
+
# only process if already have outer ring
|
143
|
+
# polygon 1.5.2.2 (dsgpolyx) - polygon exclusion ring []
|
144
|
+
axXring = xPoly.xpath('./dsgpolyx')
|
145
|
+
unless axXring.empty?
|
146
|
+
axXring.each do |xRing|
|
147
|
+
|
148
|
+
# exclusion ring 1.5.2.2.1 (grngpoin) - g ring point
|
149
|
+
# exclusion ring 1.5.2.2.2 (gring) - g ring
|
150
|
+
# exclusion ring must be clockwise
|
151
|
+
aInCoords = process_polygon(xRing)
|
152
|
+
unless aInCoords.empty?
|
153
|
+
unless AdiwgCoordinates.is_polygon_clockwise(aInCoords)
|
154
|
+
aInCoords.reverse!
|
155
|
+
end
|
156
|
+
polygon << aInCoords
|
157
|
+
end
|
158
|
+
|
141
159
|
end
|
142
|
-
polygon << aInCoords
|
143
160
|
end
|
144
161
|
|
145
162
|
end
|
146
|
-
end
|
147
163
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
164
|
+
unless polygon.empty?
|
165
|
+
|
166
|
+
# make geoJson FeatureCollection from polygon
|
167
|
+
hGeometry = {
|
168
|
+
'type' => 'Polygon',
|
169
|
+
'coordinates' => polygon
|
170
|
+
}
|
171
|
+
hFeature = {
|
172
|
+
'type' => 'Feature',
|
173
|
+
'geometry' => hGeometry,
|
174
|
+
'properties' => {
|
175
|
+
'description' => 'FGDC bounding polygon'
|
176
|
+
}
|
160
177
|
}
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
hIntCollect[:type] = 'FeatureCollection'
|
185
|
-
hIntCollect[:features] << hIntFeature
|
186
|
-
hIntCollect[:nativeGeoJson] = hCollection
|
187
|
-
|
188
|
-
hGeoExtent[:geographicElements] << hIntCollect
|
189
|
-
hGeoExtent[:nativeGeoJson] << geoJson
|
190
|
-
|
191
|
-
hExtent[:description] = 'FGDC spatial domain'
|
178
|
+
hCollection['features'] << hFeature
|
179
|
+
|
180
|
+
# make internal geometry object from polygon
|
181
|
+
hIntGeo = intMetadataClass.newGeometryObject
|
182
|
+
hIntGeo[:type] = 'Polygon'
|
183
|
+
hIntGeo[:coordinates] = polygon
|
184
|
+
hIntGeo[:nativeGeoJson] = hGeometry
|
185
|
+
|
186
|
+
# make internal geometry feature from geometry object
|
187
|
+
hIntFeature = intMetadataClass.newGeometryFeature
|
188
|
+
hIntFeature[:type] = 'Feature'
|
189
|
+
hIntFeature[:geometryObject] = hIntGeo
|
190
|
+
hIntFeature[:nativeGeoJson] = hFeature
|
191
|
+
|
192
|
+
# add properties to geometry feature
|
193
|
+
hIntProps = intMetadataClass.newGeometryProperties
|
194
|
+
hIntProps[:description] = 'FGDC bounding polygon'
|
195
|
+
hIntFeature[:properties] = hIntProps
|
196
|
+
|
197
|
+
# place feature into collection
|
198
|
+
# the collection nativeGeoJson is rewritten each pass
|
199
|
+
hIntCollect[:features] << hIntFeature
|
200
|
+
hIntCollect[:nativeGeoJson] = hCollection
|
192
201
|
|
202
|
+
end
|
193
203
|
end
|
194
|
-
end
|
195
204
|
|
196
|
-
|
205
|
+
# place collection into geographic extent
|
206
|
+
hIntGeoExtent[:geographicElements] << hIntCollect
|
207
|
+
hIntGeoExtent[:nativeGeoJson] << hIntCollect[:nativeGeoJson]
|
197
208
|
|
198
|
-
|
209
|
+
end
|
210
|
+
|
211
|
+
return hIntExtent
|
199
212
|
|
200
|
-
|
213
|
+
end # unpack
|
214
|
+
end # SpatialDomain
|
201
215
|
|
202
216
|
end
|
203
217
|
end
|
@@ -65,6 +65,9 @@ module ADIWG
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# time period 9.2 (mdattim) - multiple date times
|
68
|
+
# -> place into timePeriod since mdJson does not handle multi-date
|
69
|
+
# -> did not put multi-date in temporalExtent since it would be
|
70
|
+
# -> difficult to return it to the same context
|
68
71
|
xMulti = xTimeInfo.xpath('./mdattim')
|
69
72
|
unless xMulti.empty?
|
70
73
|
|
@@ -16,3 +16,7 @@ Standards that are now encouraged for use.
|
|
16
16
|
|
17
17
|
The FGDC CSDGM format standard is fully documented on the
|
18
18
|
[Content Standard for Digital Geospatial Metadata page](https://www.fgdc.gov/metadata/csdgm-standard).
|
19
|
+
|
20
|
+
This FGDC reader extends the FGDC standard by added the Biological Data Profile
|
21
|
+
FGDC-STD-001.1-1999 as defined by the U.S. Geological Survey National Biological
|
22
|
+
Information Infrastructure (NBII).
|