adiwg-mdtranslator 2.18.4 → 2.19.0.pre.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +14 -0
- data/Gemfile.lock +11 -9
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +27 -11
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +149 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +8 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQualityReport.rb +8 -16
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityMeasure.rb +34 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityResultFile.rb +72 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_contact.rb +13 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_quality.rb → class_dataQuality.rb} +14 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +39 -18
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +213 -39
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_qualityResultFile.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_rangeElementDescription.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQualityReport.rb +12 -10
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_funding.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityResultFile.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_standaloneQualityReport.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +10 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_additionalDocumentation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_algorithm.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_associatedResource.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attributeGroup.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +12 -17
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_citation.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_classedData.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_constraint.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_contact.rb +37 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_coverageInfo.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataDictionary.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +31 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distributor.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domain.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domainItem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entity.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entityAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_extent.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_feature.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureProperties.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_format.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_funding.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geodeticParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicElement.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb +4 -14
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georectifiedRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georeferenceableRepresentation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_gridRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_imageInfo.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_keyword.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataInfo.rb +9 -9
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataRepository.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processing.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceInfo.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_responsibility.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_scope.rb +12 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_source.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_taxonomy.rb +1 -1
- metadata +23 -13
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +0 -181
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_bodyScript.js +0 -317
@@ -1,317 +0,0 @@
|
|
1
|
-
|
2
|
-
//forEach Polyfill, Reference: https://goo.gl/hFIfSd
|
3
|
-
if (!Array.prototype.forEach) {
|
4
|
-
Array.prototype.forEach = function(callback, thisArg) {
|
5
|
-
var T, k;
|
6
|
-
if (this === null || this === undefined) {
|
7
|
-
throw new TypeError(' this is null or not defined');
|
8
|
-
}
|
9
|
-
var O = Object(this);
|
10
|
-
var len = O.length >>> 0;
|
11
|
-
if ( typeof callback !== "function") {
|
12
|
-
throw new TypeError(callback + ' is not a function');
|
13
|
-
}
|
14
|
-
if (arguments.length > 1) {
|
15
|
-
T = thisArg;
|
16
|
-
}
|
17
|
-
k = 0;
|
18
|
-
while (k < len) {
|
19
|
-
var kValue;
|
20
|
-
if ( k in O) {
|
21
|
-
kValue = O[k];
|
22
|
-
callback.call(T, kValue, k, O);
|
23
|
-
}
|
24
|
-
k++;
|
25
|
-
}
|
26
|
-
};
|
27
|
-
}
|
28
|
-
|
29
|
-
// open detail panel in the document
|
30
|
-
function openDetail(evt) {
|
31
|
-
var href = evt.target.getAttribute("href");
|
32
|
-
href = href.slice(1);
|
33
|
-
|
34
|
-
if(window.location !== window.parent.location){
|
35
|
-
evt.preventDefault();
|
36
|
-
var el = document.getElementById(href);
|
37
|
-
window.scrollTo(0, el.offsetTop);
|
38
|
-
}
|
39
|
-
var parentNode = document.getElementById(href).parentNode;
|
40
|
-
parentNode.open = true;
|
41
|
-
}
|
42
|
-
|
43
|
-
// open all detail panels in the document
|
44
|
-
function openAllDetails(evt) {
|
45
|
-
if(window.location !== window.parent.location){
|
46
|
-
evt.preventDefault();
|
47
|
-
}
|
48
|
-
var arr = document.getElementsByTagName("details");
|
49
|
-
var len = arr.length;
|
50
|
-
|
51
|
-
for (var i = 0; i < len; i++) {
|
52
|
-
arr[i].open = true;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
// close all detail panels in the document
|
57
|
-
function closeAllDetails(evt) {
|
58
|
-
if(window.location !== window.parent.location){
|
59
|
-
evt.preventDefault();
|
60
|
-
}
|
61
|
-
var arr = document.getElementsByTagName("details");
|
62
|
-
var len = arr.length;
|
63
|
-
|
64
|
-
for (var i = 0; i < len; i++) {
|
65
|
-
arr[i].open = false;
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
// add event listeners to all anchor buttons in the sideNav
|
70
|
-
var navBtnList = document.querySelectorAll('a.navBtn');
|
71
|
-
var navBtnArray = Array.prototype.slice.call(navBtnList);
|
72
|
-
navBtnArray.forEach(function(btn, btnIdx, btnArr) {
|
73
|
-
var href = btn.getAttribute("href").slice(1);
|
74
|
-
var target = document.getElementById(href);
|
75
|
-
//hide button if target is not present
|
76
|
-
if(target) {
|
77
|
-
btn.addEventListener("click", openDetail, false);
|
78
|
-
} else {
|
79
|
-
btn.style.display = 'none';
|
80
|
-
}
|
81
|
-
});
|
82
|
-
|
83
|
-
// add event listener to openAllButton
|
84
|
-
var elOpen = document.getElementById("openAllButton");
|
85
|
-
elOpen.addEventListener("click", openAllDetails, false);
|
86
|
-
|
87
|
-
// add event listener to closeAllButton
|
88
|
-
var elClose = document.getElementById("closeAllButton");
|
89
|
-
elClose.addEventListener("click", closeAllDetails, false);
|
90
|
-
|
91
|
-
//replace top links in inframes
|
92
|
-
if(window.location !== window.parent.location){
|
93
|
-
// add event listeners to all "top" links
|
94
|
-
var topList = document.querySelectorAll("a[href='#']");
|
95
|
-
var topArray = Array.prototype.slice.call(topList);
|
96
|
-
topArray.forEach(function(a) {
|
97
|
-
a.addEventListener("click", function(evt) {
|
98
|
-
evt.preventDefault();
|
99
|
-
window.scrollTo(0,0);
|
100
|
-
}, false);
|
101
|
-
});
|
102
|
-
}
|
103
|
-
|
104
|
-
if ( typeof L === "object") {
|
105
|
-
(function() {
|
106
|
-
|
107
|
-
var westBound;
|
108
|
-
var eastBound;
|
109
|
-
|
110
|
-
var coordsToLatLng = function(coords) {
|
111
|
-
// if computed bounding box spans the antimeridian
|
112
|
-
// add 360 to negative longitudes
|
113
|
-
var longitude = coords[0];
|
114
|
-
if (westBound >= 0 && eastBound < 0) {
|
115
|
-
if (longitude < 0) {
|
116
|
-
longitude += 360;
|
117
|
-
}
|
118
|
-
}
|
119
|
-
var latitude = coords[1];
|
120
|
-
return L.latLng(latitude, longitude);
|
121
|
-
};
|
122
|
-
|
123
|
-
var bbox2Poly = function(bbox) {
|
124
|
-
var bboxJson = JSON.parse(bbox.textContent || bbox.innerText);
|
125
|
-
var sw = [ bboxJson.westLongitude, bboxJson.southLatitude ];
|
126
|
-
var nw = [ bboxJson.westLongitude, bboxJson.northLatitude ];
|
127
|
-
var ne = [ bboxJson.eastLongitude, bboxJson.northLatitude ];
|
128
|
-
var se = [ bboxJson.eastLongitude, bboxJson.southLatitude ];
|
129
|
-
var coords = [];
|
130
|
-
coords.push(sw);
|
131
|
-
coords.push(nw);
|
132
|
-
coords.push(ne);
|
133
|
-
coords.push(se);
|
134
|
-
var bboxCoods = [];
|
135
|
-
bboxCoods.push(coords);
|
136
|
-
return bboxCoods;
|
137
|
-
};
|
138
|
-
|
139
|
-
// collect all geographicExtents sections in document
|
140
|
-
var geoExtentNodeList = document.querySelectorAll('section.extent-geographic');
|
141
|
-
var geoExtents = Array.prototype.slice.call(geoExtentNodeList);
|
142
|
-
|
143
|
-
var check = function(i, me, bnds) {
|
144
|
-
if (i < 3) {
|
145
|
-
var resize = me.getSize().x === 0 && me.getContainer().offsetWidth > 0;
|
146
|
-
|
147
|
-
me.invalidateSize();
|
148
|
-
if (resize) {
|
149
|
-
me.fitBounds(bnds);
|
150
|
-
} else {
|
151
|
-
i++;
|
152
|
-
setTimeout(function() {
|
153
|
-
check(i, me, bnds);
|
154
|
-
}, 100);
|
155
|
-
}
|
156
|
-
}
|
157
|
-
};
|
158
|
-
|
159
|
-
geoExtents.forEach(function(geoExtent, idx, arr) {
|
160
|
-
// instantiate a leaflet map in the map div
|
161
|
-
var map = L.map(geoExtent.querySelector('div.map'), {noWrap: true});
|
162
|
-
// get a pointer to the map header switch
|
163
|
-
var header = geoExtent.querySelector('summary.map-summary');
|
164
|
-
// get the GeoJSON from the geojson div
|
165
|
-
var geoJsonDiv = geoExtent.querySelector('div.geojson');
|
166
|
-
if (geoJsonDiv) {
|
167
|
-
var geojson = JSON.parse(geoJsonDiv.textContent || geoJsonDiv.innerText);
|
168
|
-
}
|
169
|
-
else {
|
170
|
-
var geojson = [];
|
171
|
-
}
|
172
|
-
// get the user provided bounding box for the extent - if any
|
173
|
-
var userBBox = geoExtent.querySelector('div.userBBox');
|
174
|
-
if (userBBox) {
|
175
|
-
var userCoords = bbox2Poly(userBBox);
|
176
|
-
var newUserBBox = {
|
177
|
-
"type": "Feature",
|
178
|
-
"geometry": {
|
179
|
-
"type": "Polygon",
|
180
|
-
"coordinates": userCoords
|
181
|
-
},
|
182
|
-
"properties": {
|
183
|
-
"style": {
|
184
|
-
"color": '#f00',
|
185
|
-
"fill": false
|
186
|
-
},
|
187
|
-
"featureName": [
|
188
|
-
"User BBOX"
|
189
|
-
]
|
190
|
-
}
|
191
|
-
};
|
192
|
-
geojson.push(newUserBBox);
|
193
|
-
}
|
194
|
-
|
195
|
-
// get the computed bounding box for the extent - always one
|
196
|
-
var computedBBox = geoExtent.querySelector('div.computedBBox');
|
197
|
-
if (computedBBox) {
|
198
|
-
var compCoords = bbox2Poly(computedBBox);
|
199
|
-
var newCompBBox = {
|
200
|
-
"type": "Feature",
|
201
|
-
"geometry": {
|
202
|
-
"type": "Polygon",
|
203
|
-
"coordinates": compCoords
|
204
|
-
},
|
205
|
-
"properties": {
|
206
|
-
"style": {
|
207
|
-
"color": '#0f0',
|
208
|
-
"fill": false
|
209
|
-
},
|
210
|
-
"featureName": [
|
211
|
-
"Computed BBOX"
|
212
|
-
]
|
213
|
-
}
|
214
|
-
};
|
215
|
-
geojson.push(newCompBBox);
|
216
|
-
westBound = compCoords[0][0][0];
|
217
|
-
eastBound = compCoords[0][2][0];
|
218
|
-
}
|
219
|
-
|
220
|
-
var pointCnt = 0;
|
221
|
-
var lineStringCnt = 0;
|
222
|
-
var polygonCnt = 0;
|
223
|
-
var geoCollectCnt = 0;
|
224
|
-
var featureCnt = 0;
|
225
|
-
|
226
|
-
geojson.forEach(function(geo, geoIdx, geoArr) {
|
227
|
-
|
228
|
-
// make sure each geo has a properties object
|
229
|
-
if (!geo.properties) {
|
230
|
-
geo.properties = {};
|
231
|
-
}
|
232
|
-
|
233
|
-
// add popup information
|
234
|
-
if (geo.type === "Point") {
|
235
|
-
pointCnt += 1;
|
236
|
-
geo.properties.popup = "Point " + pointCnt;
|
237
|
-
}
|
238
|
-
if (geo.type === 'LineString') {
|
239
|
-
lineStringCnt += 1;
|
240
|
-
geo.properties.popup = "LineString " + lineStringCnt;
|
241
|
-
}
|
242
|
-
if (geo.type === 'Polygon') {
|
243
|
-
polygonCnt += 1;
|
244
|
-
geo.properties.popup = "Polygon " + polygonCnt;
|
245
|
-
}
|
246
|
-
if (geo.type === 'GeometryCollection') {
|
247
|
-
geoCollectCnt += 1;
|
248
|
-
geo.properties.popup = "Geometry Collection " + geoCollectCnt;
|
249
|
-
// popup can't find properties on collection objects
|
250
|
-
// placed popup on geometry collection instead
|
251
|
-
// geo.geometries.forEach(function (geoG, geoGIdx, geoGArr) {
|
252
|
-
// geoG.properties = {};
|
253
|
-
// geoG.properties.popup = "Geometry Collection " + geoCollectCnt + " " + geoG.type;
|
254
|
-
// });
|
255
|
-
}
|
256
|
-
if (geo.type === 'Feature') {
|
257
|
-
featureCnt += 1;
|
258
|
-
var featureName;
|
259
|
-
if (geo.properties.featureName !== undefined) {
|
260
|
-
featureName = geo.properties.featureName[0] || geo.id || geo.geometry.type;
|
261
|
-
} else featureName = geo.id || "Feature " + featureCnt + " " + geo.geometry.type;
|
262
|
-
geo.properties.popup = featureName;
|
263
|
-
}
|
264
|
-
if (geo.type === 'FeatureCollection') {
|
265
|
-
geo.features.forEach(function (geoF, geoFIdx, geoFArr) {
|
266
|
-
featureCnt += 1;
|
267
|
-
var featureName;
|
268
|
-
if (geoF.properties.featureName !== undefined) {
|
269
|
-
featureName = geoF.properties.featureName[0] || geoF.id || geoF.geometry.type;
|
270
|
-
} else featureName = geoF.id || "Feature " + featureCnt + " " + geoF.geometry.type;
|
271
|
-
geoF.properties.popup = featureName;
|
272
|
-
});
|
273
|
-
}
|
274
|
-
|
275
|
-
});
|
276
|
-
|
277
|
-
var geoLayer = L.geoJSON(geojson, {
|
278
|
-
style: function(feature) {
|
279
|
-
return feature.properties.style || {};
|
280
|
-
},
|
281
|
-
coordsToLatLng: coordsToLatLng,
|
282
|
-
onEachFeature: function (feature, layer) {
|
283
|
-
layer.bindPopup(feature.properties.popup,{
|
284
|
-
closeButton: true
|
285
|
-
});
|
286
|
-
}
|
287
|
-
}).addTo(map);
|
288
|
-
|
289
|
-
var bnds = geoLayer.getBounds();
|
290
|
-
map.fitBounds(bnds);
|
291
|
-
|
292
|
-
L.DomEvent.addListener(header, 'click', function() {
|
293
|
-
var me = this;
|
294
|
-
var i = 0;
|
295
|
-
|
296
|
-
setTimeout(function() {
|
297
|
-
check(i, me, bnds);
|
298
|
-
}, 100);
|
299
|
-
|
300
|
-
}, map);
|
301
|
-
|
302
|
-
L.DomEvent.addListener(L.DomUtil.get('openAllButton'), 'click', function() {
|
303
|
-
var me = this;
|
304
|
-
var i = 0;
|
305
|
-
|
306
|
-
setTimeout(function() {
|
307
|
-
check(i, me, bnds);
|
308
|
-
}, 100);
|
309
|
-
|
310
|
-
}, map);
|
311
|
-
|
312
|
-
// map.addLayer(new L.TileLayer.OSM());
|
313
|
-
var stamen = new L.StamenTileLayer("terrain");
|
314
|
-
map.addLayer(stamen);
|
315
|
-
});
|
316
|
-
})();
|
317
|
-
}
|