@loaders.gl/wms 3.3.0-alpha.9 → 3.4.0-alpha.1

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.
Files changed (266) hide show
  1. package/dist/bundle.d.ts +2 -0
  2. package/dist/bundle.d.ts.map +1 -0
  3. package/dist/bundle.js +6 -0
  4. package/dist/dist.min.js +4080 -2009
  5. package/dist/es5/index.js +63 -7
  6. package/dist/es5/index.js.map +1 -1
  7. package/dist/es5/lerc-loader.js +74 -0
  8. package/dist/es5/lerc-loader.js.map +1 -0
  9. package/dist/es5/lib/data-sources/adhoc-image-service.js +129 -0
  10. package/dist/es5/lib/data-sources/adhoc-image-service.js.map +1 -0
  11. package/dist/es5/lib/data-sources/arcgis-image-service.js +180 -0
  12. package/dist/es5/lib/data-sources/arcgis-image-service.js.map +1 -0
  13. package/dist/es5/lib/data-sources/create-image-source.js +45 -0
  14. package/dist/es5/lib/data-sources/create-image-source.js.map +1 -0
  15. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js +179 -0
  16. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  17. package/dist/es5/lib/data-sources/image-services/image-service.js +163 -0
  18. package/dist/es5/lib/data-sources/image-services/image-service.js.map +1 -0
  19. package/dist/es5/lib/data-sources/image-services/wms-service.js +400 -0
  20. package/dist/es5/lib/data-sources/image-services/wms-service.js.map +1 -0
  21. package/dist/es5/lib/data-sources/image-source.js +14 -0
  22. package/dist/es5/lib/data-sources/image-source.js.map +1 -0
  23. package/dist/es5/lib/gml/deep-strict-equal.js +64 -0
  24. package/dist/es5/lib/gml/deep-strict-equal.js.map +1 -0
  25. package/dist/es5/lib/gml/parse-gml.js +416 -0
  26. package/dist/es5/lib/gml/parse-gml.js.map +1 -0
  27. package/dist/es5/lib/lerc/lerc-types.js +2 -0
  28. package/dist/es5/lib/lerc/lerc-types.js.map +1 -0
  29. package/dist/es5/lib/wcs/parse-wcs.js +43 -0
  30. package/dist/es5/lib/wcs/parse-wcs.js.map +1 -0
  31. package/dist/es5/lib/wcs/wcs-types.js +2 -0
  32. package/dist/es5/lib/wcs/wcs-types.js.map +1 -0
  33. package/dist/es5/lib/wfs/parse-wfs.js +43 -0
  34. package/dist/es5/lib/wfs/parse-wfs.js.map +1 -0
  35. package/dist/es5/lib/wfs/wfs-types.js +2 -0
  36. package/dist/es5/lib/wfs/wfs-types.js.map +1 -0
  37. package/dist/es5/lib/{parse-wms.js → wms/parse-wms.js} +35 -2
  38. package/dist/es5/lib/wms/parse-wms.js.map +1 -0
  39. package/dist/es5/{wms-types.js → lib/wms/wms-types.js} +0 -0
  40. package/dist/es5/lib/wms/wms-types.js.map +1 -0
  41. package/dist/es5/lib/wmts/parse-wmts.js +43 -0
  42. package/dist/es5/lib/wmts/parse-wmts.js.map +1 -0
  43. package/dist/es5/lib/wmts/wmts-types.js +2 -0
  44. package/dist/es5/lib/wmts/wmts-types.js.map +1 -0
  45. package/dist/es5/wip/arcgis-feature-service.js +45 -0
  46. package/dist/es5/wip/arcgis-feature-service.js.map +1 -0
  47. package/dist/es5/wip/data-source.js +4 -0
  48. package/dist/es5/wip/data-source.js.map +1 -0
  49. package/dist/es5/wip/gml-loader.js +54 -0
  50. package/dist/es5/wip/gml-loader.js.map +1 -0
  51. package/dist/es5/wip/wcs-capabilities-loader.js +54 -0
  52. package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -0
  53. package/dist/es5/wip/wfs-capabilities-loader.js +54 -0
  54. package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -0
  55. package/dist/es5/{wms-feature-info-loader.js → wip/wms-feature-info-loader.js} +3 -3
  56. package/dist/es5/wip/wms-feature-info-loader.js.map +1 -0
  57. package/dist/es5/{wms-layer-description-loader.js → wip/wms-layer-description-loader.js} +5 -5
  58. package/dist/es5/wip/wms-layer-description-loader.js.map +1 -0
  59. package/dist/es5/wip/wms-layer-description-loader.md.disabled.md +47 -0
  60. package/dist/es5/wip/wmts-capabilities-loader.js +54 -0
  61. package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -0
  62. package/dist/es5/wms-capabilities-loader.js +3 -3
  63. package/dist/es5/wms-capabilities-loader.js.map +1 -1
  64. package/dist/es5/wms-error-loader.js +70 -0
  65. package/dist/es5/wms-error-loader.js.map +1 -0
  66. package/dist/esm/index.js +16 -3
  67. package/dist/esm/index.js.map +1 -1
  68. package/dist/esm/lerc-loader.js +25 -0
  69. package/dist/esm/lerc-loader.js.map +1 -0
  70. package/dist/esm/lib/data-sources/adhoc-image-service.js +43 -0
  71. package/dist/esm/lib/data-sources/adhoc-image-service.js.map +1 -0
  72. package/dist/esm/lib/data-sources/arcgis-image-service.js +62 -0
  73. package/dist/esm/lib/data-sources/arcgis-image-service.js.map +1 -0
  74. package/dist/esm/lib/data-sources/create-image-source.js +30 -0
  75. package/dist/esm/lib/data-sources/create-image-source.js.map +1 -0
  76. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js +61 -0
  77. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  78. package/dist/esm/lib/data-sources/image-services/image-service.js +72 -0
  79. package/dist/esm/lib/data-sources/image-services/image-service.js.map +1 -0
  80. package/dist/esm/lib/data-sources/image-services/wms-service.js +190 -0
  81. package/dist/esm/lib/data-sources/image-services/wms-service.js.map +1 -0
  82. package/dist/esm/lib/data-sources/image-source.js +4 -0
  83. package/dist/esm/lib/data-sources/image-source.js.map +1 -0
  84. package/dist/esm/lib/gml/deep-strict-equal.js +57 -0
  85. package/dist/esm/lib/gml/deep-strict-equal.js.map +1 -0
  86. package/dist/esm/lib/gml/parse-gml.js +348 -0
  87. package/dist/esm/lib/gml/parse-gml.js.map +1 -0
  88. package/dist/esm/lib/lerc/lerc-types.js +2 -0
  89. package/dist/esm/lib/lerc/lerc-types.js.map +1 -0
  90. package/dist/esm/lib/wcs/parse-wcs.js +32 -0
  91. package/dist/esm/lib/wcs/parse-wcs.js.map +1 -0
  92. package/dist/esm/lib/wcs/wcs-types.js +2 -0
  93. package/dist/esm/lib/wcs/wcs-types.js.map +1 -0
  94. package/dist/esm/lib/wfs/parse-wfs.js +32 -0
  95. package/dist/esm/lib/wfs/parse-wfs.js.map +1 -0
  96. package/dist/esm/lib/wfs/wfs-types.js +2 -0
  97. package/dist/esm/lib/wfs/wfs-types.js.map +1 -0
  98. package/dist/esm/lib/{parse-wms.js → wms/parse-wms.js} +33 -2
  99. package/dist/esm/lib/wms/parse-wms.js.map +1 -0
  100. package/dist/esm/{wms-types.js → lib/wms/wms-types.js} +0 -0
  101. package/dist/esm/lib/wms/wms-types.js.map +1 -0
  102. package/dist/esm/lib/wmts/parse-wmts.js +32 -0
  103. package/dist/esm/lib/wmts/parse-wmts.js.map +1 -0
  104. package/dist/esm/lib/wmts/wmts-types.js +2 -0
  105. package/dist/esm/lib/wmts/wmts-types.js.map +1 -0
  106. package/dist/esm/wip/arcgis-feature-service.js +28 -0
  107. package/dist/esm/wip/arcgis-feature-service.js.map +1 -0
  108. package/dist/esm/wip/data-source.js +2 -0
  109. package/dist/esm/wip/data-source.js.map +1 -0
  110. package/dist/esm/wip/gml-loader.js +25 -0
  111. package/dist/esm/wip/gml-loader.js.map +1 -0
  112. package/dist/esm/wip/wcs-capabilities-loader.js +25 -0
  113. package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -0
  114. package/dist/esm/wip/wfs-capabilities-loader.js +25 -0
  115. package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -0
  116. package/dist/esm/{wms-feature-info-loader.js → wip/wms-feature-info-loader.js} +3 -3
  117. package/dist/esm/wip/wms-feature-info-loader.js.map +1 -0
  118. package/dist/esm/wip/wms-layer-description-loader.js +14 -0
  119. package/dist/esm/wip/wms-layer-description-loader.js.map +1 -0
  120. package/dist/esm/wip/wms-layer-description-loader.md.disabled.md +47 -0
  121. package/dist/esm/wip/wmts-capabilities-loader.js +25 -0
  122. package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -0
  123. package/dist/esm/wms-capabilities-loader.js +3 -3
  124. package/dist/esm/wms-capabilities-loader.js.map +1 -1
  125. package/dist/esm/wms-error-loader.js +40 -0
  126. package/dist/esm/wms-error-loader.js.map +1 -0
  127. package/dist/index.d.ts +27 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +33 -0
  130. package/dist/lerc-loader.d.ts +30 -0
  131. package/dist/lerc-loader.d.ts.map +1 -0
  132. package/dist/lerc-loader.js +56 -0
  133. package/dist/lib/data-sources/adhoc-image-service.d.ts +24 -0
  134. package/dist/lib/data-sources/adhoc-image-service.d.ts.map +1 -0
  135. package/dist/lib/data-sources/adhoc-image-service.js +46 -0
  136. package/dist/lib/data-sources/arcgis-image-service.d.ts +79 -0
  137. package/dist/lib/data-sources/arcgis-image-service.d.ts.map +1 -0
  138. package/dist/lib/data-sources/arcgis-image-service.js +85 -0
  139. package/dist/lib/data-sources/create-image-source.d.ts +16 -0
  140. package/dist/lib/data-sources/create-image-source.d.ts.map +1 -0
  141. package/dist/lib/data-sources/create-image-source.js +39 -0
  142. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts +71 -0
  143. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts.map +1 -0
  144. package/dist/lib/data-sources/image-services/arcgis-image-service.js +85 -0
  145. package/dist/lib/data-sources/image-services/image-service.d.ts +39 -0
  146. package/dist/lib/data-sources/image-services/image-service.d.ts.map +1 -0
  147. package/dist/lib/data-sources/image-services/image-service.js +82 -0
  148. package/dist/lib/data-sources/image-services/wms-service.d.ts +188 -0
  149. package/dist/lib/data-sources/image-services/wms-service.d.ts.map +1 -0
  150. package/dist/lib/data-sources/image-services/wms-service.js +218 -0
  151. package/dist/lib/data-sources/image-source.d.ts +73 -0
  152. package/dist/lib/data-sources/image-source.d.ts.map +1 -0
  153. package/dist/lib/data-sources/image-source.js +12 -0
  154. package/dist/lib/gml/deep-strict-equal.d.ts +3 -0
  155. package/dist/lib/gml/deep-strict-equal.d.ts.map +1 -0
  156. package/dist/lib/gml/deep-strict-equal.js +119 -0
  157. package/dist/lib/gml/parse-gml.d.ts +28 -0
  158. package/dist/lib/gml/parse-gml.d.ts.map +1 -0
  159. package/dist/lib/gml/parse-gml.js +371 -0
  160. package/dist/lib/lerc/lerc-types.d.ts +30 -0
  161. package/dist/lib/lerc/lerc-types.d.ts.map +1 -0
  162. package/dist/lib/lerc/lerc-types.js +3 -0
  163. package/dist/lib/wcs/parse-wcs.d.ts +7 -0
  164. package/dist/lib/wcs/parse-wcs.d.ts.map +1 -0
  165. package/dist/lib/wcs/parse-wcs.js +36 -0
  166. package/dist/lib/wcs/wcs-types.d.ts +73 -0
  167. package/dist/lib/wcs/wcs-types.d.ts.map +1 -0
  168. package/dist/lib/wcs/wcs-types.js +3 -0
  169. package/dist/lib/wfs/parse-wfs.d.ts +7 -0
  170. package/dist/lib/wfs/parse-wfs.d.ts.map +1 -0
  171. package/dist/lib/wfs/parse-wfs.js +36 -0
  172. package/dist/lib/wfs/wfs-types.d.ts +73 -0
  173. package/dist/lib/wfs/wfs-types.d.ts.map +1 -0
  174. package/dist/lib/wfs/wfs-types.js +3 -0
  175. package/dist/lib/wms/parse-wms.d.ts +24 -0
  176. package/dist/lib/wms/parse-wms.d.ts.map +1 -0
  177. package/dist/lib/wms/parse-wms.js +115 -0
  178. package/dist/lib/wms/wms-types.d.ts +100 -0
  179. package/dist/lib/wms/wms-types.d.ts.map +1 -0
  180. package/dist/lib/wms/wms-types.js +1908 -0
  181. package/dist/lib/wmts/parse-wmts.d.ts +7 -0
  182. package/dist/lib/wmts/parse-wmts.d.ts.map +1 -0
  183. package/dist/lib/wmts/parse-wmts.js +36 -0
  184. package/dist/lib/wmts/wmts-types.d.ts +73 -0
  185. package/dist/lib/wmts/wmts-types.d.ts.map +1 -0
  186. package/dist/lib/wmts/wmts-types.js +3 -0
  187. package/dist/wip/arcgis-feature-service.d.ts +56 -0
  188. package/dist/wip/arcgis-feature-service.d.ts.map +1 -0
  189. package/dist/wip/arcgis-feature-service.js +28 -0
  190. package/dist/wip/data-source.d.ts +54 -0
  191. package/dist/wip/data-source.d.ts.map +1 -0
  192. package/dist/wip/data-source.js +59 -0
  193. package/dist/wip/gml-loader.d.ts +26 -0
  194. package/dist/wip/gml-loader.d.ts.map +1 -0
  195. package/dist/wip/gml-loader.js +31 -0
  196. package/dist/wip/wcs-capabilities-loader.d.ts +26 -0
  197. package/dist/wip/wcs-capabilities-loader.d.ts.map +1 -0
  198. package/dist/wip/wcs-capabilities-loader.js +31 -0
  199. package/dist/wip/wfs-capabilities-loader.d.ts +26 -0
  200. package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -0
  201. package/dist/wip/wfs-capabilities-loader.js +31 -0
  202. package/dist/wip/wms-feature-info-loader.d.ts +22 -0
  203. package/dist/wip/wms-feature-info-loader.d.ts.map +1 -0
  204. package/dist/wip/wms-feature-info-loader.js +17 -0
  205. package/dist/wip/wms-layer-description-loader.d.ts +22 -0
  206. package/dist/wip/wms-layer-description-loader.d.ts.map +1 -0
  207. package/dist/wip/wms-layer-description-loader.js +17 -0
  208. package/dist/wip/wmts-capabilities-loader.d.ts +26 -0
  209. package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -0
  210. package/dist/wip/wmts-capabilities-loader.js +31 -0
  211. package/dist/wms-capabilities-loader.d.ts +26 -0
  212. package/dist/wms-capabilities-loader.d.ts.map +1 -0
  213. package/dist/wms-capabilities-loader.js +31 -0
  214. package/dist/wms-error-loader.d.ts +34 -0
  215. package/dist/wms-error-loader.d.ts.map +1 -0
  216. package/dist/wms-error-loader.js +43 -0
  217. package/package.json +17 -6
  218. package/src/index.ts +51 -6
  219. package/src/lerc-loader.ts +50 -0
  220. package/src/lib/data-sources/adhoc-image-service.ts +61 -0
  221. package/src/lib/data-sources/arcgis-image-service.ts +146 -0
  222. package/src/lib/data-sources/create-image-source.ts +46 -0
  223. package/src/lib/data-sources/image-services/arcgis-image-service.ts +136 -0
  224. package/src/lib/data-sources/image-services/image-service.ts +105 -0
  225. package/src/lib/data-sources/image-services/wms-service.ts +351 -0
  226. package/src/lib/data-sources/image-source.ts +82 -0
  227. package/src/lib/gml/deep-strict-equal.ts +119 -0
  228. package/src/lib/gml/parse-gml.ts +500 -0
  229. package/src/lib/lerc/lerc-types.ts +43 -0
  230. package/src/lib/wcs/parse-wcs.ts +39 -0
  231. package/src/lib/wcs/wcs-types.ts +77 -0
  232. package/src/lib/wfs/parse-wfs.ts +39 -0
  233. package/src/lib/wfs/wfs-types.ts +78 -0
  234. package/src/lib/{parse-wms.ts → wms/parse-wms.ts} +54 -4
  235. package/src/{wms-types.ts → lib/wms/wms-types.ts} +3 -1
  236. package/src/lib/wmts/parse-wmts.ts +39 -0
  237. package/src/lib/wmts/wmts-types.ts +77 -0
  238. package/src/wip/arcgis-feature-service.ts +89 -0
  239. package/src/{lib/data-sources/image-data-source.ts → wip/data-source.ts} +20 -42
  240. package/src/wip/gml-loader.ts +40 -0
  241. package/src/wip/wcs-capabilities-loader.ts +40 -0
  242. package/src/wip/wfs-capabilities-loader.ts +40 -0
  243. package/src/{wms-feature-info-loader.ts → wip/wms-feature-info-loader.ts} +3 -3
  244. package/src/wip/wms-layer-description-loader.md.disabled.md +47 -0
  245. package/src/{wms-layer-description-loader.ts → wip/wms-layer-description-loader.ts} +6 -6
  246. package/src/wip/wmts-capabilities-loader.ts +40 -0
  247. package/src/wms-capabilities-loader.ts +2 -2
  248. package/src/wms-error-loader.ts +59 -0
  249. package/dist/es5/lib/data-sources/image-data-source.js +0 -4
  250. package/dist/es5/lib/data-sources/image-data-source.js.map +0 -1
  251. package/dist/es5/lib/data-sources/wms-data-source.js +0 -223
  252. package/dist/es5/lib/data-sources/wms-data-source.js.map +0 -1
  253. package/dist/es5/lib/parse-wms.js.map +0 -1
  254. package/dist/es5/wms-feature-info-loader.js.map +0 -1
  255. package/dist/es5/wms-layer-description-loader.js.map +0 -1
  256. package/dist/es5/wms-types.js.map +0 -1
  257. package/dist/esm/lib/data-sources/image-data-source.js +0 -2
  258. package/dist/esm/lib/data-sources/image-data-source.js.map +0 -1
  259. package/dist/esm/lib/data-sources/wms-data-source.js +0 -70
  260. package/dist/esm/lib/data-sources/wms-data-source.js.map +0 -1
  261. package/dist/esm/lib/parse-wms.js.map +0 -1
  262. package/dist/esm/wms-feature-info-loader.js.map +0 -1
  263. package/dist/esm/wms-layer-description-loader.js +0 -14
  264. package/dist/esm/wms-layer-description-loader.js.map +0 -1
  265. package/dist/esm/wms-types.js.map +0 -1
  266. package/src/lib/data-sources/wms-data-source.ts +0 -99
