@loaders.gl/wms 3.4.0-alpha.4 → 3.4.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +25 -0
- package/dist/es5/csw-capabilities-loader.js +1 -1
- package/dist/es5/csw-domain-loader.js +1 -1
- package/dist/es5/csw-records-loader.js +1 -1
- package/dist/es5/gml-loader.js +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lerc-loader.js +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +33 -0
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/es5/lib/sources/image-source.js.map +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
- package/dist/es5/wms-capabilities-loader.js +1 -1
- package/dist/es5/wms-error-loader.js +1 -1
- package/dist/esm/csw-capabilities-loader.js +1 -1
- package/dist/esm/csw-domain-loader.js +1 -1
- package/dist/esm/csw-records-loader.js +1 -1
- package/dist/esm/gml-loader.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lerc-loader.js +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js +33 -0
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/esm/lib/sources/image-source.js.map +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
- package/dist/esm/wms-capabilities-loader.js +1 -1
- package/dist/esm/wms-error-loader.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts +24 -0
- package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts.map +1 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +32 -0
- package/dist/lib/sources/image-source.d.ts +1 -1
- package/dist/lib/sources/image-source.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-capabilities.ts +64 -0
- package/src/lib/sources/image-source.ts +3 -1
package/dist/dist.min.js
CHANGED
|
@@ -2224,6 +2224,11 @@
|
|
|
2224
2224
|
if (boundingBoxes && boundingBoxes.length > 0) {
|
|
2225
2225
|
layer.boundingBoxes = boundingBoxes;
|
|
2226
2226
|
}
|
|
2227
|
+
const xmlDimensions = getXMLArray(xmlLayer?.Dimension);
|
|
2228
|
+
const dimensions = xmlDimensions.map((xml) => extractDimension(xml));
|
|
2229
|
+
if (dimensions.length) {
|
|
2230
|
+
layer.dimensions = dimensions;
|
|
2231
|
+
}
|
|
2227
2232
|
if (xmlLayer?.opaque) {
|
|
2228
2233
|
layer.opaque = getXMLBoolean(xmlLayer?.opaque);
|
|
2229
2234
|
}
|
|
@@ -2288,6 +2293,26 @@
|
|
|
2288
2293
|
}
|
|
2289
2294
|
return boundingBox;
|
|
2290
2295
|
}
|
|
2296
|
+
function extractDimension(xmlDimension) {
|
|
2297
|
+
const { name, units, value: extent } = xmlDimension;
|
|
2298
|
+
const dimension = { name, units, extent };
|
|
2299
|
+
if (xmlDimension.unitSymbol) {
|
|
2300
|
+
dimension.unitSymbol = xmlDimension.unitSymbol;
|
|
2301
|
+
}
|
|
2302
|
+
if (xmlDimension.default) {
|
|
2303
|
+
dimension.defaultValue = xmlDimension.default;
|
|
2304
|
+
}
|
|
2305
|
+
if (xmlDimension.multipleValues) {
|
|
2306
|
+
dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);
|
|
2307
|
+
}
|
|
2308
|
+
if (xmlDimension.nearestValue) {
|
|
2309
|
+
dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);
|
|
2310
|
+
}
|
|
2311
|
+
if (xmlDimension.current) {
|
|
2312
|
+
dimension.current = getXMLBoolean(xmlDimension.current);
|
|
2313
|
+
}
|
|
2314
|
+
return dimension;
|
|
2315
|
+
}
|
|
2291
2316
|
function addInheritedLayerProps(layer, parent) {
|
|
2292
2317
|
if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {
|
|
2293
2318
|
layer.geographicBoundingBox = [...parent.geographicBoundingBox];
|
|
@@ -8,7 +8,7 @@ exports._typecheckCSWCapabilitiesLoader = exports.CSWCapabilitiesLoader = void 0
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseCswCapabilities = require("./lib/parsers/csw/parse-csw-capabilities");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var CSWCapabilitiesLoader = {
|
|
13
13
|
id: 'csw-capabilities',
|
|
14
14
|
name: 'CSW Capabilities',
|
|
@@ -8,7 +8,7 @@ exports._typecheckCSWDomainLoader = exports.CSWDomainLoader = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseCswDomain = require("./lib/parsers/csw/parse-csw-domain");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var CSWDomainLoader = {
|
|
13
13
|
id: 'csw-domain',
|
|
14
14
|
name: 'CSW Domain',
|
|
@@ -8,7 +8,7 @@ exports.CSWRecordsLoader = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseCswRecords = require("./lib/parsers/csw/parse-csw-records");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var CSWRecordsLoader = {
|
|
13
13
|
id: 'csw-records',
|
|
14
14
|
name: 'CSW Domain',
|
package/dist/es5/gml-loader.js
CHANGED
|
@@ -8,7 +8,7 @@ exports._typecheckGMLLoader = exports.GMLLoader = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseGml = require("./lib/parsers/gml/parse-gml");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var GMLLoader = {
|
|
13
13
|
name: 'GML',
|
|
14
14
|
id: 'gml',
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_cswCapabilitiesLoader","require","_cswDomainLoader","_cswRecordsLoader","_wmsErrorLoader","_wmsCapabilitiesLoader","_wmsFeatureInfoLoader","_wmsLayerDescriptionLoader","_wfsCapabilitiesLoader","_gmlLoader","_imageSource","_createImageSource","_imageService","_cswService","_wmsService","_arcgisServer","_arcgisImageService"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {WMSLoaderOptions} from './wms-capabilities-loader';\n\nexport type {WMSCapabilities} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["_cswCapabilitiesLoader","require","_cswDomainLoader","_cswRecordsLoader","_wmsErrorLoader","_wmsCapabilitiesLoader","_wmsFeatureInfoLoader","_wmsLayerDescriptionLoader","_wfsCapabilitiesLoader","_gmlLoader","_imageSource","_createImageSource","_imageService","_cswService","_wmsService","_arcgisServer","_arcgisImageService"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {WMSLoaderOptions} from './wms-capabilities-loader';\n\nexport type {WMSCapabilities} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {ImageType} from '@loaders.gl/images';\nexport type {ImageSourceProps, ImageSourceMetadata} from './lib/sources/image-source';\nexport {ImageSource} from './lib/sources/image-source';\n\nexport type {ImageServiceType} from './lib/create-image-source';\nexport {createImageSource} from './lib/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/generic/image-service';\nexport {ImageService} from './lib/services/generic/image-service';\n\n// OGC Services\n\nexport {CSWService} from './lib/services/ogc/csw-service';\nexport {WMSService} from './lib/services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './lib/services/arcgis/arcgis-server';\nexport {ArcGISImageServer as _ArcGISImageServer} from './lib/services/arcgis/arcgis-image-service';\n\n// LERC - Limited Error Raster Compression\n// TODO - restore once esbuild bundling issues have been resolved\n// export type {LERCData} from './lib/lerc/lerc-types';\n// export {LERCLoader} from './lerc-loader';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,sBAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAD,OAAA;AAGA,IAAAE,iBAAA,GAAAF,OAAA;AAIA,IAAAG,eAAA,GAAAH,OAAA;AAKA,IAAAI,sBAAA,GAAAJ,OAAA;AAGA,IAAAK,qBAAA,GAAAL,OAAA;AAGA,IAAAM,0BAAA,GAAAN,OAAA;AAaA,IAAAO,sBAAA,GAAAP,OAAA;AAMA,IAAAQ,UAAA,GAAAR,OAAA;AAMA,IAAAS,YAAA,GAAAT,OAAA;AAGA,IAAAU,kBAAA,GAAAV,OAAA;AAKA,IAAAW,aAAA,GAAAX,OAAA;AAIA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAIA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAf,OAAA"}
|
package/dist/es5/lerc-loader.js
CHANGED
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var Lerc = _interopRequireWildcard(require("lerc"));
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
14
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
15
15
|
var LERCLoader = {
|
|
16
16
|
id: 'lerc',
|
|
17
17
|
name: 'LERC',
|
|
@@ -134,6 +134,13 @@ function extractLayer(xmlLayer) {
|
|
|
134
134
|
if (boundingBoxes && boundingBoxes.length > 0) {
|
|
135
135
|
layer.boundingBoxes = boundingBoxes;
|
|
136
136
|
}
|
|
137
|
+
var xmlDimensions = (0, _parseXmlHelpers.getXMLArray)(xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.Dimension);
|
|
138
|
+
var dimensions = xmlDimensions.map(function (xml) {
|
|
139
|
+
return extractDimension(xml);
|
|
140
|
+
});
|
|
141
|
+
if (dimensions.length) {
|
|
142
|
+
layer.dimensions = dimensions;
|
|
143
|
+
}
|
|
137
144
|
if (xmlLayer !== null && xmlLayer !== void 0 && xmlLayer.opaque) {
|
|
138
145
|
layer.opaque = (0, _parseXmlHelpers.getXMLBoolean)(xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.opaque);
|
|
139
146
|
}
|
|
@@ -211,6 +218,32 @@ function extractWMSBoundingBox(xmlBoundingBox) {
|
|
|
211
218
|
}
|
|
212
219
|
return boundingBox;
|
|
213
220
|
}
|
|
221
|
+
function extractDimension(xmlDimension) {
|
|
222
|
+
var name = xmlDimension.name,
|
|
223
|
+
units = xmlDimension.units,
|
|
224
|
+
extent = xmlDimension.value;
|
|
225
|
+
var dimension = {
|
|
226
|
+
name: name,
|
|
227
|
+
units: units,
|
|
228
|
+
extent: extent
|
|
229
|
+
};
|
|
230
|
+
if (xmlDimension.unitSymbol) {
|
|
231
|
+
dimension.unitSymbol = xmlDimension.unitSymbol;
|
|
232
|
+
}
|
|
233
|
+
if (xmlDimension.default) {
|
|
234
|
+
dimension.defaultValue = xmlDimension.default;
|
|
235
|
+
}
|
|
236
|
+
if (xmlDimension.multipleValues) {
|
|
237
|
+
dimension.multipleValues = (0, _parseXmlHelpers.getXMLBoolean)(xmlDimension.multipleValues);
|
|
238
|
+
}
|
|
239
|
+
if (xmlDimension.nearestValue) {
|
|
240
|
+
dimension.nearestValue = (0, _parseXmlHelpers.getXMLBoolean)(xmlDimension.nearestValue);
|
|
241
|
+
}
|
|
242
|
+
if (xmlDimension.current) {
|
|
243
|
+
dimension.current = (0, _parseXmlHelpers.getXMLBoolean)(xmlDimension.current);
|
|
244
|
+
}
|
|
245
|
+
return dimension;
|
|
246
|
+
}
|
|
214
247
|
function addInheritedLayerProps(layer, parent) {
|
|
215
248
|
if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {
|
|
216
249
|
layer.geographicBoundingBox = (0, _toConsumableArray2.default)(parent.geographicBoundingBox);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-capabilities.js","names":["_xml","require","_parseXmlHelpers","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","parseWMSCapabilities","xmlText","options","parsedXML","XMLLoader","parseTextSync","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","_iterator","layers","_step","layer","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","Service","Name","title","Title","undefined","abstract","Abstract","keywords","getXMLStringArray","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","getXMLInteger","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","getXMLArray","Layer","_iterator2","_step2","xmlSubLayer","push","extractLayer","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray2","default","key","xmlRequests","_iterator3","_step3","_step3$value","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","opaque","getXMLBoolean","cascaded","queryable","_iterator4","_step4","_i2","_Object$entries2","_Object$entries2$_i","xmlBoundingBox","w","westBoundLongitude","northBoundLatitude","eastBoundLongitude","southBoundLatitude","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","map","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","getXMLFloat","xResolution","yResolution","parent","_toConsumableArray2","_iterator5","_step5","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type parseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n\n // xml options are passed through to xml loader\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n xmlText: string,\n options?: parseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: String(xmlLayer?.Name),\n abstract: String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent && parent.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent && parent.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n // TODO inherit other elements\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAMkC,SAAAE,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,EAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,EAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,cAAA,IAAAD,CAAA,WAAAA,CAAA,CAAAQ,MAAA,qBAAAN,EAAA,EAAAF,CAAA,GAAAE,EAA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AA+H,MAAA;EAAA;IAAzC,KAAAD,UAAA,CAAAxK,CAAA,MAAAyK,MAAA,GAAAD,UAAA,CAAAvK,CAAA,IAAAC,IAAA,GAA2C;MAAA,IAAhCwK,QAAQ,GAAAD,MAAA,CAAAtK,KAAA;MACjB0C,sBAAsB,CAAC6H,QAAQ,EAAE9H,KAAK,CAAC;IACzC;EAAC,SAAAlC,GAAA;IAAA8J,UAAA,CAAApK,CAAA,CAAAM,GAAA;EAAA;IAAA8J,UAAA,CAAAlK,CAAA;EAAA;AACH"}
|
|
1
|
+
{"version":3,"file":"parse-wms-capabilities.js","names":["_xml","require","_parseXmlHelpers","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","parseWMSCapabilities","xmlText","options","parsedXML","XMLLoader","parseTextSync","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","_iterator","layers","_step","layer","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","Service","Name","title","Title","undefined","abstract","Abstract","keywords","getXMLStringArray","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","getXMLInteger","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","getXMLArray","Layer","_iterator2","_step2","xmlSubLayer","push","extractLayer","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray2","default","key","xmlRequests","_iterator3","_step3","_step3$value","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","xmlDimensions","Dimension","dimensions","map","extractDimension","opaque","getXMLBoolean","cascaded","queryable","_iterator4","_step4","_i2","_Object$entries2","_Object$entries2$_i","xmlBoundingBox","w","westBoundLongitude","northBoundLatitude","eastBoundLongitude","southBoundLatitude","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","getXMLFloat","xResolution","yResolution","xmlDimension","units","extent","dimension","unitSymbol","defaultValue","multipleValues","nearestValue","current","parent","_toConsumableArray2","_iterator5","_step5","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** any extra dimension such as time */\n dimensions?: WMSDimension[];\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/**\n * An optional dimension that can be queried using the `name=...` parameter\n * Note that layers that have at least one dimension without `default` value\n * become unrenderable unless the dimension value is supplied to GetMap requests.\n */\nexport type WMSDimension = {\n /** name of dimension, becomes a valid parameter key for this layer */\n name: string;\n /** Textual units for this dimensional axis */\n units: string;\n /** Unit symbol for this dimensional axis */\n unitSymbol?: string;\n /** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */\n defaultValue?: string;\n /** Can multiple values of the dimension be requested? */\n multipleValues?: boolean;\n /* Will nearest values will be substituted when out of range, if false exact values are required */\n nearestValue?: boolean;\n /** A special value \"current\" is supported, typically for time dimension */\n current?: boolean;\n /** Text content indicating available values for dimension */\n extent: string;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type parseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n\n // xml options are passed through to xml loader\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n xmlText: string,\n options?: parseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: String(xmlLayer?.Name),\n abstract: String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n // Extract dimensions\n const xmlDimensions = getXMLArray(xmlLayer?.Dimension);\n const dimensions = xmlDimensions.map((xml) => extractDimension(xml));\n if (dimensions.length) {\n layer.dimensions = dimensions;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/**\n * Extracts optional WMS Dimension layer field\n * @param xmlDimension\n * @example <Dimension name=\"time\" units=\"ISO8601\" default=\"2018-01-01\" nearestValue=\"0\">2001-01-01/2018-01-01/P1Y</Dimension>\n * @see https://mapserver.org/ogc/wms_dimension.html\n */\nfunction extractDimension(xmlDimension: any): WMSDimension {\n const {name, units, value: extent} = xmlDimension;\n\n const dimension: WMSDimension = {name, units, extent};\n\n if (xmlDimension.unitSymbol) {\n dimension.unitSymbol = xmlDimension.unitSymbol;\n }\n if (xmlDimension.default) {\n dimension.defaultValue = xmlDimension.default;\n }\n if (xmlDimension.multipleValues) {\n dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);\n }\n if (xmlDimension.nearestValue) {\n dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);\n }\n if (xmlDimension.current) {\n dimension.current = getXMLBoolean(xmlDimension.current);\n }\n\n return dimension;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent && parent.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent && parent.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n // TODO inherit other elements\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAMkC,SAAAE,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QA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yF,aAAa,EAAE;IAC1DzF,KAAK,CAACyF,aAAa,OAAA+C,mBAAA,CAAAtE,OAAA,EAAOqE,MAAM,CAAC9C,aAAa,CAAC;EACjD;EAAC,IAAAgD,UAAA,GAAAjM,0BAAA,CAIsBwD,KAAK,CAACF,MAAM,IAAI,EAAE;IAAA4I,MAAA;EAAA;IAAzC,KAAAD,UAAA,CAAArL,CAAA,MAAAsL,MAAA,GAAAD,UAAA,CAAApL,CAAA,IAAAC,IAAA,GAA2C;MAAA,IAAhCqL,QAAQ,GAAAD,MAAA,CAAAnL,KAAA;MACjB0C,sBAAsB,CAAC0I,QAAQ,EAAE3I,KAAK,CAAC;IACzC;EAAC,SAAAlC,GAAA;IAAA2K,UAAA,CAAAjL,CAAA,CAAAM,GAAA;EAAA;IAAA2K,UAAA,CAAA/K,CAAA;EAAA;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.js","names":["_dataSource","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ImageSource","_DataSource","_inherits2","_super","_classCallCheck2","_createClass2","DataSource","exports"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource
|
|
1
|
+
{"version":3,"file":"image-source.js","names":["_dataSource","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","ImageSource","_DataSource","_inherits2","_super","_classCallCheck2","_createClass2","DataSource","exports"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource<\n PropsT extends ImageSourceProps = ImageSourceProps\n> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":";;;;;;;;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AAAyC,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAP,KAAA,EAAAQ,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAS,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAR,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAQ,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAAA,IAwEnBC,WAAW,aAAAC,WAAA;EAAA,IAAAC,UAAA,CAAAlB,OAAA,EAAAgB,WAAA,EAAAC,WAAA;EAAA,IAAAE,MAAA,GAAA1B,YAAA,CAAAuB,WAAA;EAAA,SAAAA,YAAA;IAAA,IAAAI,gBAAA,CAAApB,OAAA,QAAAgB,WAAA;IAAA,OAAAG,MAAA,CAAAZ,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAe,aAAA,CAAArB,OAAA,EAAAgB,WAAA;AAAA,EAEvBM,sBAAU;AAAAC,OAAA,CAAAP,WAAA,GAAAA,WAAA"}
|
|
@@ -8,7 +8,7 @@ exports._typecheckWFSCapabilitiesLoader = exports.WCSCapabilitiesLoader = void 0
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseWcsCapabilities = require("./lib/wcs/parse-wcs-capabilities");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var WCSCapabilitiesLoader = {
|
|
13
13
|
id: 'wcs-capabilities',
|
|
14
14
|
name: 'WFS Capabilities',
|
|
@@ -8,7 +8,7 @@ exports._typecheckWFSCapabilitiesLoader = exports.WFSCapabilitiesLoader = void 0
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseWfsCapabilities = require("./lib/wfs/parse-wfs-capabilities");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var WFSCapabilitiesLoader = {
|
|
13
13
|
id: 'wfs-capabilities',
|
|
14
14
|
name: 'WFS Capabilities',
|
|
@@ -8,7 +8,7 @@ exports._typecheckWMTSCapabilitiesLoader = exports.WMTSCapabilitiesLoader = void
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseWmtsCapabilities = require("./lib/wmts/parse-wmts-capabilities");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var WMTSCapabilitiesLoader = {
|
|
13
13
|
id: 'wmts-capabilities',
|
|
14
14
|
name: 'WMTS Capabilities',
|
|
@@ -8,7 +8,7 @@ exports._typecheckWMSCapabilitiesLoader = exports.WMSCapabilitiesLoader = void 0
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseWmsCapabilities = require("./lib/parsers/wms/parse-wms-capabilities");
|
|
11
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
12
12
|
var WMSCapabilitiesLoader = {
|
|
13
13
|
id: 'wms-capabilities',
|
|
14
14
|
name: 'WMS Capabilities',
|
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _parseWmsError = require("./lib/parsers/wms/parse-wms-error");
|
|
12
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
var VERSION = typeof "3.4.0-alpha.
|
|
14
|
+
var VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
15
15
|
var WMSErrorLoader = {
|
|
16
16
|
id: 'wms-error',
|
|
17
17
|
name: 'WMS Error',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseCSWCapabilities } from './lib/parsers/csw/parse-csw-capabilities';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const CSWCapabilitiesLoader = {
|
|
4
4
|
id: 'csw-capabilities',
|
|
5
5
|
name: 'CSW Capabilities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseCSWDomain } from './lib/parsers/csw/parse-csw-domain';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const CSWDomainLoader = {
|
|
4
4
|
id: 'csw-domain',
|
|
5
5
|
name: 'CSW Domain',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseCSWRecords } from './lib/parsers/csw/parse-csw-records';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const CSWRecordsLoader = {
|
|
4
4
|
id: 'csw-records',
|
|
5
5
|
name: 'CSW Domain',
|
package/dist/esm/gml-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseGML } from './lib/parsers/gml/parse-gml';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const GMLLoader = {
|
|
4
4
|
name: 'GML',
|
|
5
5
|
id: 'gml',
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","ImageSource","createImageSource","ImageService","CSWService","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageServer","_ArcGISImageServer"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {WMSLoaderOptions} from './wms-capabilities-loader';\n\nexport type {WMSCapabilities} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","ImageSource","createImageSource","ImageService","CSWService","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageServer","_ArcGISImageServer"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {WMSLoaderOptions} from './wms-capabilities-loader';\n\nexport type {WMSCapabilities} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {ImageType} from '@loaders.gl/images';\nexport type {ImageSourceProps, ImageSourceMetadata} from './lib/sources/image-source';\nexport {ImageSource} from './lib/sources/image-source';\n\nexport type {ImageServiceType} from './lib/create-image-source';\nexport {createImageSource} from './lib/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/generic/image-service';\nexport {ImageService} from './lib/services/generic/image-service';\n\n// OGC Services\n\nexport {CSWService} from './lib/services/ogc/csw-service';\nexport {WMSService} from './lib/services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './lib/services/arcgis/arcgis-server';\nexport {ArcGISImageServer as _ArcGISImageServer} from './lib/services/arcgis/arcgis-image-service';\n\n// LERC - Limited Error Raster Compression\n// TODO - restore once esbuild bundling issues have been resolved\n// export type {LERCData} from './lib/lerc/lerc-types';\n// export {LERCLoader} from './lerc-loader';\n"],"mappings":"AAOA,SAAQA,qBAAqB,QAAO,2BAA2B;AAG/D,SAAQC,eAAe,QAAO,qBAAqB;AAGnD,SAAQC,gBAAgB,QAAO,sBAAsB;AAIrD,SAAQC,cAAc,QAAO,oBAAoB;AAKjD,SAAQC,qBAAqB,QAAO,2BAA2B;AAG/D,SAAQC,oBAAoB,IAAIC,qBAAqB,QAAO,+BAA+B;AAG3F,SAAQC,yBAAyB,IAAIC,0BAA0B,QAAO,oCAAoC;AAa1G,SAAQC,qBAAqB,IAAIC,sBAAsB,QAAO,+BAA+B;AAM7F,SAAQC,SAAS,IAAIC,UAAU,QAAO,cAAc;AAMpD,SAAQC,WAAW,QAAO,4BAA4B;AAGtD,SAAQC,iBAAiB,QAAO,2BAA2B;AAK3D,SAAQC,YAAY,QAAO,sCAAsC;AAIjE,SAAQC,UAAU,QAAO,gCAAgC;AACzD,SAAQC,UAAU,QAAO,gCAAgC;AAIzD,SAAQC,iBAAiB,IAAIC,kBAAkB,QAAO,qCAAqC;AAC3F,SAAQC,iBAAiB,IAAIC,kBAAkB,QAAO,4CAA4C"}
|
package/dist/esm/lerc-loader.js
CHANGED
|
@@ -88,6 +88,11 @@ function extractLayer(xmlLayer) {
|
|
|
88
88
|
if (boundingBoxes && boundingBoxes.length > 0) {
|
|
89
89
|
layer.boundingBoxes = boundingBoxes;
|
|
90
90
|
}
|
|
91
|
+
const xmlDimensions = getXMLArray(xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.Dimension);
|
|
92
|
+
const dimensions = xmlDimensions.map(xml => extractDimension(xml));
|
|
93
|
+
if (dimensions.length) {
|
|
94
|
+
layer.dimensions = dimensions;
|
|
95
|
+
}
|
|
91
96
|
if (xmlLayer !== null && xmlLayer !== void 0 && xmlLayer.opaque) {
|
|
92
97
|
layer.opaque = getXMLBoolean(xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.opaque);
|
|
93
98
|
}
|
|
@@ -157,6 +162,34 @@ function extractWMSBoundingBox(xmlBoundingBox) {
|
|
|
157
162
|
}
|
|
158
163
|
return boundingBox;
|
|
159
164
|
}
|
|
165
|
+
function extractDimension(xmlDimension) {
|
|
166
|
+
const {
|
|
167
|
+
name,
|
|
168
|
+
units,
|
|
169
|
+
value: extent
|
|
170
|
+
} = xmlDimension;
|
|
171
|
+
const dimension = {
|
|
172
|
+
name,
|
|
173
|
+
units,
|
|
174
|
+
extent
|
|
175
|
+
};
|
|
176
|
+
if (xmlDimension.unitSymbol) {
|
|
177
|
+
dimension.unitSymbol = xmlDimension.unitSymbol;
|
|
178
|
+
}
|
|
179
|
+
if (xmlDimension.default) {
|
|
180
|
+
dimension.defaultValue = xmlDimension.default;
|
|
181
|
+
}
|
|
182
|
+
if (xmlDimension.multipleValues) {
|
|
183
|
+
dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);
|
|
184
|
+
}
|
|
185
|
+
if (xmlDimension.nearestValue) {
|
|
186
|
+
dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);
|
|
187
|
+
}
|
|
188
|
+
if (xmlDimension.current) {
|
|
189
|
+
dimension.current = getXMLBoolean(xmlDimension.current);
|
|
190
|
+
}
|
|
191
|
+
return dimension;
|
|
192
|
+
}
|
|
160
193
|
function addInheritedLayerProps(layer, parent) {
|
|
161
194
|
if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {
|
|
162
195
|
layer.geographicBoundingBox = [...parent.geographicBoundingBox];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","parsedXML","parseTextSync","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","name","Service","Name","title","Title","undefined","abstract","Abstract","keywords","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","Layer","xmlSubLayer","push","extractLayer","key","value","Object","entries","xmlRequests","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","length","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","Array","isArray","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","opaque","cascaded","queryable","xmlBoundingBox","westBoundLongitude","w","northBoundLatitude","n","eastBoundLongitude","e","southBoundLatitude","s","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","map","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","xResolution","yResolution","parent","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type parseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n\n // xml options are passed through to xml loader\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n xmlText: string,\n options?: parseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: String(xmlLayer?.Name),\n abstract: String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent && parent.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent && parent.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n // TODO inherit other elements\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SACEC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa,QACR,0BAA0B;AA8HjC,OAAO,SAASC,oBAAoBA,CAClCC,OAAe,EACfC,OAAqC,EACpB;EACjB,MAAMC,SAAS,GAAGT,SAAS,CAACU,aAAa,CAACH,OAAO,EAAEC,OAAO,CAAC;EAC3D,MAAMG,eAAoB,GACxBF,SAAS,CAACG,mBAAmB,IAAIH,SAAS,CAACI,gBAAgB,IAAIJ,SAAS;EAC1E,MAAMK,YAAY,GAAGC,mBAAmB,CAACJ,eAAe,CAAC;EAGzD,IAAIH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEQ,mBAAmB,EAAE;IAEhC,KAAK,MAAMC,KAAK,IAAIH,YAAY,CAACI,MAAM,EAAE;MACvCC,sBA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EAC1D,CAAChH,WAAW,CAACiH,IAAI,CAAC,EAAYjH,WAAW,CAACkH,IAAI,CAAC,CAAW;EAE9D,CAAC;EACD,IAAIM,IAAI,EAAE;IACRE,WAAW,CAACC,WAAW,GAAGH,IAAI;EAChC;EACA,IAAIC,IAAI,EAAE;IACRC,WAAW,CAACE,WAAW,GAAGH,IAAI;EAChC;EACA,OAAOC,WAAW;AACpB;AAIA,SAAS3G,sBAAsBA,CAACF,KAAe,EAAEgH,MAAuB,EAAQ;EAC9E,IAAIA,MAAM,IAAIA,MAAM,CAAClC,qBAAqB,IAAI,CAAC9E,KAAK,CAAC8E,qBAAqB,EAAE;IAC1E9E,KAAK,CAAC8E,qBAAqB,GAAG,CAAC,GAAGkC,MAAM,CAAClC,qBAAqB,CAAC;EACjE;EAEA,IAAIkC,MAAM,IAAIA,MAAM,CAACzC,GAAG,IAAI,CAACvE,KAAK,CAACuE,GAAG,EAAE;IACtCvE,KAAK,CAACuE,GAAG,GAAG,CAAC,GAAGyC,MAAM,CAACzC,GAAG,CAAC;EAC7B;EAEA,IAAIyC,MAAM,IAAIA,MAAM,CAAC7B,aAAa,IAAI,CAACnF,KAAK,CAACmF,aAAa,EAAE;IAC1DnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG6B,MAAM,CAAC7B,aAAa,CAAC;EACjD;EAIA,KAAK,MAAM8B,QAAQ,IAAIjH,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC+G,QAAQ,EAAEjH,KAAK,CAAC;EACzC;AACF"}
|
|
1
|
+
{"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","parsedXML","parseTextSync","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","name","Service","Name","title","Title","undefined","abstract","Abstract","keywords","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","Layer","xmlSubLayer","push","extractLayer","key","value","Object","entries","xmlRequests","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","length","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","Array","isArray","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","xmlDimensions","Dimension","dimensions","map","extractDimension","opaque","cascaded","queryable","xmlBoundingBox","westBoundLongitude","w","northBoundLatitude","n","eastBoundLongitude","e","southBoundLatitude","s","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","xResolution","yResolution","xmlDimension","units","extent","dimension","unitSymbol","default","defaultValue","multipleValues","nearestValue","current","parent","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** any extra dimension such as time */\n dimensions?: WMSDimension[];\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/**\n * An optional dimension that can be queried using the `name=...` parameter\n * Note that layers that have at least one dimension without `default` value\n * become unrenderable unless the dimension value is supplied to GetMap requests.\n */\nexport type WMSDimension = {\n /** name of dimension, becomes a valid parameter key for this layer */\n name: string;\n /** Textual units for this dimensional axis */\n units: string;\n /** Unit symbol for this dimensional axis */\n unitSymbol?: string;\n /** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */\n defaultValue?: string;\n /** Can multiple values of the dimension be requested? */\n multipleValues?: boolean;\n /* Will nearest values will be substituted when out of range, if false exact values are required */\n nearestValue?: boolean;\n /** A special value \"current\" is supported, typically for time dimension */\n current?: boolean;\n /** Text content indicating available values for dimension */\n extent: string;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type parseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n\n // xml options are passed through to xml loader\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n xmlText: string,\n options?: parseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: String(xmlLayer?.Name),\n abstract: String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n // Extract dimensions\n const xmlDimensions = getXMLArray(xmlLayer?.Dimension);\n const dimensions = xmlDimensions.map((xml) => extractDimension(xml));\n if (dimensions.length) {\n layer.dimensions = dimensions;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/**\n * Extracts optional WMS Dimension layer field\n * @param xmlDimension\n * @example <Dimension name=\"time\" units=\"ISO8601\" default=\"2018-01-01\" nearestValue=\"0\">2001-01-01/2018-01-01/P1Y</Dimension>\n * @see https://mapserver.org/ogc/wms_dimension.html\n */\nfunction extractDimension(xmlDimension: any): WMSDimension {\n const {name, units, value: extent} = xmlDimension;\n\n const dimension: WMSDimension = {name, units, extent};\n\n if (xmlDimension.unitSymbol) {\n dimension.unitSymbol = xmlDimension.unitSymbol;\n }\n if (xmlDimension.default) {\n dimension.defaultValue = xmlDimension.default;\n }\n if (xmlDimension.multipleValues) {\n dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);\n }\n if (xmlDimension.nearestValue) {\n dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);\n }\n if (xmlDimension.current) {\n dimension.current = getXMLBoolean(xmlDimension.current);\n }\n\n return dimension;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent && parent.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent && parent.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n // TODO inherit other elements\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SACEC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa,QACR,0BAA0B;AAyJjC,OAAO,SAASC,oBAAoBA,CAClCC,OAAe,EACfC,OAAqC,EACpB;EACjB,MAAMC,SAAS,GAAGT,SAAS,CAACU,aAAa,CAACH,OAAO,EAAEC,OAAO,CAAC;EAC3D,MAAMG,eAAoB,GACxBF,SAAS,CAACG,mBAAmB,IAAIH,SAAS,CAACI,gBAAgB,IAAIJ,SAAS;EAC1E,MAAMK,YAAY,GAAGC,mBAAmB,CAACJ,eAAe,CAAC;EAGzD,IAAIH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEQ,mBAAmB,EAAE;IAEhC,KAAK,MAAMC,KAAK,IAAIH,YAAY,CAACI,MAAM,EAAE;MACvCC,sBAAsB,CAACF,KAAK,EAAE,IAAI,CAAC;IACrC;EAEF;EAEA,IAAIT,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEY,cAAc,IAAIZ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEa,GAAG,EAAE;IAC3CP,YAAY,CAACO,GAAG,GAAGV,eAAe;EACpC;EAEA,IAAIH,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEc,cAAc,EAAE;IAC3BR,YAAY,CAACS,GAAG,GAAGhB,OAAO;EAC5B;EAEA,OAAOO,YAAY;AACrB;AAGA,SAASC,mBAAmBA,CAACQ,GAAQ,EAAmB;EAAA,IAAAC,YAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,qBAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,aAAA,EAAAC,cAAA,EAAAC,cAAA,EA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AAa,EAAE;IAC1DnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG2C,MAAM,CAAC3C,aAAa,CAAC;EACjD;EAIA,KAAK,MAAM4C,QAAQ,IAAI/H,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC6H,QAAQ,EAAE/H,KAAK,CAAC;EACzC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource
|
|
1
|
+
{"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource<\n PropsT extends ImageSourceProps = ImageSourceProps\n> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"AAIA,SAAQA,UAAU,QAAO,eAAe;AAwExC,OAAO,MAAeC,WAAW,SAEvBD,UAAU,CAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWCSCapabilities } from './lib/wcs/parse-wcs-capabilities';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const WCSCapabilitiesLoader = {
|
|
4
4
|
id: 'wcs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWFSCapabilities } from './lib/wfs/parse-wfs-capabilities';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const WFSCapabilitiesLoader = {
|
|
4
4
|
id: 'wfs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMTSCapabilities } from './lib/wmts/parse-wmts-capabilities';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const WMTSCapabilitiesLoader = {
|
|
4
4
|
id: 'wmts-capabilities',
|
|
5
5
|
name: 'WMTS Capabilities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMSCapabilities } from './lib/parsers/wms/parse-wms-capabilities';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const WMSCapabilitiesLoader = {
|
|
4
4
|
id: 'wms-capabilities',
|
|
5
5
|
name: 'WMS Capabilities',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMSError } from './lib/parsers/wms/parse-wms-error';
|
|
2
|
-
const VERSION = typeof "3.4.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.4.0-alpha.5" !== 'undefined' ? "3.4.0-alpha.5" : 'latest';
|
|
3
3
|
export const WMSErrorLoader = {
|
|
4
4
|
id: 'wms-error',
|
|
5
5
|
name: 'WMS Error',
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export { WFSCapabilitiesLoader as _WFSCapabilitiesLoader } from './wip/wfs-capab
|
|
|
19
19
|
export type { GeoJSON as _GeoJSON } from '@loaders.gl/schema';
|
|
20
20
|
export type { GMLLoaderOptions as _GMLLoaderOptions } from './gml-loader';
|
|
21
21
|
export { GMLLoader as _GMLLoader } from './gml-loader';
|
|
22
|
-
export type { ImageSourceMetadata } from './lib/sources/image-source';
|
|
23
22
|
export type { ImageType } from '@loaders.gl/images';
|
|
23
|
+
export type { ImageSourceProps, ImageSourceMetadata } from './lib/sources/image-source';
|
|
24
24
|
export { ImageSource } from './lib/sources/image-source';
|
|
25
25
|
export type { ImageServiceType } from './lib/create-image-source';
|
|
26
26
|
export { createImageSource } from './lib/create-image-source';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,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AAC;AAChE,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAI5D,YAAY,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAIlE,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,4CAA4C,CAAC"}
|
|
@@ -51,6 +51,8 @@ export type WMSLayer = {
|
|
|
51
51
|
crs?: string[];
|
|
52
52
|
/** Bounding boxes in specific CRS:es */
|
|
53
53
|
boundingBoxes?: WMSBoundingBox[];
|
|
54
|
+
/** any extra dimension such as time */
|
|
55
|
+
dimensions?: WMSDimension[];
|
|
54
56
|
/** Whether queries can be performed on the layer */
|
|
55
57
|
queryable?: boolean;
|
|
56
58
|
/** `false` if layer has significant no-data areas that the client can display as transparent. */
|
|
@@ -76,6 +78,28 @@ export type WMSBoundingBox = {
|
|
|
76
78
|
/** Spatial vertical resolution of data in same units as bounding box */
|
|
77
79
|
yResolution?: number;
|
|
78
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* An optional dimension that can be queried using the `name=...` parameter
|
|
83
|
+
* Note that layers that have at least one dimension without `default` value
|
|
84
|
+
* become unrenderable unless the dimension value is supplied to GetMap requests.
|
|
85
|
+
*/
|
|
86
|
+
export type WMSDimension = {
|
|
87
|
+
/** name of dimension, becomes a valid parameter key for this layer */
|
|
88
|
+
name: string;
|
|
89
|
+
/** Textual units for this dimensional axis */
|
|
90
|
+
units: string;
|
|
91
|
+
/** Unit symbol for this dimensional axis */
|
|
92
|
+
unitSymbol?: string;
|
|
93
|
+
/** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */
|
|
94
|
+
defaultValue?: string;
|
|
95
|
+
/** Can multiple values of the dimension be requested? */
|
|
96
|
+
multipleValues?: boolean;
|
|
97
|
+
nearestValue?: boolean;
|
|
98
|
+
/** A special value "current" is supported, typically for time dimension */
|
|
99
|
+
current?: boolean;
|
|
100
|
+
/** Text content indicating available values for dimension */
|
|
101
|
+
extent: string;
|
|
102
|
+
};
|
|
79
103
|
/** Metadata about a supported WMS request */
|
|
80
104
|
export type WMSRequest = {
|
|
81
105
|
/** MIMEtypes that can be returned by this request. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"names":[],"mappings":"AAWA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8GAA8G;IAC9G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,2HAA2H;IAC3H,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,yFAAyF;IACzF,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,4HAA4H;IAC5H,GAAG,CAAC,EAAE,MAAM,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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,UAAU,GAAG;IACvB,sDAAsD;IACtD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kGAAkG;IAClG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sCAAsC;IACtC,GAAG,CAAC,EAAE,OAAO,CAAC;CAGf,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,CAwBjB"}
|
|
1
|
+
{"version":3,"file":"parse-wms-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"names":[],"mappings":"AAWA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8GAA8G;IAC9G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAA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O,CAAC;IACzB,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sCAAsC;IACtC,GAAG,CAAC,EAAE,OAAO,CAAC;CAGf,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,CAwBjB"}
|
|
@@ -114,6 +114,12 @@ function extractLayer(xmlLayer) {
|
|
|
114
114
|
if (boundingBoxes && boundingBoxes.length > 0) {
|
|
115
115
|
layer.boundingBoxes = boundingBoxes;
|
|
116
116
|
}
|
|
117
|
+
// Extract dimensions
|
|
118
|
+
const xmlDimensions = (0, parse_xml_helpers_1.getXMLArray)(xmlLayer?.Dimension);
|
|
119
|
+
const dimensions = xmlDimensions.map((xml) => extractDimension(xml));
|
|
120
|
+
if (dimensions.length) {
|
|
121
|
+
layer.dimensions = dimensions;
|
|
122
|
+
}
|
|
117
123
|
if (xmlLayer?.opaque) {
|
|
118
124
|
layer.opaque = (0, parse_xml_helpers_1.getXMLBoolean)(xmlLayer?.opaque);
|
|
119
125
|
}
|
|
@@ -180,6 +186,32 @@ function extractWMSBoundingBox(xmlBoundingBox) {
|
|
|
180
186
|
}
|
|
181
187
|
return boundingBox;
|
|
182
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Extracts optional WMS Dimension layer field
|
|
191
|
+
* @param xmlDimension
|
|
192
|
+
* @example <Dimension name="time" units="ISO8601" default="2018-01-01" nearestValue="0">2001-01-01/2018-01-01/P1Y</Dimension>
|
|
193
|
+
* @see https://mapserver.org/ogc/wms_dimension.html
|
|
194
|
+
*/
|
|
195
|
+
function extractDimension(xmlDimension) {
|
|
196
|
+
const { name, units, value: extent } = xmlDimension;
|
|
197
|
+
const dimension = { name, units, extent };
|
|
198
|
+
if (xmlDimension.unitSymbol) {
|
|
199
|
+
dimension.unitSymbol = xmlDimension.unitSymbol;
|
|
200
|
+
}
|
|
201
|
+
if (xmlDimension.default) {
|
|
202
|
+
dimension.defaultValue = xmlDimension.default;
|
|
203
|
+
}
|
|
204
|
+
if (xmlDimension.multipleValues) {
|
|
205
|
+
dimension.multipleValues = (0, parse_xml_helpers_1.getXMLBoolean)(xmlDimension.multipleValues);
|
|
206
|
+
}
|
|
207
|
+
if (xmlDimension.nearestValue) {
|
|
208
|
+
dimension.nearestValue = (0, parse_xml_helpers_1.getXMLBoolean)(xmlDimension.nearestValue);
|
|
209
|
+
}
|
|
210
|
+
if (xmlDimension.current) {
|
|
211
|
+
dimension.current = (0, parse_xml_helpers_1.getXMLBoolean)(xmlDimension.current);
|
|
212
|
+
}
|
|
213
|
+
return dimension;
|
|
214
|
+
}
|
|
183
215
|
/** Traverse layers and inject missing props from parents */
|
|
184
216
|
// eslint-disable-next-line complexity
|
|
185
217
|
function addInheritedLayerProps(layer, parent) {
|
|
@@ -63,7 +63,7 @@ export type ImageSourceProps = DataSourceProps;
|
|
|
63
63
|
* @note
|
|
64
64
|
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
65
65
|
*/
|
|
66
|
-
export declare abstract class ImageSource<PropsT extends ImageSourceProps> extends DataSource<PropsT> {
|
|
66
|
+
export declare abstract class ImageSource<PropsT extends ImageSourceProps = ImageSourceProps> extends DataSource<PropsT> {
|
|
67
67
|
abstract getMetadata(): Promise<ImageSourceMetadata>;
|
|
68
68
|
abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,M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-independent loaders for the WMS (Web Map Service) standard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime": "^7.3.1",
|
|
42
|
-
"@loaders.gl/images": "3.4.0-alpha.
|
|
43
|
-
"@loaders.gl/loader-utils": "3.4.0-alpha.
|
|
44
|
-
"@loaders.gl/schema": "3.4.0-alpha.
|
|
45
|
-
"@loaders.gl/xml": "3.4.0-alpha.
|
|
42
|
+
"@loaders.gl/images": "3.4.0-alpha.5",
|
|
43
|
+
"@loaders.gl/loader-utils": "3.4.0-alpha.5",
|
|
44
|
+
"@loaders.gl/schema": "3.4.0-alpha.5",
|
|
45
|
+
"@loaders.gl/xml": "3.4.0-alpha.5",
|
|
46
46
|
"@turf/rewind": "^5.1.5",
|
|
47
47
|
"deep-strict-equal": "^0.2.0",
|
|
48
48
|
"lerc": "^4.0.1"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"xmldom": "0.6.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "686929f85b3420c15df051eab769942b260dd242"
|
|
54
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -49,8 +49,8 @@ export {GMLLoader as _GMLLoader} from './gml-loader';
|
|
|
49
49
|
|
|
50
50
|
// EXPERIMENTAL: DATA SOURCES
|
|
51
51
|
|
|
52
|
-
export type {ImageSourceMetadata} from './lib/sources/image-source';
|
|
53
52
|
export type {ImageType} from '@loaders.gl/images';
|
|
53
|
+
export type {ImageSourceProps, ImageSourceMetadata} from './lib/sources/image-source';
|
|
54
54
|
export {ImageSource} from './lib/sources/image-source';
|
|
55
55
|
|
|
56
56
|
export type {ImageServiceType} from './lib/create-image-source';
|
|
@@ -73,6 +73,9 @@ export type WMSLayer = {
|
|
|
73
73
|
// FeatureListURL
|
|
74
74
|
// DataURL
|
|
75
75
|
|
|
76
|
+
/** any extra dimension such as time */
|
|
77
|
+
dimensions?: WMSDimension[];
|
|
78
|
+
|
|
76
79
|
/** Whether queries can be performed on the layer */
|
|
77
80
|
queryable?: boolean;
|
|
78
81
|
/** `false` if layer has significant no-data areas that the client can display as transparent. */
|
|
@@ -105,6 +108,30 @@ export type WMSBoundingBox = {
|
|
|
105
108
|
yResolution?: number;
|
|
106
109
|
};
|
|
107
110
|
|
|
111
|
+
/**
|
|
112
|
+
* An optional dimension that can be queried using the `name=...` parameter
|
|
113
|
+
* Note that layers that have at least one dimension without `default` value
|
|
114
|
+
* become unrenderable unless the dimension value is supplied to GetMap requests.
|
|
115
|
+
*/
|
|
116
|
+
export type WMSDimension = {
|
|
117
|
+
/** name of dimension, becomes a valid parameter key for this layer */
|
|
118
|
+
name: string;
|
|
119
|
+
/** Textual units for this dimensional axis */
|
|
120
|
+
units: string;
|
|
121
|
+
/** Unit symbol for this dimensional axis */
|
|
122
|
+
unitSymbol?: string;
|
|
123
|
+
/** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */
|
|
124
|
+
defaultValue?: string;
|
|
125
|
+
/** Can multiple values of the dimension be requested? */
|
|
126
|
+
multipleValues?: boolean;
|
|
127
|
+
/* Will nearest values will be substituted when out of range, if false exact values are required */
|
|
128
|
+
nearestValue?: boolean;
|
|
129
|
+
/** A special value "current" is supported, typically for time dimension */
|
|
130
|
+
current?: boolean;
|
|
131
|
+
/** Text content indicating available values for dimension */
|
|
132
|
+
extent: string;
|
|
133
|
+
};
|
|
134
|
+
|
|
108
135
|
/** Metadata about a supported WMS request */
|
|
109
136
|
export type WMSRequest = {
|
|
110
137
|
/** MIMEtypes that can be returned by this request. */
|
|
@@ -258,6 +285,13 @@ function extractLayer(xmlLayer: any): WMSLayer {
|
|
|
258
285
|
layer.boundingBoxes = boundingBoxes;
|
|
259
286
|
}
|
|
260
287
|
|
|
288
|
+
// Extract dimensions
|
|
289
|
+
const xmlDimensions = getXMLArray(xmlLayer?.Dimension);
|
|
290
|
+
const dimensions = xmlDimensions.map((xml) => extractDimension(xml));
|
|
291
|
+
if (dimensions.length) {
|
|
292
|
+
layer.dimensions = dimensions;
|
|
293
|
+
}
|
|
294
|
+
|
|
261
295
|
if (xmlLayer?.opaque) {
|
|
262
296
|
layer.opaque = getXMLBoolean(xmlLayer?.opaque);
|
|
263
297
|
}
|
|
@@ -339,6 +373,36 @@ function extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {
|
|
|
339
373
|
return boundingBox;
|
|
340
374
|
}
|
|
341
375
|
|
|
376
|
+
/**
|
|
377
|
+
* Extracts optional WMS Dimension layer field
|
|
378
|
+
* @param xmlDimension
|
|
379
|
+
* @example <Dimension name="time" units="ISO8601" default="2018-01-01" nearestValue="0">2001-01-01/2018-01-01/P1Y</Dimension>
|
|
380
|
+
* @see https://mapserver.org/ogc/wms_dimension.html
|
|
381
|
+
*/
|
|
382
|
+
function extractDimension(xmlDimension: any): WMSDimension {
|
|
383
|
+
const {name, units, value: extent} = xmlDimension;
|
|
384
|
+
|
|
385
|
+
const dimension: WMSDimension = {name, units, extent};
|
|
386
|
+
|
|
387
|
+
if (xmlDimension.unitSymbol) {
|
|
388
|
+
dimension.unitSymbol = xmlDimension.unitSymbol;
|
|
389
|
+
}
|
|
390
|
+
if (xmlDimension.default) {
|
|
391
|
+
dimension.defaultValue = xmlDimension.default;
|
|
392
|
+
}
|
|
393
|
+
if (xmlDimension.multipleValues) {
|
|
394
|
+
dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);
|
|
395
|
+
}
|
|
396
|
+
if (xmlDimension.nearestValue) {
|
|
397
|
+
dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);
|
|
398
|
+
}
|
|
399
|
+
if (xmlDimension.current) {
|
|
400
|
+
dimension.current = getXMLBoolean(xmlDimension.current);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
return dimension;
|
|
404
|
+
}
|
|
405
|
+
|
|
342
406
|
/** Traverse layers and inject missing props from parents */
|
|
343
407
|
// eslint-disable-next-line complexity
|
|
344
408
|
function addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {
|
|
@@ -74,7 +74,9 @@ export type ImageSourceProps = DataSourceProps;
|
|
|
74
74
|
* @note
|
|
75
75
|
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
76
76
|
*/
|
|
77
|
-
export abstract class ImageSource<
|
|
77
|
+
export abstract class ImageSource<
|
|
78
|
+
PropsT extends ImageSourceProps = ImageSourceProps
|
|
79
|
+
> extends DataSource<PropsT> {
|
|
78
80
|
abstract getMetadata(): Promise<ImageSourceMetadata>;
|
|
79
81
|
abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
80
82
|
}
|