@loaders.gl/wms 4.2.0-alpha.3 → 4.2.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/csw-capabilities-loader.d.ts +1 -1
- package/dist/csw-capabilities-loader.d.ts.map +1 -1
- package/dist/csw-capabilities-loader.js +24 -16
- package/dist/csw-domain-loader.d.ts +1 -1
- package/dist/csw-domain-loader.d.ts.map +1 -1
- package/dist/csw-domain-loader.js +24 -16
- package/dist/csw-records-loader.d.ts +1 -1
- package/dist/csw-records-loader.d.ts.map +1 -1
- package/dist/csw-records-loader.js +24 -16
- package/dist/gml-loader.d.ts +1 -1
- package/dist/gml-loader.d.ts.map +1 -1
- package/dist/gml-loader.js +24 -16
- package/dist/index.cjs +49 -58
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +30 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/lib/parsers/csw/parse-csw-capabilities.js +18 -13
- package/dist/lib/parsers/csw/parse-csw-domain.js +26 -18
- package/dist/lib/parsers/csw/parse-csw-records.js +47 -36
- package/dist/lib/parsers/csw/parse-exception-report.js +26 -8
- package/dist/lib/parsers/gml/deep-strict-equal.js +107 -39
- package/dist/lib/parsers/gml/parse-gml.js +299 -280
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +207 -187
- package/dist/lib/parsers/wms/parse-wms-error.js +17 -6
- package/dist/lib/parsers/wms/parse-wms-features.js +20 -19
- package/dist/lib/parsers/wms/parse-wms-layer-description.js +10 -4
- package/dist/lib/parsers/xml/parse-xml-helpers.js +54 -45
- package/dist/lib/services/create-image-service.d.ts +1 -1
- package/dist/lib/services/create-image-service.d.ts.map +1 -1
- package/dist/lib/services/create-image-service.js +31 -19
- package/dist/lib/services/image-service.js +39 -32
- package/dist/services/arcgis/arcgis-image-service.d.ts +2 -2
- package/dist/services/arcgis/arcgis-image-service.d.ts.map +1 -1
- package/dist/services/arcgis/arcgis-image-service.js +91 -55
- package/dist/services/arcgis/arcgis-server.js +35 -28
- package/dist/services/create-image-source.d.ts +3 -3
- package/dist/services/create-image-source.d.ts.map +1 -1
- package/dist/services/create-image-source.js +11 -2
- package/dist/services/ogc/csw-service.d.ts +3 -3
- package/dist/services/ogc/csw-service.d.ts.map +1 -1
- package/dist/services/ogc/csw-service.js +156 -142
- package/dist/services/ogc/wms-service.d.ts +4 -4
- package/dist/services/ogc/wms-service.d.ts.map +1 -1
- package/dist/services/ogc/wms-service.js +295 -242
- package/dist/wip/data-source.js +58 -1
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js +8 -11
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js +12 -12
- package/dist/wip/lib/wfs/parse-wfs.js +20 -20
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js +70 -12
- package/dist/wip/lib/wmts/parse-wmts.js +23 -20
- package/dist/wip/services/arcgis-feature-service.js +22 -22
- package/dist/wip/wcs-capabilities-loader.d.ts +1 -1
- package/dist/wip/wcs-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wcs-capabilities-loader.js +22 -16
- package/dist/wip/wfs-capabilities-loader.d.ts +1 -1
- package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wfs-capabilities-loader.js +22 -16
- package/dist/wip/wms-feature-info-loader.d.ts +1 -1
- package/dist/wip/wms-feature-info-loader.d.ts.map +1 -1
- package/dist/wip/wms-feature-info-loader.js +10 -6
- package/dist/wip/wms-layer-description-loader.d.ts +1 -1
- package/dist/wip/wms-layer-description-loader.d.ts.map +1 -1
- package/dist/wip/wms-layer-description-loader.js +9 -6
- package/dist/wip/wmts-capabilities-loader.js +23 -16
- package/dist/wms-capabilities-loader.d.ts +2 -2
- package/dist/wms-capabilities-loader.d.ts.map +1 -1
- package/dist/wms-capabilities-loader.js +28 -16
- package/dist/wms-error-loader.js +34 -29
- package/package.json +10 -8
- package/dist/csw-capabilities-loader.js.map +0 -1
- package/dist/csw-domain-loader.js.map +0 -1
- package/dist/csw-records-loader.js.map +0 -1
- package/dist/gml-loader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/parsers/csw/parse-csw-capabilities.js.map +0 -1
- package/dist/lib/parsers/csw/parse-csw-domain.js.map +0 -1
- package/dist/lib/parsers/csw/parse-csw-records.js.map +0 -1
- package/dist/lib/parsers/csw/parse-exception-report.js.map +0 -1
- package/dist/lib/parsers/gml/deep-strict-equal.js.map +0 -1
- package/dist/lib/parsers/gml/parse-gml.js.map +0 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.js.map +0 -1
- package/dist/lib/parsers/wms/parse-wms-error.js.map +0 -1
- package/dist/lib/parsers/wms/parse-wms-features.js.map +0 -1
- package/dist/lib/parsers/wms/parse-wms-layer-description.js.map +0 -1
- package/dist/lib/parsers/xml/parse-xml-helpers.js.map +0 -1
- package/dist/lib/services/create-image-service.js.map +0 -1
- package/dist/lib/services/image-service.js.map +0 -1
- package/dist/services/arcgis/arcgis-image-service.js.map +0 -1
- package/dist/services/arcgis/arcgis-server.js.map +0 -1
- package/dist/services/create-image-source.js.map +0 -1
- package/dist/services/ogc/csw-service.js.map +0 -1
- package/dist/services/ogc/wms-service.js.map +0 -1
- package/dist/wip/data-source.js.map +0 -1
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js.map +0 -1
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js.map +0 -1
- package/dist/wip/lib/wfs/parse-wfs.js.map +0 -1
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js.map +0 -1
- package/dist/wip/lib/wmts/parse-wmts.js.map +0 -1
- package/dist/wip/services/arcgis-feature-service.js.map +0 -1
- package/dist/wip/services/wmts-service.ts.disabled +0 -348
- package/dist/wip/wcs-capabilities-loader.js.map +0 -1
- package/dist/wip/wfs-capabilities-loader.js.map +0 -1
- package/dist/wip/wms-feature-info-loader.js.map +0 -1
- package/dist/wip/wms-layer-description-loader.js.map +0 -1
- package/dist/wip/wms-layer-description-loader.md.disabled.md +0 -47
- package/dist/wip/wmts-capabilities-loader.js.map +0 -1
- package/dist/wms-capabilities-loader.js.map +0 -1
- package/dist/wms-error-loader.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/wms",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.5",
|
|
4
4
|
"description": "Framework-independent loaders for the WMS (Web Map Service) standard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,20 +43,22 @@
|
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
45
|
"pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev",
|
|
46
|
-
"build-bundle": "# ocular-bundle ./
|
|
46
|
+
"build-bundle": "# ocular-bundle ./bundle.ts --external:{util,fs,path}"
|
|
47
47
|
},
|
|
48
48
|
"browser": {
|
|
49
49
|
"fs": false,
|
|
50
50
|
"path": false
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@loaders.gl/
|
|
55
|
-
"@loaders.gl/
|
|
56
|
-
"@loaders.gl/
|
|
57
|
-
"@loaders.gl/xml": "4.2.0-alpha.3",
|
|
53
|
+
"@loaders.gl/images": "4.2.0-alpha.5",
|
|
54
|
+
"@loaders.gl/loader-utils": "4.2.0-alpha.5",
|
|
55
|
+
"@loaders.gl/schema": "4.2.0-alpha.5",
|
|
56
|
+
"@loaders.gl/xml": "4.2.0-alpha.5",
|
|
58
57
|
"@turf/rewind": "^5.1.5",
|
|
59
58
|
"deep-strict-equal": "^0.2.0"
|
|
60
59
|
},
|
|
61
|
-
"
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@loaders.gl/core": "^4.0.0"
|
|
62
|
+
},
|
|
63
|
+
"gitHead": "32d95a81971f104e4dfeb88ab57065f05321a76a"
|
|
62
64
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csw-capabilities-loader.js","names":["parseCSWCapabilities","VERSION","CSWCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","csw","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/csw-capabilities-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';\nimport {parseCSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// parsed data type\nexport type {CSWCapabilities};\n\n/** CSW loader options */\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWCapabilitiesLoader: LoaderWithParser<CSWCapabilities, never, CSWLoaderOptions> = {\n id: 'csw-capabilities',\n name: 'CSW Capabilities',\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n csw: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAOQA,oBAAoB;AAI5B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAa3E,OAAO,MAAMC,qBAAiF,GAAG;EAC/FC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EACxBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csw-domain-loader.js","names":["parseCSWDomain","VERSION","CSWDomainLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","csw","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/csw-domain-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWDomain} from './lib/parsers/csw/parse-csw-domain';\nimport {parseCSWDomain} from './lib/parsers/csw/parse-csw-domain';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {CSWDomain};\n\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWDomainLoader: LoaderWithParser<CSWDomain, never, CSWLoaderOptions> = {\n id: 'csw-domain',\n name: 'CSW Domain',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n csw: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWDomain(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAOQA,cAAc;AAItB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,eAAqE,GAAG;EACnFC,EAAE,EAAE,YAAY;EAChBC,IAAI,EAAE,YAAY;EAElBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,cAAc,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EAChEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,cAAc,CAACmB,IAAI,EAAEP,OAAO;AAC3F,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csw-records-loader.js","names":["parseCSWRecords","VERSION","CSWRecordsLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","csw","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/csw-records-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWRecords} from './lib/parsers/csw/parse-csw-records';\nimport {parseCSWRecords} from './lib/parsers/csw/parse-csw-records';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {CSWRecords};\n\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWRecordsLoader: LoaderWithParser<CSWRecords, never, CSWLoaderOptions> = {\n id: 'csw-records',\n name: 'CSW Records',\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n csw: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWRecords(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAOQA,eAAe;AAIvB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,gBAAuE,GAAG;EACrFC,EAAE,EAAE,aAAa;EACjBC,IAAI,EAAE,aAAa;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,eAAe,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACjEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,eAAe,CAACmB,IAAI,EAAEP,OAAO;AAC5F,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
|
package/dist/gml-loader.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gml-loader.js","names":["parseGML","VERSION","GMLLoader","name","id","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","gml","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/gml-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {Geometry} from './lib/parsers/gml/parse-gml';\nimport {parseGML} from './lib/parsers/gml/parse-gml';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GMLLoaderOptions = LoaderOptions & {\n gml?: {};\n};\n\n/**\n * Loader for the response to the GML GetCapability request\n */\nexport const GMLLoader: LoaderWithParser<Geometry | null, never, GMLLoaderOptions> = {\n name: 'GML',\n id: 'gml',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.gml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n gml: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: GMLLoaderOptions) =>\n parseGML(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: GMLLoaderOptions) => parseGML(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAMQA,QAAQ;AAIhB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAS3E,OAAO,MAAMC,SAAqE,GAAG;EACnFC,IAAI,EAAE,KAAK;EACXC,EAAE,EAAE,KAAK;EAETC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,yBAAyB,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACrEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,QAAQ,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EAC1DM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,QAAQ,CAACmB,IAAI,EAAEP,OAAO;AACrF,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","ImageSource","createImageService","createImageSource","ImageService","CSWService","WMSSource","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageService","_ArcGISImageService"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\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 {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension\n} from './wms-capabilities-loader';\nexport type {WMSCapabilitiesLoaderOptions} 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\n// TODO - restore once deck.gl has been udpated\nexport {ImageSource} from '@loaders.gl/loader-utils';\n\nexport type {ImageType} from '@loaders.gl/images';\n\nexport type {CreateImageServiceProps} from './lib/services/create-image-service';\nexport {createImageService} from './lib/services/create-image-service';\n\nexport type {ImageServiceType} from './services/create-image-source';\nexport {createImageSource} from './services/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/image-service';\nexport {ImageService} from './lib/services/image-service';\n\n// OGC Services\n\nexport {CSWService} from './services/ogc/csw-service';\nexport {WMSSource, WMSService} from './services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';\nexport {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';\n"],"mappings":"SASQA,qBAAqB;AAAA,SAGrBC,eAAe;AAAA,SAGfC,gBAAgB;AAAA,SAIhBC,cAAc;AAAA,SASdC,qBAAqB;AAAA,SAGrBC,oBAAoB,IAAIC,qBAAqB;AAAA,SAG7CC,yBAAyB,IAAIC,0BAA0B;AAAA,SAavDC,qBAAqB,IAAIC,sBAAsB;AAAA,SAM/CC,SAAS,IAAIC,UAAU;AAK/B,SAAQC,WAAW,QAAO,0BAA0B;AAAC,SAK7CC,kBAAkB;AAAA,SAGlBC,iBAAiB;AAAA,SAKjBC,YAAY;AAAA,SAIZC,UAAU;AAAA,SACVC,SAAS,EAAEC,UAAU;AAAA,SAIrBC,iBAAiB,IAAIC,kBAAkB;AAAA,SACvCC,kBAAkB,IAAIC,mBAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-csw-capabilities.js","names":["XMLLoader","parseExceptionReport","parseCSWCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","capabilities"],"sources":["../../../../src/lib/parsers/csw/parse-csw-capabilities.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n// CSW:GetCapabilitiesResponse\n\n/** All capabilities of a CSW service - response to a CSW `GetCapabilities` data structure extracted from XML */\nexport type CSWCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\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 parseCSWCapabilities(text: string, options?: XMLLoaderOptions): CSWCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlCapabilities: any = parsedXML.capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAKA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAoF5B,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAA0B,EAAmB;EAAA,IAAAC,qBAAA;EAC9F,MAAMC,SAAS,IAAAD,qBAAA,GAAGL,SAAS,CAACO,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAR,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVK,GAAG,EAAE;MACH,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EACF,CAAC,CAAC;EAEFV,oBAAoB,CAACK,SAAS,CAAC;EAE/B,MAAMM,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-csw-domain.js","names":["XMLLoader","parseExceptionReport","parseCSWDomain","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","arrayPaths","xmlDomain","getDomainResponse","domainValue","domainValues","_domainValue$listOfVa","values","listOfValues","value"],"sources":["../../../../src/lib/parsers/csw/parse-csw-domain.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n/** Describes the values of resource */\nexport type CSWDomain = {\n domainValues: {\n type: string;\n propertyName: string;\n values: {\n [key: string]: unknown;\n }[];\n }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWDomain(text: string, options?: XMLLoaderOptions): CSWDomain {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true,\n arrayPaths: [\n 'GetDomainResponse.DomainValues',\n 'GetDomainResponse.DomainValues.ListOfValues.value'\n ]\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlDomain: any = parsedXML.getDomainResponse;\n for (const domainValue of xmlDomain.domainValues) {\n // Drop the nested <listOfValues><value><value><listOfValues> => values[]\n domainValue.values = domainValue.listOfValues?.value;\n delete domainValue.listOfValues;\n }\n return xmlDomain as CSWDomain;\n}\n"],"mappings":"AAKA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAiB5B,OAAO,SAASC,cAAcA,CAACC,IAAY,EAAEC,OAA0B,EAAa;EAAA,IAAAC,qBAAA;EAClF,MAAMC,SAAS,IAAAD,qBAAA,GAAGL,SAAS,CAACO,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAR,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVK,GAAG,EAAE;MACH,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE,IAAI;MACtBC,UAAU,EAAE,CACV,gCAAgC,EAChC,mDAAmD;IAEvD;EACF,CAAC,CAAC;EAEFX,oBAAoB,CAACK,SAAS,CAAC;EAE/B,MAAMO,SAAc,GAAGP,SAAS,CAACQ,iBAAiB;EAClD,KAAK,MAAMC,WAAW,IAAIF,SAAS,CAACG,YAAY,EAAE;IAAA,IAAAC,qBAAA;IAEhDF,WAAW,CAACG,MAAM,IAAAD,qBAAA,GAAGF,WAAW,CAACI,YAAY,cAAAF,qBAAA,uBAAxBA,qBAAA,CAA0BG,KAAK;IACpD,OAAOL,WAAW,CAACI,YAAY;EACjC;EACA,OAAON,SAAS;AAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-csw-records.js","names":["convertXMLFieldToArrayInPlace","XMLLoader","parseExceptionReport","parseCSWRecords","text","options","_XMLLoader$parseTextS","_options$xml","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","arrayPaths","_fastXML","parseAttributeValue","xmlRecords","getRecordsResponse","elementSet","searchResults","recordsFieldName","records","record","boundingBoxes","boundingBox","value","upperCorner","lowerCorner","renameXMLTags","renameKeys","oldKey","newKey","Object","entries"],"sources":["../../../../src/lib/parsers/csw/parse-csw-records.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoaderOptions, convertXMLFieldToArrayInPlace} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\nexport type CSWRecords = {\n searchStatus: {\n timestamp?: string;\n };\n searchResults: {\n numberOfRecordsMatched: number;\n numberOfRecordsReturned: number;\n elementSet: string;\n nextRecord: number;\n };\n records: {\n type: string;\n title: string;\n abstract: string;\n subject: string[];\n boundingBoxes: {\n crs: string;\n value: [number, number, number, number];\n }[];\n references: {\n value: string;\n scheme: string;\n }[];\n }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetRecords` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWRecords(text: string, options?: XMLLoaderOptions): CSWRecords {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true,\n arrayPaths: [],\n _fastXML: {\n ...options?.xml?._fastXML,\n parseAttributeValue: true\n }\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlRecords: any = parsedXML.getRecordsResponse;\n\n // Move results to top\n const elementSet = xmlRecords.searchResults.elementSet;\n const recordsFieldName = `${elementSet}Record`;\n xmlRecords.records = xmlRecords.searchResults[recordsFieldName];\n delete xmlRecords.searchResults[recordsFieldName];\n\n convertXMLFieldToArrayInPlace(xmlRecords, 'records');\n\n for (const record of xmlRecords.records) {\n record.boundingBoxes = record.boundingBox;\n delete record.boundingBox;\n\n convertXMLFieldToArrayInPlace(record, 'boundingBoxes');\n\n for (const boundingBox of record.boundingBoxes) {\n boundingBox.value = [\n boundingBox.upperCorner[0],\n boundingBox.upperCorner[1],\n boundingBox.lowerCorner[0],\n boundingBox.lowerCorner[1]\n ];\n delete boundingBox.upperCorner;\n delete boundingBox.lowerCorner;\n }\n }\n\n return xmlRecords as CSWRecords;\n}\n\nexport function renameXMLTags(xml: any, renameKeys: Record<string, string>): void {\n for (const [oldKey, newKey] of Object.entries(renameKeys)) {\n xml[newKey] = xml[oldKey];\n delete xml[oldKey];\n }\n}\n"],"mappings":"AAIA,SAA0BA,6BAA6B,QAAO,iBAAiB;AAC/E,SAAQC,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAgC5B,OAAO,SAASC,eAAeA,CAACC,IAAY,EAAEC,OAA0B,EAAc;EAAA,IAAAC,qBAAA,EAAAC,YAAA;EACpF,MAAMC,SAAS,IAAAF,qBAAA,GAAGL,SAAS,CAACQ,aAAa,cAAAH,qBAAA,uBAAvBA,qBAAA,CAAAI,IAAA,CAAAT,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVM,GAAG,EAAE;MACH,IAAGN,OAAO,aAAPA,OAAO,uBAAPA,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ClB,GAAQ,EAAEmB,UAAkC,EAAQ;EAChF,KAAK,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACJ,UAAU,CAAC,EAAE;IACzDnB,GAAG,CAACqB,MAAM,CAAC,GAAGrB,GAAG,CAACoB,MAAM,CAAC;IACzB,OAAOpB,GAAG,CAACoB,MAAM,CAAC;EACpB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-exception-report.js","names":["parseExceptionReport","parsedXML","_exceptionReport$exce","_exceptionReport$exce2","_exceptionReport$exce3","exceptionReport","errorMessage","exception","exceptionText","exceptionCode","locator","Error"],"sources":["../../../../src/lib/parsers/csw/parse-exception-report.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseExceptionReport(parsedXML: any): void {\n // const parsedXML = XMLLoader.parseTextSync?.(text, {\n // ...options,\n // xml: {\n // ...options?.xml,\n // removeNSPrefix: true,\n // uncapitalizeKeys: true\n // }\n // });\n\n const exceptionReport: any = parsedXML.exceptionReport;\n if (!exceptionReport) {\n return;\n }\n const errorMessage =\n exceptionReport.exception?.exceptionText ||\n exceptionReport.exception?.exceptionCode ||\n exceptionReport.exception?.locator ||\n 'server error';\n\n throw new Error(`Catalog Server: ${errorMessage}`);\n}\n"],"mappings":"AAWA,OAAO,SAASA,oBAAoBA,CAACC,SAAc,EAAQ;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAUzD,MAAMC,eAAoB,GAAGJ,SAAS,CAACI,eAAe;EACtD,IAAI,CAACA,eAAe,EAAE;IACpB;EACF;EACA,MAAMC,YAAY,GAChB,EAAAJ,qBAAA,GAAAG,eAAe,CAACE,SAAS,cAAAL,qBAAA,uBAAzBA,qBAAA,CAA2BM,aAAa,OAAAL,sBAAA,GACxCE,eAAe,CAACE,SAAS,cAAAJ,sBAAA,uBAAzBA,sBAAA,CAA2BM,aAAa,OAAAL,sBAAA,GACxCC,eAAe,CAACE,SAAS,cAAAH,sBAAA,uBAAzBA,sBAAA,CAA2BM,OAAO,KAClC,cAAc;EAEhB,MAAM,IAAIC,KAAK,CAAE,mBAAkBL,YAAa,EAAC,CAAC;AACpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-strict-equal.js","names":["deepStrictEqual","actual","expected","strict","Date","getTime","RegExp","source","global","multiline","lastIndex","ignoreCase","objEquiv","pSlice","Array","prototype","slice","isPrimitive","arg","isArguments","object","Object","toString","call","a","b","undefined","getPrototypeOf","aIsArgs","bIsArgs","ka","keys","kb","key","i","length","sort"],"sources":["../../../../src/lib/parsers/gml/deep-strict-equal.ts"],"sourcesContent":["// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** @todo replace this ridiculous choice of deepStrictEqual */\n// eslint-disable-next-line complexity\nexport function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n // } else if (actual instanceof Buffer && expected instanceof Buffer) {\n // return compare(actual, expected) === 0;\n\n // // 7.2. If the expected value is a Date object, the actual value is\n // // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (actual instanceof RegExp && expected instanceof RegExp) {\n return (\n actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase\n );\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (\n (actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')\n ) {\n // eslint-disable-next-line eqeqeq\n return strict ? actual === expected : actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n }\n return objEquiv(actual, expected, strict);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst pSlice = Array.prototype.slice;\n\nfunction isPrimitive(arg) {\n return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');\n}\n\nfunction isArguments(object) {\n // eslint-disable-next-line eqeqeq\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\n// eslint-disable-next-line complexity\nfunction objEquiv(a: unknown, b: unknown, strict) {\n if (a === null || a === undefined || b === null || b === undefined) return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b)) return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n const aIsArgs = isArguments(a);\n const bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepStrictEqual(a, b, strict);\n }\n const ka = Object.keys(a as object);\n const kb = Object.keys(b as object);\n let key;\n let i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length) return false;\n // the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n // ~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i]) return false;\n }\n // equivalent values for every corresponding key, and\n // ~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n // @ts-ignore\n if (!deepStrictEqual(a[key], b[key], strict)) return false;\n }\n return true;\n}\n"],"mappings":"AA4BA,OAAO,SAASA,eAAeA,CAACC,MAAe,EAAEC,QAAiB,EAAEC,MAAgB,EAAE;EAEpF,IAAIF,MAAM,KAAKC,QAAQ,EAAE;IACvB,OAAO,IAAI;EAMb,CAAC,MAAM,IAAID,MAAM,YAAYG,IAAI,IAAIF,QAAQ,YAAYE,IAAI,EAAE;IAC7D,OAAOH,MAAM,CAACI,OAAO,CAAC,CAAC,KAAKH,QAAQ,CAACG,OAAO,CAAC,CAAC;EAKhD,CAAC,MAAM,IAAIJ,MAAM,YAAYK,MAAM,IAAIJ,QAAQ,YAAYI,MAAM,EAAE;IACjE,OACEL,MAAM,CAACM,MAAM,KAAKL,QAAQ,CAACK,MAA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KAAK;EAC5D;EACA,OAAO,IAAI;AACb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-gml.js","names":["XMLLoader","deepStrictEqual","rewind","noTransform","_len","arguments","length","coords","Array","_key","parseGML","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","transformCoords","stride","context","createChildContext","parseGMLToGeometry","inputXML","childContext","geometry","name","xml","getFirstKeyValue","type","coordinates","parseLinearRingOrLineString","parsePolygonOrRectangle","parseSurface","parseMultiSurface","mutate","parseCoords","s","srsDimension","replace","trim","split","Error","points","i","_options$transformCoo","point","slice","map","parseFloat","push","parsePosList","textOf","parsePos","parsePoint","pos","findIn","posList","childName","childXML","Object","entries","parseCurveSegments","points2","end","start","shift","parseRing","lineString","segments","parseExteriorOrInterior","linearRing","ring","exterior","pointLists","patches","polygons","parseCompositeSurface","c2Name","c2Xml","el","surfaceMembers","polygons2","polygons3","parseSurfaceMember","polygonXML","surfaceMemberXML","childXml","root","_len2","tags","_key2","tag","child","object","key","value","srsDimensionAttribute","attributes","parseInt","Number","isNaN","create"],"sources":["../../../../src/lib/parsers/gml/parse-gml.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Forked from https://github.com/derhuerst/parse-gml-polygon/blob/master/index.js\n// under ISC license\n\n/* eslint-disable no-continue, default-case */\n\nimport type {\n // GeoJSON,\n // Feature,\n // FeatureCollection,\n Geometry,\n Position\n // GeoJsonProperties,\n // Point,\n // MultiPoint,\n // LineString,\n // MultiLineString,\n // Polygon,\n // MultiPolygon,\n // GeometryCollection\n} from '@loaders.gl/schema';\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {deepStrictEqual} from './deep-strict-equal';\nimport rewind from '@turf/rewind';\n\nfunction noTransform(...coords) {\n return coords;\n}\n\nexport type {Geometry};\n\nexport type ParseGMLOptions = {\n transformCoords?: Function;\n stride?: 2 | 3 | 4;\n};\n\nexport type ParseGMLContext = {\n srsDimension?: number;\n [key: string]: any;\n};\n\n/**\n * Parses a typed data structure from raw XML for GML features\n * @note Error handlings is fairly weak\n */\nexport function parseGML(text: string, options) {\n // GeoJSON | null {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n\n options = {transformCoords: noTransform, stride: 2, ...options};\n const context = createChildContext(parsedXML, options, {});\n\n return parseGMLToGeometry(parsedXML, options, context);\n}\n\n/** Parse a GeoJSON geometry from GML XML */\nexport function parseGMLToGeometry(\n inputXML: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Geometry | null {\n const childContext = createChildContext(inputXML, options, context);\n\n let geometry: Geometry | null = null;\n\n const [name, xml] = getFirstKeyValue(inputXML);\n\n switch (name) {\n // case 'gml:MultiPoint':\n // geometry = {\n // type: 'MultiPoint',\n // coordinates: parseMultiPoint(xml, options, childContext)\n // };\n // break;\n\n case 'gml:LineString':\n geometry = {\n type: 'LineString',\n coordinates: parseLinearRingOrLineString(xml, options, childContext)\n };\n break;\n\n // case 'gml:MultiLineString':\n // geometry = {\n // type: 'MultiLineString',\n // coordinates: parseMultiLineString(xml, options, childContext)\n // };\n // break;\n\n case 'gml:Polygon':\n case 'gml:Rectangle':\n geometry = {\n type: 'Polygon',\n coordinates: parsePolygonOrRectangle(xml, options, childContext)\n };\n break;\n case 'gml:Surface':\n geometry = {\n type: 'MultiPolygon',\n coordinates: parseSurface(xml, options, childContext)\n };\n break;\n case 'gml:MultiSurface':\n geometry = {\n type: 'MultiPolygon',\n coordinates: parseMultiSurface(xml, options, childContext)\n };\n break;\n\n default:\n return null;\n }\n\n // todo\n return rewind(geometry, {mutate: true});\n}\n\n/** Parse a list of coordinates from a string */\nfunction parseCoords(s: string, options: ParseGMLOptions, context: ParseGMLContext): Position[] {\n const stride = context.srsDimension || options.stride || 2;\n\n // Handle white space\n const coords = s.replace(/\\s+/g, ' ').trim().split(' ');\n\n if (coords.length === 0 || coords.length % stride !== 0) {\n throw new Error(`invalid coordinates list (stride ${stride})`);\n }\n\n const points: Position[] = [];\n for (let i = 0; i < coords.length - 1; i += stride) {\n const point = coords.slice(i, i + stride).map(parseFloat);\n points.push(options.transformCoords?.(...point) || point);\n }\n\n return points;\n}\n\nexport function parsePosList(xml: any, options: ParseGMLOptions, context: ParseGMLContext) {\n const childContext = createChildContext(xml, options, context);\n\n const coords = textOf(xml);\n if (!coords) {\n throw new Error('invalid gml:posList element');\n }\n\n return parseCoords(coords, options, childContext);\n}\n\nexport function parsePos(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position {\n const childContext = createChildContext(xml, options, context);\n\n const coords = textOf(xml);\n if (!coords) {\n throw new Error('invalid gml:pos element');\n }\n\n const points = parseCoords(coords, options, childContext);\n if (points.length !== 1) {\n throw new Error('gml:pos must have 1 point');\n }\n return points[0];\n}\n\nexport function parsePoint(xml: any, options: ParseGMLOptions, context: ParseGMLContext): number[] {\n const childContext = createChildContext(xml, options, context);\n\n // TODO AV: Parse other gml:Point options\n const pos = findIn(xml, 'gml:pos');\n if (!pos) {\n throw new Error('invalid gml:Point element, expected a gml:pos subelement');\n }\n return parsePos(pos, options, childContext);\n}\n\nexport function parseLinearRingOrLineString(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n // or a LineStringSegment\n const childContext = createChildContext(xml, options, context);\n\n let points: Position[] = [];\n\n const posList = findIn(xml, 'gml:posList');\n if (posList) {\n points = parsePosList(posList, options, childContext);\n } else {\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:Point':\n points.push(parsePoint(childXML, options, childContext));\n break;\n case 'gml:pos':\n points.push(parsePos(childXML, options, childContext));\n break;\n default:\n continue;\n }\n }\n }\n\n if (points.length === 0) {\n throw new Error(`${xml.name} must have > 0 points`);\n }\n return points;\n}\n\nexport function parseCurveSegments(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const points: Position[] = [];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:LineStringSegment':\n const points2 = parseLinearRingOrLineString(childXML, options, context);\n\n // remove overlapping\n const end = points[points.length - 1];\n const start = points2[0];\n if (end && start && deepStrictEqual(end, start)) {\n points2.shift();\n }\n\n points.push(...points2);\n break;\n default:\n continue;\n }\n }\n\n if (points.length === 0) {\n throw new Error('gml:Curve > gml:segments must have > 0 points');\n }\n return points;\n}\n\nexport function parseRing(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const childContext = createChildContext(xml, options, context);\n\n const points: Position[] = [];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:curveMember':\n let points2;\n\n const lineString = findIn(childXML, 'gml:LineString');\n if (lineString) {\n points2 = parseLinearRingOrLineString(lineString, options, childContext);\n } else {\n const segments = findIn(childXML, 'gml:Curve', 'gml:segments');\n if (!segments) {\n throw new Error(`invalid ${childName} element`);\n }\n\n points2 = parseCurveSegments(segments, options, childContext);\n }\n\n // remove overlapping\n const end = points[points.length - 1];\n const start = points2[0];\n if (end && start && deepStrictEqual(end, start)) {\n points2.shift();\n }\n\n points.push(...points2);\n\n break;\n }\n }\n\n if (points.length < 4) {\n throw new Error(`${xml.name} must have >= 4 points`);\n }\n return points;\n}\n\nexport function parseExteriorOrInterior(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const linearRing = findIn(xml, 'gml:LinearRing');\n if (linearRing) {\n return parseLinearRingOrLineString(linearRing, options, context);\n }\n\n const ring = findIn(xml, 'gml:Ring');\n if (!ring) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n return parseRing(ring, options, context);\n}\n\nexport function parsePolygonOrRectangle(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][] {\n // or PolygonPatch\n const childContext = createChildContext(xml, options, context);\n\n const exterior = findIn(xml, 'gml:exterior');\n if (!exterior) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n const pointLists: Position[][] = [parseExteriorOrInterior(exterior, options, childContext)];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:interior':\n pointLists.push(parseExteriorOrInterior(childXML, options, childContext));\n break;\n }\n }\n\n return pointLists;\n}\n\nexport function parseSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const childContext = createChildContext(xml, options, context);\n\n const patches = findIn(xml, 'gml:patches');\n if (!patches) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:PolygonPatch':\n case 'gml:Rectangle':\n polygons.push(parsePolygonOrRectangle(childXML, options, childContext));\n break;\n\n default:\n continue;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n\n return polygons;\n}\n\nexport function parseCompositeSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const childContext = createChildContext(xml, options, context);\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:surfaceMember':\n case 'gml:surfaceMembers':\n const [c2Name, c2Xml] = getFirstKeyValue(childXML);\n switch (c2Name) {\n case 'gml:Surface':\n polygons.push(...parseSurface(c2Xml, options, childContext));\n break;\n case 'gml:Polygon':\n polygons.push(parsePolygonOrRectangle(c2Xml, options, childContext));\n break;\n }\n break;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n return polygons;\n}\n\nexport function parseMultiSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n let el = xml;\n\n const surfaceMembers = findIn(xml, 'gml:LinearRing');\n if (surfaceMembers) {\n el = surfaceMembers;\n }\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(el)) {\n switch (childName) {\n case 'gml:Surface':\n const polygons2 = parseSurface(childXML, options, context);\n polygons.push(...polygons2);\n break;\n case 'gml:surfaceMember':\n const polygons3 = parseSurfaceMember(childXML, options, context);\n polygons.push(...polygons3);\n break;\n\n case 'gml:surfaceMembers':\n const polygonXML = findIn(childXML, 'gml:Polygon');\n for (const surfaceMemberXML of polygonXML as []) {\n const polygons3 = parseSurfaceMember(surfaceMemberXML, options, context);\n polygons.push(...polygons3);\n }\n break;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n\n return polygons;\n}\n\nfunction parseSurfaceMember(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const [childName, childXml] = getFirstKeyValue(xml);\n switch (childName) {\n case 'gml:CompositeSurface':\n return parseCompositeSurface(childXml, options, context);\n case 'gml:Surface':\n return parseSurface(childXml, options, context);\n case 'gml:Polygon':\n return [parsePolygonOrRectangle(childXml, options, context)];\n }\n throw new Error(`${childName} must have polygons`);\n}\n\n// Helpers\n\nfunction textOf(el: any): string {\n if (typeof el !== 'string') {\n throw new Error('expected string');\n }\n return el;\n}\n\nfunction findIn(root: any, ...tags: string[]): any {\n let el = root;\n for (const tag of tags) {\n const child = el[tag];\n if (!child) {\n return null;\n }\n el = child;\n }\n return el;\n}\n\n/** @returns the first [key, value] pair in an object, or ['', null] if empty object */\nfunction getFirstKeyValue(object: any): [string, any] {\n if (object && typeof object === 'object') {\n for (const [key, value] of Object.entries(object)) {\n return [key, value];\n }\n }\n return ['', null];\n}\n\n/** A bit heavyweight for just tracking dimension? */\nfunction createChildContext(xml, options, context): ParseGMLContext {\n const srsDimensionAttribute = xml.attributes && xml.attributes.srsDimension;\n\n if (srsDimensionAttribute) {\n const srsDimension = parseInt(srsDimensionAttribute);\n if (Number.isNaN(srsDimension) || srsDimension <= 0) {\n throw new Error(\n `invalid srsDimension attribute value \"${srsDimensionAttribute}\", expected a positive integer`\n );\n }\n\n const childContext = Object.create(context);\n childContext.srsDimension = srsDimension;\n return childContext;\n }\n\n return context;\n}\n"],"mappings":"AAy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SAASpD,gBAAgBA,CAACkE,MAAW,EAAiB;EACpD,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIpC,MAAM,CAACC,OAAO,CAACiC,MAAM,CAAC,EAAE;MACjD,OAAO,CAACC,GAAG,EAAEC,KAAK,CAAC;IACrB;EACF;EACA,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC;AACnB;AAGA,SAAS3E,kBAAkBA,CAACM,GAAG,EAAEd,OAAO,EAAEO,OAAO,EAAmB;EAClE,MAAM6E,qBAAqB,GAAGtE,GAAG,CAACuE,UAAU,IAAIvE,GAAG,CAACuE,UAAU,CAAC5D,YAAY;EAE3E,IAAI2D,qBAAqB,EAAE;IACzB,MAAM3D,YAAY,GAAG6D,QAAQ,CAACF,qBAAqB,CAAC;IACpD,IAAIG,MAAM,CAACC,KAAK,CAAC/D,YAAY,CAAC,IAAIA,YAAY,IAAI,CAAC,EAAE;MACnD,MAAM,IAAII,KAAK,CACZ,yCAAwCuD,qBAAsB,gCACjE,CAAC;IACH;IAEA,MAAMzE,YAAY,GAAGoC,MAAM,CAAC0C,MAAM,CAAClF,OAAO,CAAC;IAC3CI,YAAY,CAACc,YAAY,GAAGA,YAAY;IACxC,OAAOd,YAAY;EACrB;EAEA,OAAOJ,OAAO;AAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawJSON","json","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\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\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.json`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n json?: 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 includeRawJSON?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\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?.includeRawJSON) {\n capabilities.json = 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: xmlLayer?.Name && String(xmlLayer?.Name),\n abstract: xmlLayer?.Name && 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?.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent?.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent?.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n if (parent?.dimensions && !layer.dimensions) {\n layer.dimensions = [...parent.dimensions];\n }\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAIA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAExCC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa;AAsJf,OAAO,SAASC,oBAAoBA,CAClCC,OAAe,EACfC,OAAqC,EACpB;EAAA,IAAAC,qBAAA;EACjB,MAAMC,SAAS,IAAAD,qBAAA,GAAGT,SAAS,CAACW,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAZ,SAAS,EAAiBO,OAAO,EAAEC,OAAO,CAAC;EAC7D,MAAMK,eAAoB,GACxBH,SAAS,CAACI,mBAAmB,IAAIJ,SAAS,CAACK,gBAAgB,IAAIL,SAAS;EAC1E,MAAMM,YAAY,GAAGC,mBAAmB,CAACJ,eAAe,CAAC;EAGzD,IAAIL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEU,mBAAmB,EAAE;IAEhC,KAAK,MAAMC,KAAK,IAAIH,YAAY,CAACI,MAAM,EAAE;MACvCC,sBAAsB,CAACF,KAAK,EAAE,IAAI,CAAC;IACrC;EAEF;EAEA,IAAIX,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEc,cAAc,EAAE;IAC3BN,YAAY,CAACO,IAAI,GAAGV,eAAe;EACrC;EAEA,IAAIL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEgB,cAAc,EAAE;IAC3BR,YAAY,CAACS,GAAG,GAAGlB,OAAO;EAC5B;EAEA,OAAOS,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,EAA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AE;IAC7BvE,KAAK,CAACuE,GAAG,GAAG,CAAC,GAAGuD,MAAM,CAACvD,GAAG,CAAC;EAC7B;EAEA,IAAIuD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAE3C,aAAa,IAAI,CAACnF,KAAK,CAACmF,aAAa,EAAE;IACjDnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG2C,MAAM,CAAC3C,aAAa,CAAC;EACjD;EAEA,IAAI2C,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEtC,UAAU,IAAI,CAACxF,KAAK,CAACwF,UAAU,EAAE;IAC3CxF,KAAK,CAACwF,UAAU,GAAG,CAAC,GAAGsC,MAAM,CAACtC,UAAU,CAAC;EAC3C;EAEA,KAAK,MAAMuC,QAAQ,IAAI/H,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC6H,QAAQ,EAAE/H,KAAK,CAAC;EACzC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-error.js","names":["XMLLoader","parseWMSError","text","options","_XMLLoader$parseTextS","_parsedXML$ServiceExc","_parsedXML$ogcServic","parsedXML","parseTextSync","call","serviceExceptionXML","ServiceExceptionReport","ServiceException","message","value","code"],"sources":["../../../../src/lib/parsers/wms/parse-wms-error.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Extract an error message from WMS error response XML\n * @param text\n * @param options\n * @returns a string with a human readable message\n */\nexport function parseWMSError(text: string, options): string {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const serviceExceptionXML =\n parsedXML?.ServiceExceptionReport?.ServiceException ||\n parsedXML?.['ogc:ServiceExceptionReport']?.['ogc:ServiceException'];\n // Sigh, can be either a string or an object\n const message =\n typeof serviceExceptionXML === 'string'\n ? serviceExceptionXML\n : serviceExceptionXML.value || serviceExceptionXML.code || 'Unknown error';\n return message;\n}\n"],"mappings":"AAIA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,aAAaA,CAACC,IAAY,EAAEC,OAAO,EAAU;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,oBAAA;EAC3D,MAAMC,SAAS,IAAAH,qBAAA,GAAGJ,SAAS,CAACQ,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAT,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMO,mBAAmB,GACvB,CAAAH,SAAS,aAATA,SAAS,wBAAAF,qBAAA,GAATE,SAAS,CAAEI,sBAAsB,cAAAN,qBAAA,uBAAjCA,qBAAA,CAAmCO,gBAAgB,MACnDL,SAAS,aAATA,SAAS,wBAAAD,oBAAA,GAATC,SAAS,CAAG,4BAA4B,CAAC,cAAAD,oBAAA,uBAAzCA,oBAAA,CAA4C,sBAAsB,CAAC;EAErE,MAAMO,OAAO,GACX,OAAOH,mBAAmB,KAAK,QAAQ,GACnCA,mBAAmB,GACnBA,mBAAmB,CAACI,KAAK,IAAIJ,mBAAmB,CAACK,IAAI,IAAI,eAAe;EAC9E,OAAOF,OAAO;AAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-features.js","names":["XMLLoader","parseWMSFeatureInfo","text","options","_XMLLoader$parseTextS","_parsedXML$FeatureInf","parsedXML","parseTextSync","call","xmlFeatureInfo","FeatureInfoResponse","FIELDS","xmlFeatures","Array","isArray","features","map","xmlFeature","extractFeature","xmlFields","attributes","type","bounds","bottom","top","left","right"],"sources":["../../../../src/lib/parsers/wms/parse-wms-features.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** WMS Feature info - response to a WMS `GetFeatureInfo` request */\nexport type WMSFeatureInfo = {\n features: WMSFeature[];\n};\n\nexport type WMSFeature = {\n attributes: Record<string, number | string>;\n type: string;\n bounds: {top: number; bottom: number; left: number; right: number};\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSFeatureInfo(text: string, options): WMSFeatureInfo {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlFeatureInfo: any = parsedXML.FeatureInfoResponse?.FIELDS || [];\n\n const xmlFeatures = Array.isArray(xmlFeatureInfo) ? xmlFeatureInfo : [xmlFeatureInfo];\n\n return {\n features: xmlFeatures.map((xmlFeature) => extractFeature(xmlFeature))\n };\n}\n\nfunction extractFeature(xmlFeature: any) {\n const xmlFields = xmlFeature || {};\n // TODO - not correct\n return {\n attributes: xmlFields,\n type: '',\n bounds: {bottom: 0, top: 0, left: 0, right: 0}\n };\n}\n"],"mappings":"AAIA,SAAQA,SAAS,QAAO,iBAAiB;AAiBzC,OAAO,SAASC,mBAAmBA,CAACC,IAAY,EAAEC,OAAO,EAAkB;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACzE,MAAMC,SAAS,IAAAF,qBAAA,GAAGJ,SAAS,CAACO,aAAa,cAAAH,qBAAA,uBAAvBA,qBAAA,CAAAI,IAAA,CAAAR,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMM,cAAmB,GAAG,EAAAJ,qBAAA,GAAAC,SAAS,CAACI,mBAAmB,cAAAL,qBAAA,uBAA7BA,qBAAA,CAA+BM,MAAM,KAAI,EAAE;EAEvE,MAAMC,WAAW,GAAGC,KAAK,CAACC,OAAO,CAACL,cAAc,CAAC,GAAGA,cAAc,GAAG,CAACA,cAAc,CAAC;EAErF,OAAO;IACLM,QAAQ,EAAEH,WAAW,CAACI,GAAG,CAAEC,UAAU,IAAKC,cAAc,CAACD,UAAU,CAAC;EACtE,CAAC;AACH;AAEA,SAASC,cAAcA,CAACD,UAAe,EAAE;EACvC,MAAME,SAAS,GAAGF,UAAU,IAAI,CAAC,CAAC;EAElC,OAAO;IACLG,UAAU,EAAED,SAAS;IACrBE,IAAI,EAAE,EAAE;IACRC,MAAM,EAAE;MAACC,MAAM,EAAE,CAAC;MAAEC,GAAG,EAAE,CAAC;MAAEC,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAC;EAC/C,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wms-layer-description.js","names":["XMLLoader","parseWMSLayerDescription","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call"],"sources":["../../../../src/lib/parsers/wms/parse-wms-layer-description.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** Layer description - response to a WMS `DescribeLayer` request */\nexport type WMSLayerDescription = {\n layers: {}[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSLayerDescription(\n text: string,\n options?: XMLLoaderOptions\n): WMSLayerDescription {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n // TODO - implement parser\n return parsedXML as unknown as WMSLayerDescription;\n}\n"],"mappings":"AAKA,SAAQA,SAAS,QAAO,iBAAiB;AAWzC,OAAO,SAASC,wBAAwBA,CACtCC,IAAY,EACZC,OAA0B,EACL;EAAA,IAAAC,qBAAA;EACrB,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAE1D,OAAOE,SAAS;AAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-xml-helpers.js","names":["getXMLArray","xmlValue","Array","isArray","getXMLStringArray","xmlArray","length","every","_","getXMLFloat","defaultValue","arguments","undefined","parseFloat","getXMLInteger","parseInt","getXMLBoolean"],"sources":["../../../../src/lib/parsers/xml/parse-xml-helpers.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/** A single element of an array is not represented as an array in XML */\nexport function getXMLArray(xmlValue: any): any[] {\n // Already an array, return as is\n if (Array.isArray(xmlValue)) {\n return xmlValue;\n }\n // Single value, wrap in array\n if (xmlValue) {\n return [xmlValue];\n }\n // nullish, return empty array\n return [];\n}\n\n/** Get a list of strings from XML */\nexport function getXMLStringArray(xmlValue: any): string[] {\n const xmlArray = getXMLArray(xmlValue);\n if (xmlArray.length > 0 && xmlArray.every((_) => typeof _ === 'string')) {\n return xmlArray as string[];\n }\n // TODO - error handling?\n return [];\n}\n\n/** Get XML float */\nexport function getXMLFloat(xmlValue: any, defaultValue = undefined): number | undefined {\n switch (typeof xmlValue) {\n case 'number':\n return xmlValue;\n case 'string':\n return parseFloat(xmlValue);\n default:\n return undefined;\n }\n}\n\n/** Get XML integer */\nexport function getXMLInteger(xmlValue: any, defaultValue = undefined): number | undefined {\n switch (typeof xmlValue) {\n case 'number':\n return xmlValue;\n case 'string':\n return parseInt(xmlValue, 10);\n default:\n return undefined;\n }\n}\n\n/** Somewhat arbitrary boolean parsing */\nexport function getXMLBoolean(xmlValue: any): boolean {\n switch (xmlValue) {\n case 'true':\n return true;\n case 'false':\n return false;\n case '1':\n return true;\n case '0':\n return false;\n default:\n return false;\n }\n}\n"],"mappings":"AAKA,OAAO,SAASA,WAAWA,CAACC,QAAa,EAAS;EAEhD,IAAIC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3B,OAAOA,QAAQ;EACjB;EAEA,IAAIA,QAAQ,EAAE;IACZ,OAAO,CAACA,QAAQ,CAAC;EACnB;EAEA,OAAO,EAAE;AACX;AAGA,OAAO,SAASG,iBAAiBA,CAACH,QAAa,EAAY;EACzD,MAAMI,QAAQ,GAAGL,WAAW,CAACC,QAAQ,CAAC;EACtC,IAAII,QAAQ,CAACC,MAAM,GAAG,CAAC,IAAID,QAAQ,CAACE,KAAK,CAAEC,CAAC,IAAK,OAAOA,CAAC,KAAK,QAAQ,CAAC,EAAE;IACvE,OAAOH,QAAQ;EACjB;EAEA,OAAO,EAAE;AACX;AAGA,OAAO,SAASI,WAAWA,CAACR,QAAa,EAAgD;EAAA,IAA9CS,YAAY,GAAAC,SAAA,CAAAL,MAAA,QAAAK,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAGC,SAAS;EACjE,QAAQ,OAAOX,QAAQ;IACrB,KAAK,QAAQ;MACX,OAAOA,QAAQ;IACjB,KAAK,QAAQ;MACX,OAAOY,UAAU,CAACZ,QAAQ,CAAC;IAC7B;MACE,OAAOW,SAAS;EACpB;AACF;AAGA,OAAO,SAASE,aAAaA,CAACb,QAAa,EAAgD;EAAA,IAA9CS,YAAY,GAAAC,SAAA,CAAAL,MAAA,QAAAK,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAGC,SAAS;EACnE,QAAQ,OAAOX,QAAQ;IACrB,KAAK,QAAQ;MACX,OAAOA,QAAQ;IACjB,KAAK,QAAQ;MACX,OAAOc,QAAQ,CAACd,QAAQ,EAAE,EAAE,CAAC;IAC/B;MACE,OAAOW,SAAS;EACpB;AACF;AAGA,OAAO,SAASI,aAAaA,CAACf,QAAa,EAAW;EACpD,QAAQA,QAAQ;IACd,KAAK,MAAM;MACT,OAAO,IAAI;IACb,KAAK,OAAO;MACV,OAAO,KAAK;IACd,KAAK,GAAG;MACN,OAAO,IAAI;IACb,KAAK,GAAG;MACN,OAAO,KAAK;IACd;MACE,OAAO,KAAK;EAChB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-image-service.js","names":["createImageService","props","services","type","service","guessServiceType","url","getServiceOfType","Error","create","testURL"],"sources":["../../../src/lib/services/create-image-service.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ImageSource, Service} from '@loaders.gl/loader-utils';\nimport {ImageServiceProps} from './image-service';\n\nexport type CreateImageServiceProps = ImageServiceProps & {\n type?: string | 'auto';\n};\n\n/**\n * Creates an image source\n * If type is not supplied, will try to automatically detect the the\n * @param url URL to the image source\n * @param type type of source. if not known, set to 'auto'\n * @returns an ImageSource instance\n */\nexport function createImageService(\n props: CreateImageServiceProps,\n services: Service[]\n): ImageSource {\n const {type = 'auto'} = props;\n const service: Service | null =\n type === 'auto' ? guessServiceType(props.url, services) : getServiceOfType(type, services);\n\n if (!service) {\n throw new Error('Not a valid image source type');\n }\n return service.create(props);\n}\n\n/** Guess service type from URL */\nfunction getServiceOfType(type: string, services: Service[]): Service | null {\n // if (type === 'template') {\n // return ImageService;\n // }\n\n for (const service of services) {\n if (service.type === type) {\n return service;\n }\n }\n\n return null;\n}\n\n/** Guess service type from URL */\nfunction guessServiceType(url: string, services: Service[]): Service | null {\n for (const service of services) {\n if (service.testURL && service.testURL(url)) {\n return service;\n }\n }\n\n return null;\n}\n"],"mappings":"AAkBA,OAAO,SAASA,kBAAkBA,CAChCC,KAA8B,EAC9BC,QAAmB,EACN;EACb,MAAM;IAACC,IAAI,GAAG;EAAM,CAAC,GAAGF,KAAK;EAC7B,MAAMG,OAAuB,GAC3BD,IAAI,KAAK,MAAM,GAAGE,gBAAgB,CAACJ,KAAK,CAACK,GAAG,EAAEJ,QAAQ,CAAC,GAAGK,gBAAgB,CAACJ,IAAI,EAAED,QAAQ,CAAC;EAE5F,IAAI,CAACE,OAAO,EAAE;IACZ,MAAM,IAAII,KAAK,CAAC,+BAA+B,CAAC;EAClD;EACA,OAAOJ,OAAO,CAACK,MAAM,CAACR,KAAK,CAAC;AAC9B;AAGA,SAASM,gBAAgBA,CAACJ,IAAY,EAAED,QAAmB,EAAkB;EAK3E,KAAK,MAAME,OAAO,IAAIF,QAAQ,EAAE;IAC9B,IAAIE,OAAO,CAACD,IAAI,KAAKA,IAAI,EAAE;MACzB,OAAOC,OAAO;IAChB;EACF;EAEA,OAAO,IAAI;AACb;AAGA,SAASC,gBAAgBA,CAACC,GAAW,EAAEJ,QAAmB,EAAkB;EAC1E,KAAK,MAAME,OAAO,IAAIF,QAAQ,EAAE;IAC9B,IAAIE,OAAO,CAACM,OAAO,IAAIN,OAAO,CAACM,OAAO,CAACJ,GAAG,CAAC,EAAE;MAC3C,OAAOF,OAAO;IAChB;EACF;EAEA,OAAO,IAAI;AACb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-service.js","names":["ImageLoader","ImageSource","ImageService","constructor","props","getMetadata","Error","getImage","parameters","granularParameters","getGranularParameters","url","getURLFromTemplate","response","fetch","arrayBuffer","parse","east","north","west","south","boundingBox","key","value","Object","entries","replace","String","type","testURL","toLowerCase","includes"],"sources":["../../../src/lib/services/image-service.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\nimport {ImageSource} from '@loaders.gl/loader-utils';\n\n/** Template URL string should contain `${width}` etc which will be substituted. */\nexport type ImageServiceProps = {\n /** Base URL to the service */\n url: string;\n /** Any load options to the loaders.gl Loaders used by the WMSService methods */\n loadOptions?: LoaderOptions;\n};\n\n/**\n * Quickly connect to \"ad hoc\" image sources without subclassing ImageSource.\n * ImageSource allows template url strings to be used to ad hoc connect to arbitrary image data sources\n * Accepts a template url string and builds requests URLs\n */\nexport abstract class ImageService<\n PropsT extends ImageServiceProps = ImageServiceProps\n> extends ImageSource<PropsT> {\n static type: string = 'template';\n static testURL = (url: string): boolean => url.toLowerCase().includes('{');\n\n constructor(props: PropsT) {\n super(props);\n }\n\n // IMAGE SOURCE API\n\n async getMetadata(): Promise<ImageSourceMetadata> {\n throw new Error('ImageSource.getMetadata not implemented');\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n const granularParameters = this.getGranularParameters(parameters);\n const url = this.getURLFromTemplate(granularParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n return await ImageLoader.parse(arrayBuffer);\n }\n\n // HELPERS\n\n /** Break up bounding box in east, north, south, west */\n protected getGranularParameters(parameters: GetImageParameters): Record<string, unknown> {\n const [[east, north], [west, south]] = parameters.boundingBox;\n return {...parameters, east, north, south, west};\n }\n\n /** Supports both ${} and {} notations */\n protected getURLFromTemplate(parameters: Record<string, unknown>): string {\n let url = this.props.url;\n for (const [key, value] of Object.entries(parameters)) {\n // TODO - parameter could be repeated\n // const regex = new RegExp(`\\${${key}}`, 'g');\n url = url.replace(`\\${${key}}`, String(value));\n url = url.replace(`{${key}}`, String(value));\n }\n return url;\n }\n}\n"],"mappings":"AAMA,SAAQA,WAAW,QAAO,oBAAoB;AAG9C,SAAQC,WAAW,QAAO,0BAA0B;AAepD,OAAO,MAAeC,YAAY,SAExBD,WAAW,CAAS;EAI5BE,WAAWA,CAACC,KAAa,EAAE;IACzB,KAAK,CAACA,KAAK,CAAC;EACd;EAIA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,MAAM,IAAIC,KAAK,CAAC,yCAAyC,CAAC;EAC5D;EAEA,MAAMC,QAAQA,CAACC,UAA8B,EAAsB;IACjE,MAAMC,kBAAkB,GAAG,IAAI,CAACC,qBAAqB,CAACF,UAAU,CAAC;IACjE,MAAMG,GAAG,GAAG,IAAI,CAACC,kBAAkB,CAACH,kBAAkB,CAAC;IACvD,MAAMI,QAAQ,GAAG,MAAM,IAAI,CAACC,KAAK,CAACH,GAAG,CAAC;IACtC,MAAMI,WAAW,GAAG,MAAMF,QAAQ,CAACE,WAAW,CAAC,CAAC;IAChD,OAAO,MAAMf,WAAW,CAACgB,KAAK,CAACD,WAAW,CAAC;EAC7C;EAKUL,qBAAqBA,CAACF,UAA8B,EAA2B;IACvF,MAAM,CAAC,CAACS,IAAI,EAAEC,KAAK,CAAC,EAAE,CAACC,IAAI,EAAEC,KAAK,CAAC,CAAC,GAAGZ,UAAU,CAACa,WAAW;IAC7D,OAAO;MAAC,GAAGb,UAAU;MAAES,IAAI;MAAEC,KAAK;MAAEE,KAAK;MAAED;IAAI,CAAC;EAClD;EAGUP,kBAAkBA,CAACJ,UAAmC,EAAU;IACxE,IAAIG,GAAG,GAAG,IAAI,CAACP,KAAK,CAACO,GAAG;IACxB,KAAK,MAAM,CAACW,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACjB,UAAU,CAAC,EAAE;MAGrDG,GAAG,GAAGA,GAAG,CAACe,OAAO,CAAE,MAAKJ,GAAI,GAAE,EAAEK,MAAM,CAACJ,KAAK,CAAC,CAAC;MAC9CZ,GAAG,GAAGA,GAAG,CAACe,OAAO,CAAE,IAAGJ,GAAI,GAAE,EAAEK,MAAM,CAACJ,KAAK,CAAC,CAAC;IAC9C;IACA,OAAOZ,GAAG;EACZ;AACF;AA3CsBT,YAAY,CAGzB0B,IAAI,GAAW,UAAU;AAHZ1B,YAAY,CAIzB2B,OAAO,GAAIlB,GAAW,IAAcA,GAAG,CAACmB,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,GAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arcgis-image-service.js","names":["ImageService","ArcGISImageSource","constructor","props","data","url","getMetadata","metadata","getImage","parameters","Error","exportImage","options","metadataURL","exportImageURL","bbox","size","width","height","arcgisOptions","getUrl","path","extra","first","key","value","Object","entries","Array","isArray","toUpperCase","join","String","checkResponse","response","ok","ArcGISImageService","type","testURL","toLowerCase","includes","create"],"sources":["../../../src/services/arcgis/arcgis-image-service.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\n\nimport type {ImageServiceProps} from '../../lib/services/image-service';\nimport {ImageService} from '../../lib/services/image-service';\n\n// import type {ImageSourceProps} from '@loaders.gl/loader-utils';\n// import {ImageSource} from '@loaders.gl/loader-utils';\n\nexport type ArcGISImageServerProps = ImageServiceProps & {\n url: string;\n};\n\n/**\n * ArcGIS ImageServer\n * Note - exports a big API, that could be exposed here if there is a use case\n * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm\n */\nexport class ArcGISImageSource extends ImageService<ArcGISImageServerProps> {\n data: string;\n\n constructor(props: ArcGISImageServerProps) {\n super(props);\n this.data = props.url;\n }\n\n // ImageSource (normalized endpoints)\n\n async getMetadata(): Promise<ImageSourceMetadata> {\n return (await this.metadata()) as ImageSourceMetadata;\n // TODO - normalize metadata\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n throw new Error('not implemented');\n // TODO - Map generic parameters to ArcGIS specific parameters\n // return await this.exportImage(parameters);\n }\n\n // ImageServer endpoints\n\n async metadata(): Promise<unknown> {\n // We just need a JSON parsing...\n // return this.getUrl({path: '', ...options});\n throw new Error('not implemented');\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image`,\n */\n exportImage(options: {\n boundingBox: [number, number, number, number];\n boundingBoxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): Promise<ImageType> {\n // See WMSService.getMap()\n throw new Error('not implemented');\n }\n\n // URL creators\n\n metadataURL(options: {parameters?: Record<string, unknown>}): string {\n return `${this.props.url}?f=pjson`;\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?\n // bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&\n // size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&\n // noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&\n // compressionQuality=&bandIds=&mosaicRule=&renderingRule=&\n // f=image\n */\n exportImageURL(options: {\n bbox: [number, number, number, number];\n boxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): string {\n const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;\n const size = `size=${options.width},${options.height}`;\n const arcgisOptions = {...options, bbox, size};\n // @ts-expect-error\n delete arcgisOptions.width;\n // @ts-expect-error\n delete arcgisOptions.height;\n return this.getUrl('exportImage', arcgisOptions);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note protected, since perhaps getWMSUrl may need to be overridden to handle certain backends?\n * @note if override is common, maybe add a callback prop?\n * */\n protected getUrl(\n path: string,\n options: Record<string, unknown>,\n extra?: Record<string, unknown>\n ): string {\n let url = `${this.props.url}/${path}`;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return url;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected async checkResponse(response: Response) {\n if (!response.ok) {\n // } || response.headers['content-type'] === WMSErrorLoader.mimeTypes[0]) {\n // const arrayBuffer = await response.arrayBuffer();\n // const error = await WMSErrorLoader.parse(arrayBuffer, this.loadOptions);\n throw new Error('error');\n }\n }\n}\n\nexport const ArcGISImageService: Service = {\n type: 'arcgis-image-server',\n testURL: (url: string): boolean => url.toLowerCase().includes('ImageServer'),\n create: (props: ArcGISImageServerProps): ArcGISImageSource => new ArcGISImageSource(props)\n};\n"],"mappings":"SAQQA,YAAY;AAcpB,OAAO,MAAMC,iBAAiB,SAASD,YAAY,CAAyB;EAG1EE,WAAWA,CAACC,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,CAAC;IAAC,KAHfC,IAAI;IAIF,IAAI,CAACA,IAAI,GAAGD,KAAK,CAACE,GAAG;EACvB;EAIA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,OAAQ,MAAM,IAAI,CAACC,QAAQ,CAAC,CAAC;EAE/B;EAEA,MAAMC,QAAQA,CAACC,UAA8B,EAAsB;IACjE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EAGpC;EAIA,MAAMH,QAAQA,CAAA,EAAqB;IAGjC,MAAM,IAAIG,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAMAC,WAAWA,CAACC,OAkBX,EAAsB;IAErB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAIAG,WAAWA,CAACD,OAA+C,EAAU;IACnE,OAAQ,GAAE,IAAI,CAACT,KAAK,CAACE,GAAI,UAAS;EACpC;EAWAS,cAAcA,CAACF,OAkBd,EAAU;IACT,MAAMG,IAAI,GAAI,QAAOH,OAAO,CAACG,IAAI,CAAC,CAAC,CAAE,IAAGH,OAAO,CAACG,IAAI,CAAC,CAAC,CAAE,IAAGH,OAA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kBAA2B,GAAG;EACzCC,IAAI,EAAE,qBAAqB;EAC3BC,OAAO,EAAGjC,GAAW,IAAcA,GAAG,CAACkC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,aAAa,CAAC;EAC5EC,MAAM,EAAGtC,KAA6B,IAAwB,IAAIF,iBAAiB,CAACE,KAAK;AAC3F,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arcgis-server.js","names":["getArcGISServices","url","fetchFile","arguments","length","undefined","fetch","includes","serverUrl","replace","loadServiceDirectory","path","serviceUrl","join","response","directory","json","services","extractServices","folders","promises","map","folder","folderServices","Promise","all","push","arcgisServices","service","name","type","toLocaleLowerCase"],"sources":["../../../src/services/arcgis/arcgis-server.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type Service = {name: string; type: string; url: string};\n\ntype FetchLike = typeof fetch;\n\n/**\n * (Recursively) load the service directory from an ArcGIS Server URL\n * @param url\n * @param fetchFile= Optional fetch function override\n * @returns\n */\nexport async function getArcGISServices(\n url: string,\n fetchFile: FetchLike = fetch\n): Promise<Service[] | null> {\n if (url.includes('rest/services')) {\n const serverUrl = url.replace(/rest\\/services.*$/i, 'rest/services');\n return loadServiceDirectory(serverUrl, fetchFile, []);\n }\n return null;\n}\n\nasync function loadServiceDirectory(\n serverUrl: string,\n fetch: FetchLike,\n path: string[]\n): Promise<Service[]> {\n const serviceUrl = `${serverUrl}/${path.join('/')}`;\n\n const response = await fetch(`${serviceUrl}?f=pjson`);\n const directory = await response.json();\n\n const services = extractServices(directory, serviceUrl);\n\n const folders = (directory.folders || []) as string[];\n const promises = folders.map((folder) =>\n loadServiceDirectory(`${serverUrl}`, fetch, [...path, folder])\n );\n\n for (const folderServices of await Promise.all(promises)) {\n services.push(...folderServices);\n }\n\n return services;\n}\n\nfunction extractServices(directory: unknown, url: string): Service[] {\n const arcgisServices = ((directory as any).services || []) as {name: string; type: string}[];\n const services: Service[] = [];\n for (const service of arcgisServices) {\n services.push({\n name: service.name,\n type: `arcgis-${service.type.toLocaleLowerCase().replace('server', '-server')}`,\n url: `${url}${service.name}/${service.type}`\n });\n }\n return services;\n}\n"],"mappings":"AAcA,OAAO,eAAeA,iBAAiBA,CACrCC,GAAW,EAEgB;EAAA,IAD3BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;EAE5B,IAAIL,GAAG,CAACM,QAAQ,CAAC,eAAe,CAAC,EAAE;IACjC,MAAMC,SAAS,GAAGP,GAAG,CAACQ,OAAO,CAAC,oBAAoB,EAAE,eAAe,CAAC;IACpE,OAAOC,oBAAoB,CAACF,SAAS,EAAEN,SAAS,EAAE,EAAE,CAAC;EACvD;EACA,OAAO,IAAI;AACb;AAEA,eAAeQ,oBAAoBA,CACjCF,SAAiB,EACjBF,KAAgB,EAChBK,IAAc,EACM;EACpB,MAAMC,UAAU,GAAI,GAAEJ,SAAU,IAAGG,IAAI,CAACE,IAAI,CAAC,GAAG,CAAE,EAAC;EAEnD,MAAMC,QAAQ,GAAG,MAAMR,KAAK,CAAE,GAAEM,UAAW,UAAS,CAAC;EACrD,MAAMG,SAAS,GAAG,MAAMD,QAAQ,CAACE,IAAI,CAAC,CAAC;EAEvC,MAAMC,QAAQ,GAAGC,eAAe,CAACH,SAAS,EAAEH,UAAU,CAAC;EAEvD,MAAMO,OAAO,GAAIJ,SAAS,CAACI,OAAO,IAAI,EAAe;EACrD,MAAMC,QAAQ,GAAGD,OAAO,CAACE,GAAG,CAAEC,MAAM,IAClCZ,oBAAoB,CAAE,GAAEF,SAAU,EAAC,EAAEF,KAAK,EAAE,CAAC,GAAGK,IAAI,EAAEW,MAAM,CAAC,CAC/D,CAAC;EAED,KAAK,MAAMC,cAAc,IAAI,MAAMC,OAAO,CAACC,GAAG,CAACL,QAAQ,CAAC,EAAE;IACxDH,QAAQ,CAACS,IAAI,CAAC,GAAGH,cAAc,CAAC;EAClC;EAEA,OAAON,QAAQ;AACjB;AAEA,SAASC,eAAeA,CAACH,SAAkB,EAAEd,GAAW,EAAa;EACnE,MAAM0B,cAAc,GAAKZ,SAAS,CAASE,QAAQ,IAAI,EAAqC;EAC5F,MAAMA,QAAmB,GAAG,EAAE;EAC9B,KAAK,MAAMW,OAAO,IAAID,cAAc,EAAE;IACpCV,QAAQ,CAACS,IAAI,CAAC;MACZG,IAAI,EAAED,OAAO,CAACC,IAAI;MAClBC,IAAI,EAAG,UAASF,OAAO,CAACE,IAAI,CAACC,iBAAiB,CAAC,CAAC,CAACtB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAE,EAAC;MAC/ER,GAAG,EAAG,GAAEA,GAAI,GAAE2B,OAAO,CAACC,IAAK,IAAGD,OAAO,CAACE,IAAK;IAC7C,CAAC,CAAC;EACJ;EACA,OAAOb,QAAQ;AACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-image-source.js","names":["createImageService","WMSService","ArcGISImageService","SERVICES","createImageSource","props"],"sources":["../../src/services/create-image-source.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Service, ImageSource} from '@loaders.gl/loader-utils';\n// import {ImageService} from '../lib/services/image-service';\nimport {ImageServiceProps} from '../lib/services/image-service';\nimport {createImageService, CreateImageServiceProps} from '../lib/services/create-image-service';\n\nimport type {WMSSourceProps} from './ogc/wms-service';\nimport {WMSService} from './ogc/wms-service';\nimport {ArcGISImageService} from './arcgis/arcgis-image-service';\n\nexport type ImageServiceType = 'wms' | 'arcgis-image-server' | 'template';\n\nconst SERVICES: Service[] = [WMSService, ArcGISImageService];\n\ntype CreateImageSourceProps = CreateImageServiceProps &\n ImageServiceProps &\n WMSSourceProps & {\n type?: ImageServiceType | 'auto';\n };\n\n/**\n * Creates an image source\n * If type is not supplied, will try to automatically detect the the\n * @param url URL to the image source\n * @param type type of source. if not known, set to 'auto'\n * @returns an ImageSource instance\n */\nexport function createImageSource(props: CreateImageSourceProps): ImageSource {\n return createImageService(props, SERVICES);\n}\n"],"mappings":"SAOQA,kBAAkB;AAAA,SAGlBC,UAAU;AAAA,SACVC,kBAAkB;AAI1B,MAAMC,QAAmB,GAAG,CAACF,UAAU,EAAEC,kBAAkB,CAAC;AAe5D,OAAO,SAASE,iBAAiBA,CAACC,KAA6B,EAAe;EAC5E,OAAOL,kBAAkB,CAACK,KAAK,EAAEF,QAAQ,CAAC;AAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csw-service.js","names":["DataSource","CSWCapabilitiesLoader","CSWRecordsLoader","CSWDomainLoader","WMSErrorLoader","CSWErrorLoader","CSWService","constructor","props","capabilities","data","url","loaders","getMetadata","getCapabilities","normalizeMetadata","getServiceDirectory","options","services","unknownServices","records","getRecords","record","reference","references","value","scheme","push","name","title","type","_parseOGCUrl","includeUnknown","concat","parts","split","params","wmsParameters","vendorParameters","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getRecordsURL","getDomain","getDomainURL","version","service","request","_getCSWUrl","typenames","first","key","Object","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","_CSWErrorLoader$parse","error","parseSync","call","Error","_parseError","_CSWErrorLoader$parse2","testURL","toLowerCase"],"sources":["../../../src/services/ogc/csw-service.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable camelcase */\n\nimport type {DataSourceProps} from '@loaders.gl/loader-utils';\nimport {DataSource} from '@loaders.gl/loader-utils';\n\nimport type {CSWCapabilities} from '../../csw-capabilities-loader';\nimport {CSWCapabilitiesLoader} from '../../csw-capabilities-loader';\n\nimport type {CSWRecords} from '../../csw-records-loader';\nimport {CSWRecordsLoader} from '../../csw-records-loader';\n\nimport type {CSWDomain} from '../../csw-domain-loader';\nimport {CSWDomainLoader} from '../../csw-domain-loader';\n\nimport {WMSErrorLoader as CSWErrorLoader} from '../../wms-error-loader';\n\ntype CSWCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'CSW';\n /** In case the endpoint supports multiple CSW versions */\n version?: '1.1.1' | '2.0.0' | '2.0.1' | '3.0.0';\n};\n\nexport type CSWGetCapabilitiesParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type CSWGetRecordsParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetRecords';\n /** type of records */\n typenames: 'csw:Record';\n};\n\nexport type CSWGetDomainParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetDomain';\n // TBA\n};\n\n/** Describes a service or resource exposed by the catalog */\nexport type Service = {\n /** name of service or resource */\n name: string;\n /** type of service or resource */\n type: string;\n url: string;\n params?: string;\n scheme?: string;\n};\n\nexport type CSWServiceProps = DataSourceProps & {\n url: string;\n};\n\n/**\n * The CSWService class\n * - provides type safe methods to form URLs to a CSW service\n * - provides type safe methods to query and parse results (and errors) from a CSW service\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class CSWService extends DataSource<CSWServiceProps> {\n static readonly type = 'csw';\n static testURL = (url: string): boolean => url.toLowerCase().includes('csw');\n\n capabilities: CSWCapabilities | null = null;\n data: string;\n url: string;\n\n /** A list of loaders used by the CSWService methods */\n readonly loaders = [CSWErrorLoader, CSWCapabilitiesLoader];\n\n /** Create a CSWService */\n constructor(props: CSWServiceProps) {\n super(props);\n this.url = props.url;\n this.data = props.url;\n }\n\n async getMetadata(): Promise<CSWCapabilities> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n normalizeMetadata(capabilities: CSWCapabilities): CSWCapabilities {\n return capabilities;\n }\n\n async getServiceDirectory(options?: {includeUnknown?: boolean}): Promise<Service[]> {\n const services: Service[] = [];\n const unknownServices: Service[] = [];\n\n const records = await this.getRecords();\n for (const record of records.records) {\n for (const reference of record.references) {\n const url = reference.value;\n switch (reference.scheme) {\n case 'OGC:WMS':\n services.push({name: record.title, type: 'ogc-wms-service', ...this._parseOGCUrl(url)});\n break;\n case 'OGC:WMTS':\n services.push({\n name: record.title,\n type: 'ogc-wmts-service',\n ...this._parseOGCUrl(url)\n });\n break;\n case 'OGC:WFS':\n services.push({name: record.title, type: 'ogc-wfs-service', ...this._parseOGCUrl(url)});\n break;\n default:\n unknownServices.push({\n name: record.title,\n type: 'unknown',\n url: reference.value,\n scheme: reference.scheme\n });\n }\n }\n }\n\n return options?.includeUnknown ? services.concat(unknownServices) : services;\n }\n\n _parseOGCUrl(url: string): {url: string; params: string} {\n const parts = url.split('?');\n return {\n url: parts[0],\n params: parts[1] || ''\n };\n }\n\n // CSW Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);\n return capabilities;\n }\n\n /** Get Records */\n async getRecords(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWRecords> {\n const url = this.getRecordsURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n /** Get Domain */\n async getDomain(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWDomain> {\n const url = this.getDomainURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetCapabilitiesParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetCapabilities'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getRecordsURL(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetRecordsParameters> = {\n version: '3.0.0',\n typenames: 'csw:Record',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetRecords'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getDomainURL(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetDomainParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetDomain'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getCSWUrl may need to be overridden to handle certain backends?\n * */\n protected _getCSWUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.props.url;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a CSW XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || CSWErrorLoader.mimeTypes.includes(contentType)) {\n const error = CSWErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = CSWErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":"AAOA,SAAQA,UAAU,QAAO,0BAA0B;AAAC,SAG5CC,qBAAqB;AAAA,SAGrBC,gBAAgB;AAAA,SAGhBC,eAAe;AAAA,SAEfC,cAAc,IAAIC,cAAc;AAgDxC,OAAO,MAAMC,UAAU,SAASN,UAAU,CAAkB;EAY1DO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CAAC;IAAC,KATfC,YAAY,GAA2B,IAAI;IAAA,KAC3CC,IAAI;IAAA,KACJC,GAAG;IAAA,KAGMC,OAAO,GAAG,CAACP,cAAc,EAAEJ,qBAAqB,CAAC;IAKxD,IAAI,CAACU,GAAG,GAAGH,KAAK,CAACG,GAAG;IACpB,IAAI,CAACD,IAAI,GAAGF,KAAK,CAACG,GAAG;EACvB;EAEA,MAAME,WAAWA,CAAA,EAA6B;IAC5C,MAAMJ,YAAY,GAAG,MAAM,IAAI,CAACK,eAAe,CAAC,CAAC;IACjD,OAAO,IAAI,CAACC,iBAAiB,CAACN,YAAY,CAAC;EAC7C;EAEAM,iBAAiBA,CAACN,YAA6B,EAAmB;IAChE,OAAOA,YAAY;EACrB;EAEA,MAAMO,mBAAmBA,CAACC,OAAoC,EAAsB;IAClF,MAAMC,QAAmB,GAAG,EAAE;IAC9B,MAAMC,eAA0B,GAAG,EAAE;IAErC,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACC,UAAU,CAAC,CAAC;IACvC,KAAK,MAAMC,MAAM,IAAIF,OAAO,CAACA,OAAO,EAAE;MACpC,KAAK,MAAMG,SAAS,IAAID,MAAM,CAACE,UAAU,EAAE;QACzC,MAAMb,GAAG,GAAGY,SAAS,CAACE,KAAK;QAC3B,QAAQF,SAAS,CAACG,MAAM;UACtB,K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"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","type","testURL","url","toLowerCase","includes","create","props","WMSSource","constructor","_props$substituteCRS","data","substituteCRS84","flipCRS","wmsParameters","vendorParameters","capabilities","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","time","elevation","getMetadata","getCapabilities","normalizeMetadata","getImage","parameters","boundingBox","bbox","rest","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_getWMS130Parameters","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","IGNORE_EMPTY_KEYS","Object","entries","_getURLParameter","encodeURI","newParameters","srs","_flipBoundingBox","toUpperCase","Array","isArray","join","String","bboxValue","length","flipCoordinates","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","_WMSErrorLoader$parse","wms","throwOnError","error","parseSync","call","Error","_WMSErrorLoader$parse2"],"sources":["../../../src/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable camelcase */\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\nimport {ImageSource} from '@loaders.gl/loader-utils';\nimport type {ImageServiceProps} from '../../lib/services/image-service';\n\nimport type {WMSCapabilities} from '../../wms-capabilities-loader';\nimport type {WMSFeatureInfo} from '../../wip/wms-feature-info-loader';\nimport type {WMSLayerDescription} from '../../wip/wms-layer-description-loader';\n\nimport {WMSCapabilitiesLoader} from '../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../wip/wms-layer-description-loader';\n\nimport type {WMSLoaderOptions} from '../../wms-error-loader';\nimport {WMSErrorLoader} from '../../wms-error-loader';\n\nexport const WMSService: Service<WMSSource, WMSSourceProps> = {\n type: 'wms',\n testURL: (url: string): boolean => url.toLowerCase().includes('wms'),\n create: (props: WMSSourceProps) => new WMSSource(props)\n};\n\n/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSSource constructor\n */\nexport type WMSParameters = {\n /** WMS version (all requests) */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render (GetMap, GetFeatureInfo) */\n layers?: string[];\n /** list of layers to query.. (GetFeatureInfo) */\n query_layers?: string[];\n\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image (GetMap, GetLegendGraphic) */\n format?: 'image/png';\n /** Requested MIME type of returned feature info (GetFeatureInfo) */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSSource (GetMap) */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** bounding box of the requested map image `[[w, s], [e, n]]` */\n // boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** bounding box of the requested map image @deprecated Use .boundingBox */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** requested format for the return image. can be provided in service constructor */\n format?: 'image/png';\n /** Layers to render - can be provided in service constructor */\n layers?: string | string[];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n /** Styling. can be provided in service constructor */\n styles?: unknown;\n /** Don't render background when no data. can be provided in service constructor */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n// /** GetMap parameters that are specific to the current view */\n// export type WMSGetMapViewParameters = {\n// /** pixel width of returned image */\n// width: number;\n// /** pixels */\n// height: number;\n// /** bounding box of the requested map image */\n// bbox: [number, number, number, number];\n// /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n// crs?: string;\n// };\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** MIME type of returned feature info. Can be specified in service constructor */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** list of layers to query. Required but can be specified in service constructor. */\n query_layers?: string[];\n /** Layers to render. Required, but can be specified in service constructor */\n layers?: 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 /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSSourceProps = ImageServiceProps & {\n /** Base URL to the service */\n url: string;\n /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n substituteCRS84?: boolean;\n /** Default WMS parameters. If not provided here, must be provided in the various request */\n wmsParameters?: WMSParameters;\n /** Any additional service specific parameters */\n vendorParameters?: Record<string, unknown>;\n};\n\n/**\n * The WMSSource class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSSource extends ImageSource<WMSSourceProps> {\n /** Base URL to the service */\n readonly url: string;\n readonly data: string;\n\n /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n substituteCRS84: boolean;\n /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n flipCRS: string[];\n\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** Create a WMSSource */\n constructor(props: WMSSourceProps) {\n super(props);\n\n // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters\n // This would make pasting in any WMS URL more likely to make this class just work.\n // const {baseUrl, parameters} = this._parseWMSUrl(props.url);\n\n this.url = props.url;\n this.data = props.url;\n\n this.substituteCRS84 = props.substituteCRS84 ?? false;\n this.flipCRS = ['EPSG:4326'];\n\n this.wmsParameters = {\n layers: undefined!,\n query_layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n time: undefined!,\n elevation: undefined!,\n ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // ImageService implementation\n async getMetadata(): Promise<ImageSourceMetadata> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n // Replace the GetImage `boundingBox` parameter with the WMS flat `bbox` parameter.\n const {boundingBox, bbox, ...rest} = parameters;\n const wmsParameters: WMSGetMapParameters = {\n bbox: boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!,\n ...rest\n };\n return await this.getMap(wmsParameters);\n }\n\n normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n return capabilities;\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n time: this.wmsParameters.time,\n elevation: this.wmsParameters.elevation,\n layers: this.wmsParameters.layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // query_layers: [],\n // format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n layers: this.wmsParameters.layers,\n query_layers: this.wmsParameters.query_layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n const IGNORE_EMPTY_KEYS = ['transparent', 'time', 'elevation'];\n for (const [key, value] of Object.entries(allParameters)) {\n // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n if (!IGNORE_EMPTY_KEYS.includes(key) || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getURLParameter(key, value, wmsParameters);\n }\n }\n\n return encodeURI(url);\n }\n\n _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n wmsParameters: ParametersT\n ): ParametersT {\n const newParameters = {...wmsParameters};\n if (newParameters.srs) {\n newParameters.crs = newParameters.crs || newParameters.srs;\n delete newParameters.srs;\n }\n return newParameters;\n }\n\n // eslint-disable-next-line complexity\n _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n // Substitute by key\n switch (key) {\n case 'crs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version !== '1.3.0') {\n key = 'srs';\n } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n // Substitute by value\n value = 'CRS:84';\n }\n break;\n\n case 'srs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version === '1.3.0') {\n key = 'crs';\n }\n break;\n\n case 'bbox':\n // Coordinate order is flipped for certain CRS in WMS 1.3.0\n const bbox = this._flipBoundingBox(value, wmsParameters);\n if (bbox) {\n value = bbox;\n }\n break;\n\n default:\n // do nothing\n }\n\n key = key.toUpperCase();\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n _flipBoundingBox(\n bboxValue: unknown,\n wmsParameters: WMSParameters\n ): [number, number, number, number] | null {\n // Sanity checks\n if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n return null;\n }\n\n const flipCoordinates =\n // Only affects WMS 1.3.0\n wmsParameters.version === '1.3.0' &&\n // Flip if we are dealing with a CRS that was flipped in 1.3.0\n this.flipCRS.includes(wmsParameters.crs || '') &&\n // Don't flip if we are subsituting EPSG:4326 with CRS:84\n !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n const bbox = bboxValue as [number, number, number, number];\n return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n }\n\n /** Fetches an array buffer and checks the response (boilerplate reduction) */\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":"AAM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AAc,CAACH,QAAQ,EAAEE,WAAW,CAAC;IAC1C,OAAOA,WAAW;EACpB;EAGUC,cAAcA,CAACH,QAAkB,EAAEE,WAAwB,EAAQ;IAC3E,MAAM+C,WAAW,GAAGjD,QAAQ,CAACkD,OAAO,CAAC,cAAc,CAAC;IACpD,IAAI,CAAClD,QAAQ,CAACmD,EAAE,IAAI1F,cAAc,CAAC2F,SAAS,CAACrF,QAAQ,CAACkF,WAAW,CAAC,EAAE;MAAA,IAAAI,qBAAA;MAElE,MAAMhD,WAAW,GAAGjD,kBAAkB,CAAmB,IAAI,CAACiD,WAAW,EAAE;QACzEiD,GAAG,EAAE;UAACC,YAAY,EAAE;QAAI;MAC1B,CAAC,CAAC;MACF,MAAMC,KAAK,IAAAH,qBAAA,GAAG5F,cAAc,CAACgG,SAAS,cAAAJ,qBAAA,uBAAxBA,qBAAA,CAAAK,IAAA,CAAAjG,cAAc,EAAayC,WAAW,EAAEG,WAAW,CAAC;MAClE,MAAM,IAAIsD,KAAK,CAACH,KAAK,CAAC;IACxB;EACF;EAGUjD,WAAWA,CAACL,WAAwB,EAAS;IAAA,IAAA0D,sBAAA;IACrD,MAAMJ,KAAK,IAAAI,sBAAA,GAAGnG,cAAc,CAACgG,SAAS,cAAAG,sBAAA,uBAAxBA,sBAAA,CAAAF,IAAA,CAAAjG,cAAc,EAAayC,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACvE,OAAO,IAAIsD,KAAK,CAACH,KAAK,CAAC;EACzB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.js","names":[],"sources":["../../src/wip/data-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/** General data source class */\n// export abstract class DataSource {};\n// export type DataSourceMetadata = {};\n\n// ImageSource\n\n// Tile Source\n\n/** Data source that serves data by tile index *\nexport abstract class TileDataSource extends DataSource {};\n\n// Image Tile Data Source\n\nexport type ImageTileDataSourceCapabilities = {\n}\n\nexport type ImageTile = Record<string, any>;\n\nexport type FeatureInfo = {};\n\nexport abstract class ImageTileDataSource extends TileDataSource {\n source: ImageDataSource;\n \n constructor(source: ImageDataSource) {\n super();\n this.source = source;\n }\n\n getCapabilities(): Promise<ImageTileDataSourceCapabilities> {\n return this.source.getCapabilities();\n }\n\n getTile({x, y, z, width, height, layers, parameters}): Promise<ImageType> {\n const boundingBox = this.getBoundingBoxFromTileIndex(x, y, z);\n return this.source.getImage({boundingBox, width, height, layers, parameters});\n }\n\n getFeatureInfo(): FeatureInfo | null {\n return null;\n }\n\n getBoundingBoxFromTileIndex(x: number, y: number, z: number): [number, number, number, number] {\n return [0, 0, 1, 1];\n }\n}\n\n// Vector Tile Source\n\nexport type VectorTileDataSourceCapabilities = {\n // check tile.json\n}\n\nexport type VectorTile = Record<string, any>;\n\nexport abstract class VectorTileDataSource extends TileDataSource {\n abstract getCapabilities(): Promise<VectorTileDataSourceCapabilities>;\n abstract getTile({x, y, z, width, height, layers, parameters}): Promise<VectorTile>;\n}\n\n*/\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wcs-capabilities.js","names":["XMLLoader","parseWCSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","xmlCapabilities","Capabilities"],"sources":["../../../../src/wip/lib/wcs/parse-wcs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WCS service - response to a WCS `GetCapabilities` data structure extracted from XML */\nexport type WCSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\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 parseWCSCapabilities(text: string, options): WCSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,qBAAA;EAC3E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAAC,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC,CAAC;EAC7G,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wfs-capabilities.js","names":["XMLLoader","parseWFSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../src/wip/lib/wfs/parse-wfs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\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 parseWFSCapabilities(text: string, options): WFSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,qBAAA;EAC3E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAClE,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wfs.js","names":["XMLLoader","parseWFSCapabilities","text","options","_options","_XMLLoader$parseTextS","xml","removeNSPrefix","parsedXML","parseTextSync","call","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../src/wip/lib/wfs/parse-wfs.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\nexport type WFSCapabilities = {};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n // Remove namespaces in XML\n options = {...options, xml: {...options?.xml, removeNSPrefix: true}};\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return uncapitalizeKeys(xmlCapabilities);\n}\n\n/** Uncapitalize all keys of an object */\nfunction uncapitalizeKeys(object: any): any {\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n\n/** Uncapitalize first letter of a string */\nfunction uncapitalize(str: string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|
1
|
-
{"version":3,"file":"parse-wmts-capabilities.js","names":["XMLLoader","parseWMTSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../src/wip/lib/wmts/parse-wmts-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n\n/** All capabilities of a WMTS service - response to a WMTS `GetCapabilities` data structure extracted from XML */\nexport type WMTSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: WMTSLayer[];\n };\n};\n\n/** A layer in WMTS */\nexport type WMTSLayer = {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: WMTSTileMatrixSet[];\n};\n\n/** A zoom level in WMTS */\nexport type WMTSTileMatrixSet = {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n };\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 parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\n// export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n// const parsedXML = XMLLoader.parseTextSync(text, options);\n// const xmlCapabilities: any =\n// parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n// return extractCapabilities(xmlCapabilities);\n// }\n\n/** Extract typed capability data from XML */\n// function extractCapabilities(xml: any): WMTSCapabilities {\n// const capabilities: WMTSCapabilities = {\n// name: xml.Service?.Name || 'unnamed',\n// title: xml.Service?.Title,\n// keywords: [],\n// requests: {},\n// layer: extractLayer(xml.Capability?.Layer),\n// raw: xml\n// };\n\n// for (const keyword of xml.Service?.KeywordList?.Keyword || []) {\n// capabilities.keywords.push(keyword);\n// }\n\n// for (const [name, xmlRequest] of Object.entries(xml.Capability?.Request || {})) {\n// capabilities.requests[name] = extractRequest(name, xmlRequest);\n// }\n\n// return capabilities;\n// }\n\n// /** Extract typed request data from XML */\n// function extractRequest(name: string, xmlRequest: any): WMSRequest {\n// const format: string | string[] = xmlRequest?.Format;\n// const mimeTypes: string[] = Array.isArray(format) ? format : [format];\n// return {name, mimeTypes};\n// }\n\n// /** Extract request data */\n// function extractLayer(xmlLayer: any): WMSLayer {\n// const layer: WMSLayer = {\n// name: xmlLayer?.Name,\n// title: xmlLayer?.Title,\n// srs: xmlLayer?.SRS || [],\n// layers: []\n// };\n\n// // Single layer is not represented as array in XML\n// const xmlLayers = getXMLArray(xmlLayer?.Layer);\n\n// for (const xmlSubLayer of xmlLayers) {\n// layer.layers?.push(extractLayer(xmlSubLayer));\n// }\n\n// return layer;\n// }\n\n// function getXMLArray(xmlValue: any) {\n// if (Array.isArray(xmlValue)) {\n// return xmlValue;\n// }\n// if (xmlValue) {\n// return [xmlValue];\n// }\n// return [];\n// }\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAyFzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAAA,IAAAC,qBAAA;EAC7E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAClE,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
|