@@ -0,0 +1,348 @@
1
+
2
+
3
+ import { XMLLoader } from '@loaders.gl/xml';
4
+ import { deepStrictEqual } from './deep-strict-equal';
5
+ import rewind from '@turf/rewind';
6
+ function noTransform() {
7
+ for (var _len = arguments.length, coords = new Array(_len), _key = 0; _key < _len; _key++) {
8
+ coords[_key] = arguments[_key];
9
+ }
10
+ return coords;
11
+ }
12
+ export function parseGML(text, options) {
13
+ const parsedXML = XMLLoader.parseTextSync(text, options);
14
+ options = {
15
+ transformCoords: noTransform,
16
+ stride: 2,
17
+ ...options
18
+ };
19
+ const context = createChildContext(parsedXML, options, {});
20
+ return parseGMLToGeometry(parsedXML, options, context);
21
+ }
22
+
23
+ export function parseGMLToGeometry(inputXML, options, context) {
24
+ const childContext = createChildContext(inputXML, options, context);
25
+ let geometry = null;
26
+ const [name, xml] = getFirstKeyValue(inputXML);
27
+ switch (name) {
28
+
29
+ case 'gml:LineString':
30
+ geometry = {
31
+ type: 'LineString',
32
+ coordinates: parseLinearRingOrLineString(xml, options, childContext)
33
+ };
34
+ break;
35
+
36
+ case 'gml:Polygon':
37
+ case 'gml:Rectangle':
38
+ geometry = {
39
+ type: 'Polygon',
40
+ coordinates: parsePolygonOrRectangle(xml, options, childContext)
41
+ };
42
+ break;
43
+ case 'gml:Surface':
44
+ geometry = {
45
+ type: 'MultiPolygon',
46
+ coordinates: parseSurface(xml, options, childContext)
47
+ };
48
+ break;
49
+ case 'gml:MultiSurface':
50
+ geometry = {
51
+ type: 'MultiPolygon',
52
+ coordinates: parseMultiSurface(xml, options, childContext)
53
+ };
54
+ break;
55
+ default:
56
+ return null;
57
+ }
58
+
59
+ return rewind(geometry, {
60
+ mutate: true
61
+ });
62
+ }
63
+
64
+ function parseCoords(s, options, context) {
65
+ const stride = context.srsDimension || options.stride || 2;
66
+
67
+ const coords = s.replace(/\s+/g, ' ').trim().split(' ');
68
+ if (coords.length === 0 || coords.length % stride !== 0) {
69
+ throw new Error("invalid coordinates list (stride ".concat(stride, ")"));
70
+ }
71
+ const points = [];
72
+ for (let i = 0; i < coords.length - 1; i += stride) {
73
+ var _options$transformCoo;
74
+ const point = coords.slice(i, i + stride).map(parseFloat);
75
+ points.push(((_options$transformCoo = options.transformCoords) === null || _options$transformCoo === void 0 ? void 0 : _options$transformCoo.call(options, ...point)) || point);
76
+ }
77
+ return points;
78
+ }
79
+ export function parsePosList(xml, options, context) {
80
+ const childContext = createChildContext(xml, options, context);
81
+ const coords = textOf(xml);
82
+ if (!coords) {
83
+ throw new Error('invalid gml:posList element');
84
+ }
85
+ return parseCoords(coords, options, childContext);
86
+ }
87
+ export function parsePos(xml, options, context) {
88
+ const childContext = createChildContext(xml, options, context);
89
+ const coords = textOf(xml);
90
+ if (!coords) {
91
+ throw new Error('invalid gml:pos element');
92
+ }
93
+ const points = parseCoords(coords, options, childContext);
94
+ if (points.length !== 1) {
95
+ throw new Error('gml:pos must have 1 point');
96
+ }
97
+ return points[0];
98
+ }
99
+ export function parsePoint(xml, options, context) {
100
+ const childContext = createChildContext(xml, options, context);
101
+
102
+ const pos = findIn(xml, 'gml:pos');
103
+ if (!pos) {
104
+ throw new Error('invalid gml:Point element, expected a gml:pos subelement');
105
+ }
106
+ return parsePos(pos, options, childContext);
107
+ }
108
+ export function parseLinearRingOrLineString(xml, options, context) {
109
+ const childContext = createChildContext(xml, options, context);
110
+ let points = [];
111
+ const posList = findIn(xml, 'gml:posList');
112
+ if (posList) {
113
+ points = parsePosList(posList, options, childContext);
114
+ } else {
115
+ for (const [childName, childXML] of Object.entries(xml)) {
116
+ switch (childName) {
117
+ case 'gml:Point':
118
+ points.push(parsePoint(childXML, options, childContext));
119
+ break;
120
+ case 'gml:pos':
121
+ points.push(parsePos(childXML, options, childContext));
122
+ break;
123
+ default:
124
+ continue;
125
+ }
126
+ }
127
+ }
128
+ if (points.length === 0) {
129
+ throw new Error("".concat(xml.name, " must have > 0 points"));
130
+ }
131
+ return points;
132
+ }
133
+ export function parseCurveSegments(xml, options, context) {
134
+ const points = [];
135
+ for (const [childName, childXML] of Object.entries(xml)) {
136
+ switch (childName) {
137
+ case 'gml:LineStringSegment':
138
+ const points2 = parseLinearRingOrLineString(childXML, options, context);
139
+
140
+ const end = points[points.length - 1];
141
+ const start = points2[0];
142
+ if (end && start && deepStrictEqual(end, start)) {
143
+ points2.shift();
144
+ }
145
+ points.push(...points2);
146
+ break;
147
+ default:
148
+ continue;
149
+ }
150
+ }
151
+ if (points.length === 0) {
152
+ throw new Error('gml:Curve > gml:segments must have > 0 points');
153
+ }
154
+ return points;
155
+ }
156
+ export function parseRing(xml, options, context) {
157
+ const childContext = createChildContext(xml, options, context);
158
+ const points = [];
159
+ for (const [childName, childXML] of Object.entries(xml)) {
160
+ switch (childName) {
161
+ case 'gml:curveMember':
162
+ let points2;
163
+ const lineString = findIn(childXML, 'gml:LineString');
164
+ if (lineString) {
165
+ points2 = parseLinearRingOrLineString(lineString, options, childContext);
166
+ } else {
167
+ const segments = findIn(childXML, 'gml:Curve', 'gml:segments');
168
+ if (!segments) {
169
+ throw new Error("invalid ".concat(childName, " element"));
170
+ }
171
+ points2 = parseCurveSegments(segments, options, childContext);
172
+ }
173
+
174
+ const end = points[points.length - 1];
175
+ const start = points2[0];
176
+ if (end && start && deepStrictEqual(end, start)) {
177
+ points2.shift();
178
+ }
179
+ points.push(...points2);
180
+ break;
181
+ }
182
+ }
183
+ if (points.length < 4) {
184
+ throw new Error("".concat(xml.name, " must have >= 4 points"));
185
+ }
186
+ return points;
187
+ }
188
+ export function parseExteriorOrInterior(xml, options, context) {
189
+ const linearRing = findIn(xml, 'gml:LinearRing');
190
+ if (linearRing) {
191
+ return parseLinearRingOrLineString(linearRing, options, context);
192
+ }
193
+ const ring = findIn(xml, 'gml:Ring');
194
+ if (!ring) {
195
+ throw new Error("invalid ".concat(xml.name, " element"));
196
+ }
197
+ return parseRing(ring, options, context);
198
+ }
199
+ export function parsePolygonOrRectangle(xml, options, context) {
200
+ const childContext = createChildContext(xml, options, context);
201
+ const exterior = findIn(xml, 'gml:exterior');
202
+ if (!exterior) {
203
+ throw new Error("invalid ".concat(xml.name, " element"));
204
+ }
205
+ const pointLists = [parseExteriorOrInterior(exterior, options, childContext)];
206
+ for (const [childName, childXML] of Object.entries(xml)) {
207
+ switch (childName) {
208
+ case 'gml:interior':
209
+ pointLists.push(parseExteriorOrInterior(childXML, options, childContext));
210
+ break;
211
+ }
212
+ }
213
+ return pointLists;
214
+ }
215
+ export function parseSurface(xml, options, context) {
216
+ const childContext = createChildContext(xml, options, context);
217
+ const patches = findIn(xml, 'gml:patches');
218
+ if (!patches) {
219
+ throw new Error("invalid ".concat(xml.name, " element"));
220
+ }
221
+ const polygons = [];
222
+ for (const [childName, childXML] of Object.entries(xml)) {
223
+ switch (childName) {
224
+ case 'gml:PolygonPatch':
225
+ case 'gml:Rectangle':
226
+ polygons.push(parsePolygonOrRectangle(childXML, options, childContext));
227
+ break;
228
+ default:
229
+ continue;
230
+ }
231
+ }
232
+ if (polygons.length === 0) {
233
+ throw new Error("".concat(xml.name, " must have > 0 polygons"));
234
+ }
235
+ return polygons;
236
+ }
237
+ export function parseCompositeSurface(xml, options, context) {
238
+ const childContext = createChildContext(xml, options, context);
239
+ const polygons = [];
240
+ for (const [childName, childXML] of Object.entries(xml)) {
241
+ switch (childName) {
242
+ case 'gml:surfaceMember':
243
+ case 'gml:surfaceMembers':
244
+ const [c2Name, c2Xml] = getFirstKeyValue(childXML);
245
+ switch (c2Name) {
246
+ case 'gml:Surface':
247
+ polygons.push(...parseSurface(c2Xml, options, childContext));
248
+ break;
249
+ case 'gml:Polygon':
250
+ polygons.push(parsePolygonOrRectangle(c2Xml, options, childContext));
251
+ break;
252
+ }
253
+ break;
254
+ }
255
+ }
256
+ if (polygons.length === 0) {
257
+ throw new Error("".concat(xml.name, " must have > 0 polygons"));
258
+ }
259
+ return polygons;
260
+ }
261
+ export function parseMultiSurface(xml, options, context) {
262
+ let el = xml;
263
+ const surfaceMembers = findIn(xml, 'gml:LinearRing');
264
+ if (surfaceMembers) {
265
+ el = surfaceMembers;
266
+ }
267
+ const polygons = [];
268
+ for (const [childName, childXML] of Object.entries(el)) {
269
+ switch (childName) {
270
+ case 'gml:Surface':
271
+ const polygons2 = parseSurface(childXML, options, context);
272
+ polygons.push(...polygons2);
273
+ break;
274
+ case 'gml:surfaceMember':
275
+ const polygons3 = parseSurfaceMember(childXML, options, context);
276
+ polygons.push(...polygons3);
277
+ break;
278
+ case 'gml:surfaceMembers':
279
+ const polygonXML = findIn(childXML, 'gml:Polygon');
280
+ for (const surfaceMemberXML of polygonXML) {
281
+ const polygons3 = parseSurfaceMember(surfaceMemberXML, options, context);
282
+ polygons.push(...polygons3);
283
+ }
284
+ break;
285
+ }
286
+ }
287
+ if (polygons.length === 0) {
288
+ throw new Error("".concat(xml.name, " must have > 0 polygons"));
289
+ }
290
+ return polygons;
291
+ }
292
+ function parseSurfaceMember(xml, options, context) {
293
+ const [childName, childXml] = getFirstKeyValue(xml);
294
+ switch (childName) {
295
+ case 'gml:CompositeSurface':
296
+ return parseCompositeSurface(childXml, options, context);
297
+ case 'gml:Surface':
298
+ return parseSurface(childXml, options, context);
299
+ case 'gml:Polygon':
300
+ return [parsePolygonOrRectangle(childXml, options, context)];
301
+ }
302
+ throw new Error("".concat(childName, " must have polygons"));
303
+ }
304
+
305
+ function textOf(el) {
306
+ if (typeof el !== 'string') {
307
+ throw new Error('expected string');
308
+ }
309
+ return el;
310
+ }
311
+ function findIn(root) {
312
+ let el = root;
313
+ for (var _len2 = arguments.length, tags = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
314
+ tags[_key2 - 1] = arguments[_key2];
315
+ }
316
+ for (const tag of tags) {
317
+ const child = el[tag];
318
+ if (!child) {
319
+ return null;
320
+ }
321
+ el = child;
322
+ }
323
+ return el;
324
+ }
325
+
326
+ function getFirstKeyValue(object) {
327
+ if (object && typeof object === 'object') {
328
+ for (const [key, value] of Object.entries(object)) {
329
+ return [key, value];
330
+ }
331
+ }
332
+ return ['', null];
333
+ }
334
+
335
+ function createChildContext(xml, options, context) {
336
+ const srsDimensionAttribute = xml.attributes && xml.attributes.srsDimension;
337
+ if (srsDimensionAttribute) {
338
+ const srsDimension = parseInt(srsDimensionAttribute);
339
+ if (Number.isNaN(srsDimension) || srsDimension <= 0) {
340
+ throw new Error("invalid srsDimension attribute value \"".concat(srsDimensionAttribute, "\", expected a positive integer"));
341
+ }
342
+ const childContext = Object.create(context);
343
+ childContext.srsDimension = srsDimension;
344
+ return childContext;
345
+ }
346
+ return context;
347
+ }
348
+ //# sourceMappingURL=parse-gml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-gml.js","names":["XMLLoader","deepStrictEqual","rewind","noTransform","coords","parseGML","text","options","parsedXML","parseTextSync","transformCoords","stride","context","createChildContext","parseGMLToGeometry","inputXML","childContext","geometry","name","xml","getFirstKeyValue","type","coordinates","parseLinearRingOrLineString","parsePolygonOrRectangle","parseSurface","parseMultiSurface","mutate","parseCoords","s","srsDimension","replace","trim","split","length","Error","points","i","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","tags","tag","child","object","key","value","srsDimensionAttribute","attributes","parseInt","Number","isNaN","create"],"sources":["../../../../src/lib/gml/parse-gml.ts"],"sourcesContent":["// loaders.gl, MIT license\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 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":";;AAuBA,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SAAQC,eAAe,QAAO,qBAAqB;AACnD,OAAOC,MAAM,MAAM,cAAc;AAEjC,SAASC,WAAW,GAAY;EAAA,kCAARC,MAAM;IAANA,MAAM;EAAA;EAC5B,OAAOA,MAAM;AACf;AAgBA,OAAO,SAASC,QAAQ,CAACC,IAAY,EAAEC,OAAO,EAAE;EAE9C,MAAMC,SAAS,GAAGR,SAAS,CAACS,aAAa,CAACH,IAAI,EAAEC,OAAO,CAAC;EAExDA,OAAO,GAAG;IAACG,eAAe,EAAEP,WAAW;IAAEQ,MAAM,EAAE,CAAC;IAAE,GAAGJ;EAAO,CAAC;EAC/D,MAAMK,OAAO,GAAGC,kBAAkB,CAACL,SAAS,EAAED,OAAO,EAAE,CAAC,CAAC,CAAC;EAE1D,OAAOO,kBAAkB,CAACN,SAAS,EAAED,OAAO,EAAEK,OAAO,CAAC;AACxD;;AAGA,OAAO,SAASE,kBAAkB,CAChCC,QAAa,EACbR,OAAwB,EACxBK,OAAwB,EACP;EACjB,MAAMI,YAAY,GAAGH,kBAAkB,C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,KAAK,QAAQ,EAAE;IACxC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIlC,MAAM,CAACC,OAAO,CAAC+B,MAAM,CAAC,EAAE;MACjD,OAAO,CAACC,GAAG,EAAEC,KAAK,CAAC;IACrB;EACF;EACA,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC;AACnB;;AAGA,SAASzE,kBAAkB,CAACM,GAAG,EAAEZ,OAAO,EAAEK,OAAO,EAAmB;EAClE,MAAM2E,qBAAqB,GAAGpE,GAAG,CAACqE,UAAU,IAAIrE,GAAG,CAACqE,UAAU,CAAC1D,YAAY;EAE3E,IAAIyD,qBAAqB,EAAE;IACzB,MAAMzD,YAAY,GAAG2D,QAAQ,CAACF,qBAAqB,CAAC;IACpD,IAAIG,MAAM,CAACC,KAAK,CAAC7D,YAAY,CAAC,IAAIA,YAAY,IAAI,CAAC,EAAE;MACnD,MAAM,IAAIK,KAAK,kDAC4BoD,qBAAqB,qCAC/D;IACH;IAEA,MAAMvE,YAAY,GAAGoC,MAAM,CAACwC,MAAM,CAAChF,OAAO,CAAC;IAC3CI,YAAY,CAACc,YAAY,GAAGA,YAAY;IACxC,OAAOd,YAAY;EACrB;EAEA,OAAOJ,OAAO;AAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lerc-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lerc-types.js","names":[],"sources":["../../../../src/lib/lerc/lerc-types.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/** Data returned by LERC loader */\nexport type LERCData = {\n /**\tWidth of decoded image */\n width: number;\n /**\tHeight of decoded image */\n height: number;\n /**\tThe type of pixels represented in the output */\n pixelType: LercPixelType;\n /**\t[statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values */\n statistics: BandStats[];\n /**\t[band1, band2, …] Each band is a typed array of width * height * depthCount */\n pixels: TypedArray[];\n /**\tTyped array with a size of width*height, or null if all pixels are valid */\n mask: Uint8Array;\n /**\tDepth count */\n depthCount: number;\n /**\tarray\t[band1_mask, band2_mask, …] Each band is a Uint8Array of width * height * depthCount */\n bandMasks?: Uint8Array[];\n};\n\nexport type LercPixelType = 'S8' | 'U8' | 'S16' | 'U16' | 'S32' | 'U32' | 'F32' | 'F64';\n\nexport interface BandStats {\n minValue: number;\n maxValue: number;\n depthStats?: {\n minValues: Float64Array;\n maxValues: Float64Array;\n };\n}\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n"],"mappings":""}
@@ -0,0 +1,32 @@
1
+
2
+
3
+ import { XMLLoader } from '@loaders.gl/xml';
4
+
5
+ export function parseWFSCapabilities(text, options) {
6
+ var _options;
7
+ options = {
8
+ ...options,
9
+ xml: {
10
+ ...((_options = options) === null || _options === void 0 ? void 0 : _options.xml),
11
+ removeNSPrefix: true
12
+ }
13
+ };
14
+ const parsedXML = XMLLoader.parseTextSync(text, options);
15
+ const xmlCapabilities = parsedXML.Capabilities || parsedXML;
16
+ return uncapitalizeKeys(xmlCapabilities);
17
+ }
18
+ function uncapitalizeKeys(object) {
19
+ if (object && typeof object === 'object') {
20
+ const newObject = {};
21
+ for (const [key, value] of Object.entries(object)) {
22
+ newObject[uncapitalize(key)] = uncapitalizeKeys(value);
23
+ }
24
+ return newObject;
25
+ }
26
+ return object;
27
+ }
28
+
29
+ function uncapitalize(str) {
30
+ return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
31
+ }
32
+ //# sourceMappingURL=parse-wcs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wcs.js","names":["XMLLoader","parseWFSCapabilities","text","options","xml","removeNSPrefix","parsedXML","parseTextSync","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../src/lib/wcs/parse-wcs.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {WFSCapabilities} from './wcs-types';\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n// GetCapabilities\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\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/**\n * Uncapitalize first letter of a string\n * @param {string} str\n * @returns {string}\n */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":";;AAIA,SAAQA,SAAS,QAAO,iBAAiB;;AAQzC,OAAO,SAASC,oBAAoB,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA;EAE3EA,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEC,GAAG,EAAE;MAAC,gBAAGD,OAAO,6CAAP,SAASC,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,GAAGN,SAAS,CAACO,aAAa,CAACL,IAAI,EAAEC,OAAO,CAAC;EACxD,MAAMK,eAAoB,GAAGF,SAAS,CAACG,YAAY,IAAIH,SAAS;EAChE,OAAOI,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAEA,SAASE,gBAAgB,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;;AAOA,SAASM,YAAY,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wcs-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wcs-types.js","names":[],"sources":["../../../../src/lib/wcs/wcs-types.ts"],"sourcesContent":["// loaders.gl, MIT licenses\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"],"mappings":""}
@@ -0,0 +1,32 @@
1
+
2
+
3
+ import { XMLLoader } from '@loaders.gl/xml';
4
+
5
+ export function parseWFSCapabilities(text, options) {
6
+ var _options;
7
+ options = {
8
+ ...options,
9
+ xml: {
10
+ ...((_options = options) === null || _options === void 0 ? void 0 : _options.xml),
11
+ removeNSPrefix: true
12
+ }
13
+ };
14
+ const parsedXML = XMLLoader.parseTextSync(text, options);
15
+ const xmlCapabilities = parsedXML.Capabilities || parsedXML;
16
+ return uncapitalizeKeys(xmlCapabilities);
17
+ }
18
+ function uncapitalizeKeys(object) {
19
+ if (object && typeof object === 'object') {
20
+ const newObject = {};
21
+ for (const [key, value] of Object.entries(object)) {
22
+ newObject[uncapitalize(key)] = uncapitalizeKeys(value);
23
+ }
24
+ return newObject;
25
+ }
26
+ return object;
27
+ }
28
+
29
+ function uncapitalize(str) {
30
+ return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
31
+ }
32
+ //# sourceMappingURL=parse-wfs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wfs.js","names":["XMLLoader","parseWFSCapabilities","text","options","xml","removeNSPrefix","parsedXML","parseTextSync","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../src/lib/wfs/parse-wfs.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {WFSCapabilities} from './wfs-types';\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n// GetCapabilities\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\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/**\n * Uncapitalize first letter of a string\n * @param {string} str\n * @returns {string}\n */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":";;AAIA,SAAQA,SAAS,QAAO,iBAAiB;;AAQzC,OAAO,SAASC,oBAAoB,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA;EAE3EA,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEC,GAAG,EAAE;MAAC,gBAAGD,OAAO,6CAAP,SAASC,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,GAAGN,SAAS,CAACO,aAAa,CAACL,IAAI,EAAEC,OAAO,CAAC;EACxD,MAAMK,eAAoB,GAAGF,SAAS,CAACG,YAAY,IAAIH,SAAS;EAChE,OAAOI,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAEA,SAASE,gBAAgB,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;;AAOA,SAASM,YAAY,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wfs-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wfs-types.js","names":[],"sources":["../../../../src/lib/wfs/wfs-types.ts"],"sourcesContent":["// loaders.gl, MIT licenses\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 "],"mappings":""}
@@ -45,12 +45,23 @@ function extractLayer(xmlLayer) {
45
45
  srs: (xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.SRS) || [],
46
46
  layers: []
47
47
  };
48
- for (const xmlSubLayer of (xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.Layer) || []) {
48
+
49
+ const xmlLayers = getXMLArray(xmlLayer === null || xmlLayer === void 0 ? void 0 : xmlLayer.Layer);
50
+ for (const xmlSubLayer of xmlLayers) {
49
51
  var _layer$layers;
50
52
  (_layer$layers = layer.layers) === null || _layer$layers === void 0 ? void 0 : _layer$layers.push(extractLayer(xmlSubLayer));
51
53
  }
52
54
  return layer;
53
55
  }
56
+ function getXMLArray(xmlValue) {
57
+ if (Array.isArray(xmlValue)) {
58
+ return xmlValue;
59
+ }
60
+ if (xmlValue) {
61
+ return [xmlValue];
62
+ }
63
+ return [];
64
+ }
54
65
 
55
66
  export function parseWMSFeatureInfo(text, options) {
56
67
  var _parsedXML$FeatureInf;
@@ -64,7 +75,27 @@ export function parseWMSFeatureInfo(text, options) {
64
75
  function extractFeature(xmlFeature) {
65
76
  const xmlFields = xmlFeature || {};
66
77
  return {
67
- attributes: xmlFields
78
+ attributes: xmlFields,
79
+ type: '',
80
+ bounds: {
81
+ bottom: 0,
82
+ top: 0,
83
+ left: 0,
84
+ right: 0
85
+ }
68
86
  };
69
87
  }
88
+
89
+ export function parseWMSLayerDescription(text, options) {
90
+ const parsedXML = XMLLoader.parseTextSync(text, options);
91
+ return parsedXML;
92
+ }
93
+
94
+ export function parseWMSError(text, options) {
95
+ var _XMLLoader$parseTextS, _parsedXML$ServiceExc, _parsedXML$ogcServic;
96
+ const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, options);
97
+ const serviceExceptionXML = (parsedXML === null || parsedXML === void 0 ? void 0 : (_parsedXML$ServiceExc = parsedXML.ServiceExceptionReport) === null || _parsedXML$ServiceExc === void 0 ? void 0 : _parsedXML$ServiceExc.ServiceException) || (parsedXML === null || parsedXML === void 0 ? void 0 : (_parsedXML$ogcServic = parsedXML['ogc:ServiceExceptionReport']) === null || _parsedXML$ogcServic === void 0 ? void 0 : _parsedXML$ogcServic['ogc:ServiceException']);
98
+ const message = typeof serviceExceptionXML === 'string' ? serviceExceptionXML : serviceExceptionXML['#text'] || serviceExceptionXML.code || 'Unknown error';
99
+ return message;
100
+ }
70
101
  //# sourceMappingURL=parse-wms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wms.js","names":["XMLLoader","parseWMSCapabilities","text","options","parsedXML","parseTextSync","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","extractCapabilities","xml","capabilities","name","Service","Name","title","Title","keywords","requests","layer","extractLayer","Capability","Layer","raw","keyword","KeywordList","Keyword","push","xmlRequest","Object","entries","Request","extractRequest","format","Format","mimeTypes","Array","isArray","xmlLayer","srs","SRS","layers","xmlLayers","getXMLArray","xmlSubLayer","xmlValue","parseWMSFeatureInfo","xmlFeatureInfo","FeatureInfoResponse","FIELDS","xmlFeatures","features","map","xmlFeature","extractFeature","xmlFields","attributes","type","bounds","bottom","top","left","right","parseWMSLayerDescription","parseWMSError","serviceExceptionXML","ServiceExceptionReport","ServiceException","message","code"],"sources":["../../../../src/lib/wms/parse-wms.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {\n WMSCapabilities,\n WMSLayer,\n WMSRequest,\n WMSFeatureInfo,\n WMSLayerDescription\n // WMSFeature,\n // WMSLayerDescription\n} from './wms-types';\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n// GetCapabilities\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(text: string, options): WMSCapabilities {\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 */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\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 */\nfunction 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 */\nfunction 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\nfunction getXMLArray(xmlValue: any) {\n if (Array.isArray(xmlValue)) {\n return xmlValue;\n }\n if (xmlValue) {\n return [xmlValue];\n }\n return [];\n}\n\n// GetFeatureInfo\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\n// GetFeatureInfo\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(text: string, options): WMSLayerDescription {\n const parsedXML = XMLLoader.parseTextSync(text, options);\n // TODO - implement parser\n return parsedXML as unknown as WMSLayerDescription;\n}\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['#text'] || serviceExceptionXML.code || 'Unknown error';\n return message;\n}\n"],"mappings":";;AAYA,SAAQA,SAAS,QAAO,iBAAiB;;AAQzC,OAAO,SAASC,oBAAoB,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAEC,OAAO,CAAC;EACxD,MAAMG,eAAoB,GACxBF,SAAS,CAACG,mBAAmB,IAAIH,SAAS,CAACI,gBAAgB,IAAIJ,SAAS;EAC1E,OAAOK,mBAAmB,CAACH,eAAe,CAAC;AAC7C;;AAGA,SAASG,mBAAmB,CAACC,GAAQ,EAAmB;EAAA;EACtD,MAAMC,YAA6B,GAAG;IACpCC,IAAI,EAAE,iBAAAF,GAAG,CAACG,OAAO,iDAAX,aAAaC,IAAI,KAAI,SAAS;IACpCC,KAAK,mBAAEL,GAAG,CAACG,OAAO,kDAAX,cAAaG,KAAK;IACzBC,QAAQ,EAAE,EAAE;IACZC,QAAQ,EAAE,CAAC,CAAC;IACZC,KAAK,EAAEC,YAAY,oBAACV,GAAG,CAACW,UAAU,oDAAd,gBAAgBC,KAAK,CAAC;IAC1CC,GAAG,EAAEb;EACP,CAAC;EAED,KAAK,MAAMc,OAAO,IAAI,kBAAAd,GAAG,CAACG,OAAO,2EAAX,cAAaY,WAAW,0DAAxB,sBAA0BC,OAAO,KAAI,EAAE,EAAE;IAAA;IAC7Df,YAAY,C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