@loaders.gl/wms 3.3.0-alpha.8 → 3.3.0

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 (257) 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 +4141 -1479
  5. package/dist/es5/bundle.js.map +1 -1
  6. package/dist/es5/index.js +77 -0
  7. package/dist/es5/index.js.map +1 -1
  8. package/dist/es5/lerc-loader.js +74 -0
  9. package/dist/es5/lerc-loader.js.map +1 -0
  10. package/dist/es5/lib/data-sources/adhoc-image-service.js +129 -0
  11. package/dist/es5/lib/data-sources/adhoc-image-service.js.map +1 -0
  12. package/dist/es5/lib/data-sources/arcgis-image-service.js +180 -0
  13. package/dist/es5/lib/data-sources/arcgis-image-service.js.map +1 -0
  14. package/dist/es5/lib/data-sources/create-image-source.js +45 -0
  15. package/dist/es5/lib/data-sources/create-image-source.js.map +1 -0
  16. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js +179 -0
  17. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  18. package/dist/es5/lib/data-sources/image-services/image-service.js +163 -0
  19. package/dist/es5/lib/data-sources/image-services/image-service.js.map +1 -0
  20. package/dist/es5/lib/data-sources/image-services/wms-service.js +400 -0
  21. package/dist/es5/lib/data-sources/image-services/wms-service.js.map +1 -0
  22. package/dist/es5/lib/data-sources/image-source.js +14 -0
  23. package/dist/es5/lib/data-sources/image-source.js.map +1 -0
  24. package/dist/es5/lib/gml/deep-strict-equal.js +64 -0
  25. package/dist/es5/lib/gml/deep-strict-equal.js.map +1 -0
  26. package/dist/es5/lib/gml/parse-gml.js +416 -0
  27. package/dist/es5/lib/gml/parse-gml.js.map +1 -0
  28. package/dist/es5/lib/lerc/lerc-types.js +2 -0
  29. package/dist/es5/lib/lerc/lerc-types.js.map +1 -0
  30. package/dist/es5/lib/wcs/parse-wcs.js +43 -0
  31. package/dist/es5/lib/wcs/parse-wcs.js.map +1 -0
  32. package/dist/es5/lib/wcs/wcs-types.js +2 -0
  33. package/dist/es5/lib/wcs/wcs-types.js.map +1 -0
  34. package/dist/es5/lib/wfs/parse-wfs.js +43 -0
  35. package/dist/es5/lib/wfs/parse-wfs.js.map +1 -0
  36. package/dist/es5/lib/wfs/wfs-types.js +2 -0
  37. package/dist/es5/lib/wfs/wfs-types.js.map +1 -0
  38. package/dist/es5/lib/wms/parse-wms.js +135 -0
  39. package/dist/es5/lib/wms/parse-wms.js.map +1 -0
  40. package/dist/es5/{wms-types.js → lib/wms/wms-types.js} +0 -0
  41. package/dist/{esm → es5/lib/wms}/wms-types.js.map +1 -1
  42. package/dist/es5/lib/wmts/parse-wmts.js +43 -0
  43. package/dist/es5/lib/wmts/parse-wmts.js.map +1 -0
  44. package/dist/es5/lib/wmts/wmts-types.js +2 -0
  45. package/dist/es5/lib/wmts/wmts-types.js.map +1 -0
  46. package/dist/es5/wip/arcgis-feature-service.js +45 -0
  47. package/dist/es5/wip/arcgis-feature-service.js.map +1 -0
  48. package/dist/es5/wip/data-source.js +4 -0
  49. package/dist/es5/wip/data-source.js.map +1 -0
  50. package/dist/es5/wip/gml-loader.js +54 -0
  51. package/dist/es5/wip/gml-loader.js.map +1 -0
  52. package/dist/es5/wip/wcs-capabilities-loader.js +54 -0
  53. package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -0
  54. package/dist/es5/wip/wfs-capabilities-loader.js +54 -0
  55. package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -0
  56. package/dist/es5/wip/wms-feature-info-loader.js +44 -0
  57. package/dist/es5/wip/wms-feature-info-loader.js.map +1 -0
  58. package/dist/es5/wip/wms-layer-description-loader.js +44 -0
  59. package/dist/es5/wip/wms-layer-description-loader.js.map +1 -0
  60. package/dist/es5/wip/wms-layer-description-loader.md.disabled.md +47 -0
  61. package/dist/es5/wip/wmts-capabilities-loader.js +54 -0
  62. package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -0
  63. package/dist/es5/wms-capabilities-loader.js +7 -6
  64. package/dist/es5/wms-capabilities-loader.js.map +1 -1
  65. package/dist/es5/wms-error-loader.js +70 -0
  66. package/dist/es5/wms-error-loader.js.map +1 -0
  67. package/dist/esm/bundle.js +1 -0
  68. package/dist/esm/bundle.js.map +1 -1
  69. package/dist/esm/index.js +16 -0
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/lerc-loader.js +25 -0
  72. package/dist/esm/lerc-loader.js.map +1 -0
  73. package/dist/esm/lib/data-sources/adhoc-image-service.js +43 -0
  74. package/dist/esm/lib/data-sources/adhoc-image-service.js.map +1 -0
  75. package/dist/esm/lib/data-sources/arcgis-image-service.js +62 -0
  76. package/dist/esm/lib/data-sources/arcgis-image-service.js.map +1 -0
  77. package/dist/esm/lib/data-sources/create-image-source.js +30 -0
  78. package/dist/esm/lib/data-sources/create-image-source.js.map +1 -0
  79. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js +61 -0
  80. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  81. package/dist/esm/lib/data-sources/image-services/image-service.js +72 -0
  82. package/dist/esm/lib/data-sources/image-services/image-service.js.map +1 -0
  83. package/dist/esm/lib/data-sources/image-services/wms-service.js +190 -0
  84. package/dist/esm/lib/data-sources/image-services/wms-service.js.map +1 -0
  85. package/dist/esm/lib/data-sources/image-source.js +4 -0
  86. package/dist/esm/lib/data-sources/image-source.js.map +1 -0
  87. package/dist/esm/lib/gml/deep-strict-equal.js +57 -0
  88. package/dist/esm/lib/gml/deep-strict-equal.js.map +1 -0
  89. package/dist/esm/lib/gml/parse-gml.js +348 -0
  90. package/dist/esm/lib/gml/parse-gml.js.map +1 -0
  91. package/dist/esm/lib/lerc/lerc-types.js +2 -0
  92. package/dist/esm/lib/lerc/lerc-types.js.map +1 -0
  93. package/dist/esm/lib/wcs/parse-wcs.js +32 -0
  94. package/dist/esm/lib/wcs/parse-wcs.js.map +1 -0
  95. package/dist/esm/lib/wcs/wcs-types.js +2 -0
  96. package/dist/esm/lib/wcs/wcs-types.js.map +1 -0
  97. package/dist/esm/lib/wfs/parse-wfs.js +32 -0
  98. package/dist/esm/lib/wfs/parse-wfs.js.map +1 -0
  99. package/dist/esm/lib/wfs/wfs-types.js +2 -0
  100. package/dist/esm/lib/wfs/wfs-types.js.map +1 -0
  101. package/dist/esm/lib/wms/parse-wms.js +101 -0
  102. package/dist/esm/lib/wms/parse-wms.js.map +1 -0
  103. package/dist/esm/{wms-types.js → lib/wms/wms-types.js} +0 -0
  104. package/dist/{es5 → esm/lib/wms}/wms-types.js.map +1 -1
  105. package/dist/esm/lib/wmts/parse-wmts.js +32 -0
  106. package/dist/esm/lib/wmts/parse-wmts.js.map +1 -0
  107. package/dist/esm/lib/wmts/wmts-types.js +2 -0
  108. package/dist/esm/lib/wmts/wmts-types.js.map +1 -0
  109. package/dist/esm/wip/arcgis-feature-service.js +28 -0
  110. package/dist/esm/wip/arcgis-feature-service.js.map +1 -0
  111. package/dist/esm/wip/data-source.js +2 -0
  112. package/dist/esm/wip/data-source.js.map +1 -0
  113. package/dist/esm/wip/gml-loader.js +25 -0
  114. package/dist/esm/wip/gml-loader.js.map +1 -0
  115. package/dist/esm/wip/wcs-capabilities-loader.js +25 -0
  116. package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -0
  117. package/dist/esm/wip/wfs-capabilities-loader.js +25 -0
  118. package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -0
  119. package/dist/esm/wip/wms-feature-info-loader.js +14 -0
  120. package/dist/esm/wip/wms-feature-info-loader.js.map +1 -0
  121. package/dist/esm/wip/wms-layer-description-loader.js +14 -0
  122. package/dist/esm/wip/wms-layer-description-loader.js.map +1 -0
  123. package/dist/esm/wip/wms-layer-description-loader.md.disabled.md +47 -0
  124. package/dist/esm/wip/wmts-capabilities-loader.js +25 -0
  125. package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -0
  126. package/dist/esm/wms-capabilities-loader.js +6 -4
  127. package/dist/esm/wms-capabilities-loader.js.map +1 -1
  128. package/dist/esm/wms-error-loader.js +40 -0
  129. package/dist/esm/wms-error-loader.js.map +1 -0
  130. package/dist/index.d.ts +27 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +33 -0
  133. package/dist/lerc-loader.d.ts +30 -0
  134. package/dist/lerc-loader.d.ts.map +1 -0
  135. package/dist/lerc-loader.js +56 -0
  136. package/dist/lib/data-sources/adhoc-image-service.d.ts +24 -0
  137. package/dist/lib/data-sources/adhoc-image-service.d.ts.map +1 -0
  138. package/dist/lib/data-sources/adhoc-image-service.js +46 -0
  139. package/dist/lib/data-sources/arcgis-image-service.d.ts +79 -0
  140. package/dist/lib/data-sources/arcgis-image-service.d.ts.map +1 -0
  141. package/dist/lib/data-sources/arcgis-image-service.js +85 -0
  142. package/dist/lib/data-sources/create-image-source.d.ts +16 -0
  143. package/dist/lib/data-sources/create-image-source.d.ts.map +1 -0
  144. package/dist/lib/data-sources/create-image-source.js +39 -0
  145. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts +71 -0
  146. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts.map +1 -0
  147. package/dist/lib/data-sources/image-services/arcgis-image-service.js +85 -0
  148. package/dist/lib/data-sources/image-services/image-service.d.ts +39 -0
  149. package/dist/lib/data-sources/image-services/image-service.d.ts.map +1 -0
  150. package/dist/lib/data-sources/image-services/image-service.js +82 -0
  151. package/dist/lib/data-sources/image-services/wms-service.d.ts +188 -0
  152. package/dist/lib/data-sources/image-services/wms-service.d.ts.map +1 -0
  153. package/dist/lib/data-sources/image-services/wms-service.js +218 -0
  154. package/dist/lib/data-sources/image-source.d.ts +73 -0
  155. package/dist/lib/data-sources/image-source.d.ts.map +1 -0
  156. package/dist/lib/data-sources/image-source.js +12 -0
  157. package/dist/lib/gml/deep-strict-equal.d.ts +3 -0
  158. package/dist/lib/gml/deep-strict-equal.d.ts.map +1 -0
  159. package/dist/lib/gml/deep-strict-equal.js +119 -0
  160. package/dist/lib/gml/parse-gml.d.ts +28 -0
  161. package/dist/lib/gml/parse-gml.d.ts.map +1 -0
  162. package/dist/lib/gml/parse-gml.js +371 -0
  163. package/dist/lib/lerc/lerc-types.d.ts +30 -0
  164. package/dist/lib/lerc/lerc-types.d.ts.map +1 -0
  165. package/dist/lib/lerc/lerc-types.js +3 -0
  166. package/dist/lib/wcs/parse-wcs.d.ts +7 -0
  167. package/dist/lib/wcs/parse-wcs.d.ts.map +1 -0
  168. package/dist/lib/wcs/parse-wcs.js +36 -0
  169. package/dist/lib/wcs/wcs-types.d.ts +73 -0
  170. package/dist/lib/wcs/wcs-types.d.ts.map +1 -0
  171. package/dist/lib/wcs/wcs-types.js +3 -0
  172. package/dist/lib/wfs/parse-wfs.d.ts +7 -0
  173. package/dist/lib/wfs/parse-wfs.d.ts.map +1 -0
  174. package/dist/lib/wfs/parse-wfs.js +36 -0
  175. package/dist/lib/wfs/wfs-types.d.ts +73 -0
  176. package/dist/lib/wfs/wfs-types.d.ts.map +1 -0
  177. package/dist/lib/wfs/wfs-types.js +3 -0
  178. package/dist/lib/wms/parse-wms.d.ts +24 -0
  179. package/dist/lib/wms/parse-wms.d.ts.map +1 -0
  180. package/dist/lib/wms/parse-wms.js +115 -0
  181. package/dist/lib/wms/wms-types.d.ts +100 -0
  182. package/dist/lib/wms/wms-types.d.ts.map +1 -0
  183. package/dist/lib/wms/wms-types.js +1908 -0
  184. package/dist/lib/wmts/parse-wmts.d.ts +7 -0
  185. package/dist/lib/wmts/parse-wmts.d.ts.map +1 -0
  186. package/dist/lib/wmts/parse-wmts.js +36 -0
  187. package/dist/lib/wmts/wmts-types.d.ts +73 -0
  188. package/dist/lib/wmts/wmts-types.d.ts.map +1 -0
  189. package/dist/lib/wmts/wmts-types.js +3 -0
  190. package/dist/wip/arcgis-feature-service.d.ts +56 -0
  191. package/dist/wip/arcgis-feature-service.d.ts.map +1 -0
  192. package/dist/wip/arcgis-feature-service.js +28 -0
  193. package/dist/wip/data-source.d.ts +54 -0
  194. package/dist/wip/data-source.d.ts.map +1 -0
  195. package/dist/wip/data-source.js +59 -0
  196. package/dist/wip/gml-loader.d.ts +26 -0
  197. package/dist/wip/gml-loader.d.ts.map +1 -0
  198. package/dist/wip/gml-loader.js +31 -0
  199. package/dist/wip/wcs-capabilities-loader.d.ts +26 -0
  200. package/dist/wip/wcs-capabilities-loader.d.ts.map +1 -0
  201. package/dist/wip/wcs-capabilities-loader.js +31 -0
  202. package/dist/wip/wfs-capabilities-loader.d.ts +26 -0
  203. package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -0
  204. package/dist/wip/wfs-capabilities-loader.js +31 -0
  205. package/dist/wip/wms-feature-info-loader.d.ts +22 -0
  206. package/dist/wip/wms-feature-info-loader.d.ts.map +1 -0
  207. package/dist/wip/wms-feature-info-loader.js +17 -0
  208. package/dist/wip/wms-layer-description-loader.d.ts +22 -0
  209. package/dist/wip/wms-layer-description-loader.d.ts.map +1 -0
  210. package/dist/wip/wms-layer-description-loader.js +17 -0
  211. package/dist/wip/wmts-capabilities-loader.d.ts +26 -0
  212. package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -0
  213. package/dist/wip/wmts-capabilities-loader.js +31 -0
  214. package/dist/wms-capabilities-loader.d.ts +26 -0
  215. package/dist/wms-capabilities-loader.d.ts.map +1 -0
  216. package/dist/wms-capabilities-loader.js +31 -0
  217. package/dist/wms-error-loader.d.ts +34 -0
  218. package/dist/wms-error-loader.d.ts.map +1 -0
  219. package/dist/wms-error-loader.js +43 -0
  220. package/package.json +17 -6
  221. package/src/bundle.ts +2 -0
  222. package/src/index.ts +54 -2
  223. package/src/lerc-loader.ts +50 -0
  224. package/src/lib/data-sources/adhoc-image-service.ts +61 -0
  225. package/src/lib/data-sources/arcgis-image-service.ts +146 -0
  226. package/src/lib/data-sources/create-image-source.ts +46 -0
  227. package/src/lib/data-sources/image-services/arcgis-image-service.ts +136 -0
  228. package/src/lib/data-sources/image-services/image-service.ts +105 -0
  229. package/src/lib/data-sources/image-services/wms-service.ts +351 -0
  230. package/src/lib/data-sources/image-source.ts +82 -0
  231. package/src/lib/gml/deep-strict-equal.ts +119 -0
  232. package/src/lib/gml/parse-gml.ts +500 -0
  233. package/src/lib/lerc/lerc-types.ts +43 -0
  234. package/src/lib/wcs/parse-wcs.ts +39 -0
  235. package/src/lib/wcs/wcs-types.ts +77 -0
  236. package/src/lib/wfs/parse-wfs.ts +39 -0
  237. package/src/lib/wfs/wfs-types.ts +78 -0
  238. package/src/lib/wms/parse-wms.ts +142 -0
  239. package/src/{wms-types.ts → lib/wms/wms-types.ts} +76 -24
  240. package/src/lib/wmts/parse-wmts.ts +39 -0
  241. package/src/lib/wmts/wmts-types.ts +77 -0
  242. package/src/wip/arcgis-feature-service.ts +89 -0
  243. package/src/wip/data-source.ts +62 -0
  244. package/src/wip/gml-loader.ts +40 -0
  245. package/src/wip/wcs-capabilities-loader.ts +40 -0
  246. package/src/wip/wfs-capabilities-loader.ts +40 -0
  247. package/src/wip/wms-feature-info-loader.ts +21 -0
  248. package/src/wip/wms-layer-description-loader.md.disabled.md +47 -0
  249. package/src/wip/wms-layer-description-loader.ts +21 -0
  250. package/src/wip/wmts-capabilities-loader.ts +40 -0
  251. package/src/wms-capabilities-loader.ts +10 -8
  252. package/src/wms-error-loader.ts +59 -0
  253. package/dist/es5/lib/parse-wms-capabilities.js +0 -19
  254. package/dist/es5/lib/parse-wms-capabilities.js.map +0 -1
  255. package/dist/esm/lib/parse-wms-capabilities.js +0 -14
  256. package/dist/esm/lib/parse-wms-capabilities.js.map +0 -1
  257. package/src/lib/parse-wms-capabilities.ts +0 -14
@@ -0,0 +1,188 @@
1
+ import type { ImageType } from '@loaders.gl/images';
2
+ import type { ImageSourceMetadata, GetImageParameters } from '../image-source';
3
+ import { ImageSource } from '../image-source';
4
+ import { ImageServiceProps } from './image-service';
5
+ import type { WMSCapabilities, WMSFeatureInfo, WMSLayerDescription } from '../../wms/wms-types';
6
+ type WMSCommonParameters = {
7
+ /** In case the endpoint supports multiple services */
8
+ service?: 'WMS';
9
+ /** In case the endpoint supports multiple WMS versions */
10
+ version?: '1.1.1' | '1.3.0';
11
+ };
12
+ export type WMSGetCapabilitiesParameters = WMSCommonParameters & {
13
+ /** Request type */
14
+ request?: 'GetCapabilities';
15
+ };
16
+ export type WMSGetMapParameters = WMSCommonParameters & {
17
+ /** Request type */
18
+ request?: 'GetMap';
19
+ /** Layers to render */
20
+ layers: string | string[];
21
+ /** Styling */
22
+ styles?: unknown;
23
+ /** bounding box of the requested map image */
24
+ bbox: [number, number, number, number];
25
+ /** pixel width of returned image */
26
+ width: number;
27
+ /** pixels */
28
+ height: number;
29
+ /** srs for the image (not the bounding box) */
30
+ srs?: string;
31
+ /** requested format for the return image */
32
+ format?: 'image/png';
33
+ };
34
+ export type WMSGetFeatureInfoParameters = WMSCommonParameters & {
35
+ /** Request type */
36
+ request?: 'GetFeatureInfo';
37
+ /** x coordinate for the feature info request */
38
+ x: number;
39
+ /** y coordinate for the feature info request */
40
+ y: number;
41
+ /** list of layers to query (could be different from rendered layers) */
42
+ query_layers: string[];
43
+ /** MIME type of returned feature info */
44
+ info_format?: 'text/plain' | 'application/vnd.ogc.gml';
45
+ /** Layers to render */
46
+ layers: string[];
47
+ /** Styling */
48
+ styles?: unknown;
49
+ /** bounding box of the requested map image */
50
+ bbox: [number, number, number, number];
51
+ /** pixel width of returned image */
52
+ width: number;
53
+ /** pixels */
54
+ height: number;
55
+ /** srs for the image (not the bounding box) */
56
+ srs?: string;
57
+ /** requested format for the return image */
58
+ format?: 'image/png';
59
+ };
60
+ export type WMSDescribeLayerParameters = WMSCommonParameters & {
61
+ /** Request type */
62
+ request?: 'DescribeLayer';
63
+ };
64
+ export type WMSGetLegendGraphicParameters = WMSCommonParameters & {
65
+ /** Request type */
66
+ request?: 'GetLegendGraphic';
67
+ };
68
+ /**
69
+ * The WMSService class provides
70
+ * - provides type safe methods to form URLs to a WMS service
71
+ * - provides type safe methods to query and parse results (and errors) from a WMS service
72
+ * - implements the ImageService interface
73
+ * @note Only the URL parameter conversion is supported. XML posts are not supported.
74
+ */
75
+ export declare class WMSService extends ImageSource {
76
+ static type: 'wms';
77
+ static testURL: (url: string) => boolean;
78
+ props: Required<ImageServiceProps>;
79
+ fetch: (url: string, options?: RequestInit) => Promise<Response>;
80
+ capabilities: WMSCapabilities | null;
81
+ /** A list of loaders used by the WMSService methods */
82
+ readonly loaders: ({
83
+ id: string;
84
+ name: string;
85
+ module: string;
86
+ version: any;
87
+ worker: boolean;
88
+ extensions: string[];
89
+ mimeTypes: string[];
90
+ testText: (text: string) => boolean;
91
+ options: {
92
+ wms: {
93
+ throwOnError: boolean;
94
+ };
95
+ };
96
+ parse: (arrayBuffer: ArrayBuffer, options?: import("../../../wms-error-loader").WMSLoaderOptions | undefined) => Promise<string>;
97
+ parseSync: (arrayBuffer: ArrayBuffer, options?: import("../../../wms-error-loader").WMSLoaderOptions | undefined) => string;
98
+ parseTextSync: (text: string, options?: import("../../../wms-error-loader").WMSLoaderOptions | undefined) => string;
99
+ } | {
100
+ id: string;
101
+ name: string;
102
+ module: string;
103
+ version: any;
104
+ worker: boolean;
105
+ extensions: string[];
106
+ mimeTypes: string[];
107
+ testText: (text: string) => boolean;
108
+ options: {
109
+ wms: {};
110
+ };
111
+ /** In case the endpoint supports multiple services */
112
+ parse: (arrayBuffer: ArrayBuffer, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => Promise<WMSCapabilities>;
113
+ parseTextSync: (text: string, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => WMSCapabilities;
114
+ } | {
115
+ id: string;
116
+ module: string;
117
+ name: string;
118
+ version: any;
119
+ mimeTypes: string[];
120
+ extensions: string[];
121
+ parse: typeof import("modules/images/src/lib/parsers/parse-image").default;
122
+ tests: ((arrayBuffer: any) => boolean)[];
123
+ options: import("@loaders.gl/images").ImageLoaderOptions;
124
+ } | {
125
+ id: string;
126
+ name: string;
127
+ parse: (arrayBuffer: ArrayBuffer, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => Promise<WMSFeatureInfo>;
128
+ parseTextSync: (text: string, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => WMSFeatureInfo;
129
+ module: string;
130
+ version: any;
131
+ worker: boolean;
132
+ extensions: string[];
133
+ mimeTypes: string[];
134
+ testText: (text: string) => boolean;
135
+ options: {
136
+ wms: {};
137
+ };
138
+ } | {
139
+ id: string;
140
+ name: string;
141
+ parse: (arrayBuffer: ArrayBuffer, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => Promise<WMSLayerDescription>;
142
+ parseTextSync: (text: string, options?: import("../../../wms-capabilities-loader").WMSLoaderOptions | undefined) => WMSLayerDescription;
143
+ module: string;
144
+ version: any;
145
+ worker: boolean;
146
+ extensions: string[];
147
+ mimeTypes: string[];
148
+ testText: (text: string) => boolean;
149
+ options: {
150
+ wms: {};
151
+ };
152
+ })[];
153
+ /** Create a WMSService */
154
+ constructor(props: ImageServiceProps);
155
+ getMetadata(): Promise<ImageSourceMetadata>;
156
+ getImage(parameters: GetImageParameters): Promise<ImageType>;
157
+ /** Get Capabilities */
158
+ getCapabilities(wmsParameters?: WMSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): Promise<WMSCapabilities>;
159
+ /** Get a map image */
160
+ getMap(options: WMSGetMapParameters, vendorParameters?: Record<string, unknown>): Promise<ImageType>;
161
+ /** Get Feature Info for a coordinate */
162
+ getFeatureInfo(options: WMSGetFeatureInfoParameters, vendorParameters?: Record<string, unknown>): Promise<WMSFeatureInfo>;
163
+ /** Get Feature Info for a coordinate */
164
+ getFeatureInfoText(options: WMSGetFeatureInfoParameters, vendorParameters?: Record<string, unknown>): Promise<string>;
165
+ /** Get more information about a layer */
166
+ describeLayer(options: WMSDescribeLayerParameters, vendorParameters?: Record<string, unknown>): Promise<WMSLayerDescription>;
167
+ /** Get an image with a semantic legend */
168
+ getLegendGraphic(options: WMSGetLegendGraphicParameters, vendorParameters?: Record<string, unknown>): Promise<ImageType>;
169
+ /** Generate a URL for the GetCapabilities request */
170
+ getCapabilitiesURL(wmsParameters?: WMSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): string;
171
+ /** Generate a URL for the GetMap request */
172
+ getMapURL(wmsParameters: WMSGetMapParameters, vendorParameters?: Record<string, unknown>): string;
173
+ /** Generate a URL for the GetFeatureInfo request */
174
+ getFeatureInfoURL(wmsParameters: WMSGetFeatureInfoParameters, vendorParameters?: Record<string, unknown>): string;
175
+ /** Generate a URL for the GetFeatureInfo request */
176
+ describeLayerURL(wmsParameters: WMSDescribeLayerParameters, vendorParameters?: Record<string, unknown>): string;
177
+ getLegendGraphicURL(wmsParameters: WMSGetLegendGraphicParameters, vendorParameters?: Record<string, unknown>): string;
178
+ /**
179
+ * @note case _getWMSUrl may need to be overridden to handle certain backends?
180
+ * */
181
+ protected _getWMSUrl(options: Record<string, unknown>, vendorParameters?: Record<string, unknown>): string;
182
+ /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
183
+ protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void;
184
+ /** Error situation detected */
185
+ protected _parseError(arrayBuffer: ArrayBuffer): Error;
186
+ }
187
+ export {};
188
+ //# sourceMappingURL=wms-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wms-service.d.ts","sourceRoot":"","sources":["../../../../src/lib/data-sources/image-services/wms-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,iBAAiB,EAA2C,MAAM,iBAAiB,CAAC;AAE5F,OAAO,KAAK,EAAC,eAAe,EAAE,cAAc,EAAE,mB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BAAgB,CACd,aAAa,EAAE,0BAA0B,EACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,MAAM;IAWT,mBAAmB,CACjB,aAAa,EAAE,6BAA6B,EAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,MAAM;IAaT;;SAEK;IACL,SAAS,CAAC,UAAU,CAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,MAAM;IAeT,qFAAqF;IACrF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IAQ5E,+BAA+B;IAC/B,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK;CAIvD"}
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ // loaders.gl, MIT license
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.WMSService = void 0;
5
+ const images_1 = require("@loaders.gl/images");
6
+ const image_source_1 = require("../image-source");
7
+ const image_service_1 = require("./image-service");
8
+ const wms_capabilities_loader_1 = require("../../../wms-capabilities-loader");
9
+ const wms_feature_info_loader_1 = require("../../../wip/wms-feature-info-loader");
10
+ const wms_layer_description_loader_1 = require("../../../wip/wms-layer-description-loader");
11
+ const wms_error_loader_1 = require("../../../wms-error-loader");
12
+ /**
13
+ * The WMSService class provides
14
+ * - provides type safe methods to form URLs to a WMS service
15
+ * - provides type safe methods to query and parse results (and errors) from a WMS service
16
+ * - implements the ImageService interface
17
+ * @note Only the URL parameter conversion is supported. XML posts are not supported.
18
+ */
19
+ class WMSService extends image_source_1.ImageSource {
20
+ /** Create a WMSService */
21
+ constructor(props) {
22
+ super();
23
+ this.capabilities = null;
24
+ /** A list of loaders used by the WMSService methods */
25
+ this.loaders = [
26
+ images_1.ImageLoader,
27
+ wms_error_loader_1.WMSErrorLoader,
28
+ wms_capabilities_loader_1.WMSCapabilitiesLoader,
29
+ wms_feature_info_loader_1.WMSFeatureInfoLoader,
30
+ wms_layer_description_loader_1.WMSLayerDescriptionLoader
31
+ ];
32
+ this.props = (0, image_service_1.mergeImageServiceProps)(props);
33
+ this.fetch = (0, image_service_1.getFetchFunction)(this.props);
34
+ this.props.loadOptions = {
35
+ ...this.props.loadOptions,
36
+ // We want error responses to throw exceptions, the WMSErrorLoader can do this
37
+ wms: { ...this.props.loadOptions?.wms, throwOnError: true }
38
+ };
39
+ }
40
+ // ImageSource implementation
41
+ getMetadata() {
42
+ return this.getCapabilities();
43
+ }
44
+ getImage(parameters) {
45
+ return this.getMap(parameters);
46
+ }
47
+ // WMS Service API Stubs
48
+ /** Get Capabilities */
49
+ async getCapabilities(wmsParameters, vendorParameters) {
50
+ const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
51
+ const response = await this.fetch(url);
52
+ const arrayBuffer = await response.arrayBuffer();
53
+ this._checkResponse(response, arrayBuffer);
54
+ const capabilities = await wms_capabilities_loader_1.WMSCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);
55
+ this.capabilities = capabilities;
56
+ return capabilities;
57
+ }
58
+ /** Get a map image */
59
+ async getMap(options, vendorParameters) {
60
+ const url = this.getMapURL(options, vendorParameters);
61
+ const response = await this.fetch(url);
62
+ const arrayBuffer = await response.arrayBuffer();
63
+ this._checkResponse(response, arrayBuffer);
64
+ try {
65
+ return await images_1.ImageLoader.parse(arrayBuffer, this.props.loadOptions);
66
+ }
67
+ catch {
68
+ throw this._parseError(arrayBuffer);
69
+ }
70
+ }
71
+ /** Get Feature Info for a coordinate */
72
+ async getFeatureInfo(options, vendorParameters) {
73
+ const url = this.getFeatureInfoURL(options, vendorParameters);
74
+ const response = await this.fetch(url);
75
+ const arrayBuffer = await response.arrayBuffer();
76
+ this._checkResponse(response, arrayBuffer);
77
+ return await wms_feature_info_loader_1.WMSFeatureInfoLoader.parse(arrayBuffer, this.props.loadOptions);
78
+ }
79
+ /** Get Feature Info for a coordinate */
80
+ async getFeatureInfoText(options, vendorParameters) {
81
+ options = { ...options, info_format: 'text/plain' };
82
+ const url = this.getFeatureInfoURL(options, vendorParameters);
83
+ const response = await this.fetch(url);
84
+ const arrayBuffer = await response.arrayBuffer();
85
+ this._checkResponse(response, arrayBuffer);
86
+ return new TextDecoder().decode(arrayBuffer);
87
+ }
88
+ /** Get more information about a layer */
89
+ async describeLayer(options, vendorParameters) {
90
+ const url = this.describeLayerURL(options, vendorParameters);
91
+ const response = await this.fetch(url);
92
+ const arrayBuffer = await response.arrayBuffer();
93
+ this._checkResponse(response, arrayBuffer);
94
+ return await wms_layer_description_loader_1.WMSLayerDescriptionLoader.parse(arrayBuffer, this.props.loadOptions);
95
+ }
96
+ /** Get an image with a semantic legend */
97
+ async getLegendGraphic(options, vendorParameters) {
98
+ const url = this.getLegendGraphicURL(options, vendorParameters);
99
+ const response = await this.fetch(url);
100
+ const arrayBuffer = await response.arrayBuffer();
101
+ this._checkResponse(response, arrayBuffer);
102
+ try {
103
+ return await images_1.ImageLoader.parse(arrayBuffer, this.props.loadOptions);
104
+ }
105
+ catch {
106
+ throw this._parseError(arrayBuffer);
107
+ }
108
+ }
109
+ // Typed URL creators
110
+ // For applications that want full control of fetching and parsing
111
+ /** Generate a URL for the GetCapabilities request */
112
+ getCapabilitiesURL(wmsParameters, vendorParameters) {
113
+ const options = {
114
+ service: 'WMS',
115
+ version: '1.1.1',
116
+ request: 'GetCapabilities',
117
+ ...wmsParameters,
118
+ ...vendorParameters
119
+ };
120
+ return this._getWMSUrl(options, vendorParameters);
121
+ }
122
+ /** Generate a URL for the GetMap request */
123
+ getMapURL(wmsParameters, vendorParameters) {
124
+ const options = {
125
+ service: 'WMS',
126
+ version: '1.1.1',
127
+ request: 'GetMap',
128
+ // layers: [],
129
+ // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
130
+ // width: 1200,
131
+ // height: 900,
132
+ styles: undefined,
133
+ srs: 'EPSG:4326',
134
+ format: 'image/png',
135
+ ...wmsParameters,
136
+ ...vendorParameters
137
+ };
138
+ return this._getWMSUrl(options, vendorParameters);
139
+ }
140
+ /** Generate a URL for the GetFeatureInfo request */
141
+ getFeatureInfoURL(wmsParameters, vendorParameters) {
142
+ const options = {
143
+ service: 'WMS',
144
+ version: '1.1.1',
145
+ request: 'GetFeatureInfo',
146
+ // layers: [],
147
+ // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
148
+ // width: 1200,
149
+ // height: 900,
150
+ // x: undefined!,
151
+ // y: undefined!,
152
+ // query_layers: [],
153
+ srs: 'EPSG:4326',
154
+ format: 'image/png',
155
+ info_format: 'text/plain',
156
+ styles: undefined,
157
+ ...wmsParameters,
158
+ ...vendorParameters
159
+ };
160
+ return this._getWMSUrl(options, vendorParameters);
161
+ }
162
+ /** Generate a URL for the GetFeatureInfo request */
163
+ describeLayerURL(wmsParameters, vendorParameters) {
164
+ const options = {
165
+ service: 'WMS',
166
+ version: '1.1.1',
167
+ request: 'DescribeLayer',
168
+ ...wmsParameters,
169
+ ...vendorParameters
170
+ };
171
+ return this._getWMSUrl(options, vendorParameters);
172
+ }
173
+ getLegendGraphicURL(wmsParameters, vendorParameters) {
174
+ const options = {
175
+ service: 'WMS',
176
+ version: '1.1.1',
177
+ request: 'GetLegendGraphic',
178
+ ...wmsParameters,
179
+ ...vendorParameters
180
+ };
181
+ return this._getWMSUrl(options, vendorParameters);
182
+ }
183
+ // INTERNAL METHODS
184
+ /**
185
+ * @note case _getWMSUrl may need to be overridden to handle certain backends?
186
+ * */
187
+ _getWMSUrl(options, vendorParameters) {
188
+ let url = this.props.url;
189
+ let first = true;
190
+ for (const [key, value] of Object.entries(options)) {
191
+ url += first ? '?' : '&';
192
+ first = false;
193
+ if (Array.isArray(value)) {
194
+ url += `${key.toUpperCase()}=${value.join(',')}`;
195
+ }
196
+ else {
197
+ url += `${key.toUpperCase()}=${value ? String(value) : ''}`;
198
+ }
199
+ }
200
+ return encodeURI(url);
201
+ }
202
+ /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
203
+ _checkResponse(response, arrayBuffer) {
204
+ const contentType = response.headers['content-type'];
205
+ if (!response.ok || wms_error_loader_1.WMSErrorLoader.mimeTypes.includes(contentType)) {
206
+ const error = wms_error_loader_1.WMSErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);
207
+ throw new Error(error);
208
+ }
209
+ }
210
+ /** Error situation detected */
211
+ _parseError(arrayBuffer) {
212
+ const error = wms_error_loader_1.WMSErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);
213
+ return new Error(error);
214
+ }
215
+ }
216
+ exports.WMSService = WMSService;
217
+ WMSService.type = 'wms';
218
+ WMSService.testURL = (url) => url.toLowerCase().includes('wms');
@@ -0,0 +1,73 @@
1
+ import type { ImageType } from '@loaders.gl/images';
2
+ /**
3
+ * Normalized capabilities of an Image service
4
+ * @example
5
+ * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response
6
+ * into an ImageSourceMetadata.
7
+ */
8
+ export type ImageSourceMetadata = {
9
+ name: string;
10
+ title?: string;
11
+ abstract?: string;
12
+ keywords: string[];
13
+ layer: {
14
+ name: string;
15
+ title?: string;
16
+ srs?: string[];
17
+ boundingBox?: [number, number, number, number];
18
+ layers: ImageSourceLayer[];
19
+ };
20
+ };
21
+ export type ImageSourceLayer = {
22
+ name: string;
23
+ title?: string;
24
+ srs?: string[];
25
+ boundingBox?: [number, number, number, number];
26
+ layers: ImageSourceLayer[];
27
+ };
28
+ export type GetImageParameters = {
29
+ /** Layers to render */
30
+ layers: string | string[];
31
+ /** Styling */
32
+ styles?: unknown;
33
+ /** bounding box of the requested map image */
34
+ bbox: [number, number, number, number];
35
+ /** pixel width of returned image */
36
+ width: number;
37
+ /** pixels */
38
+ height: number;
39
+ /** srs for the image (not the bounding box) */
40
+ srs?: string;
41
+ /** requested format for the return image */
42
+ format?: 'image/png';
43
+ };
44
+ export type ImageFilters = {
45
+ /** Layers to render */
46
+ layers: string | string[];
47
+ /** Styling */
48
+ styles?: unknown;
49
+ };
50
+ export type ImageRegion = {
51
+ /** bounding box of the requested map image */
52
+ bbox: [number, number, number, number];
53
+ };
54
+ export type ImageFormat = {
55
+ /** pixel width of returned image */
56
+ width: number;
57
+ /** pixels */
58
+ height: number;
59
+ /** srs for the image (not the bounding box) */
60
+ srs?: string;
61
+ /** requested format for the return image */
62
+ format?: 'image/png';
63
+ };
64
+ /**
65
+ * MapImageSource - data sources that allow data to be queried by (geospatial) extents
66
+ * @note
67
+ * - If geospatial, bounding box is expected to be in web mercator coordinates
68
+ */
69
+ export declare abstract class ImageSource {
70
+ abstract getMetadata(): Promise<ImageSourceMetadata>;
71
+ abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
72
+ }
73
+ //# sourceMappingURL=image-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/data-sources/image-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QACf,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,EAAE,gBAAgB,EAAE,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,K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AAC,mBAAmB,CAAC;IACpD,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;CACtE"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // loaders.gl, MIT license
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImageSource = void 0;
5
+ /**
6
+ * MapImageSource - data sources that allow data to be queried by (geospatial) extents
7
+ * @note
8
+ * - If geospatial, bounding box is expected to be in web mercator coordinates
9
+ */
10
+ class ImageSource {
11
+ }
12
+ exports.ImageSource = ImageSource;
@@ -0,0 +1,3 @@
1
+ /** @todo replace this ridiculous choice of deepStrictEqual */
2
+ export declare function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean): any;
3
+ //# sourceMappingURL=deep-strict-equal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-strict-equal.d.ts","sourceRoot":"","sources":["../../../src/lib/gml/deep-strict-equal.ts"],"names":[],"mappings":"AA0BA,8DAA8D;AAE9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,OAyCnF"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ // https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.deepStrictEqual = void 0;
5
+ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
6
+ //
7
+ // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
8
+ //
9
+ // Originally from narwhal.js (http://narwhaljs.org)
10
+ // Copyright (c) 2009 Thomas Robinson <280north.com>
11
+ //
12
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ // of this software and associated documentation files (the 'Software'), to
14
+ // deal in the Software without restriction, including without limitation the
15
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16
+ // sell copies of the Software, and to permit persons to whom the Software is
17
+ // furnished to do so, subject to the following conditions:
18
+ //
19
+ // The above copyright notice and this permission notice shall be included in
20
+ // all copies or substantial portions of the Software.
21
+ //
22
+ // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26
+ // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ /** @todo replace this ridiculous choice of deepStrictEqual */
29
+ // eslint-disable-next-line complexity
30
+ function deepStrictEqual(actual, expected, strict) {
31
+ // 7.1. All identical values are equivalent, as determined by ===.
32
+ if (actual === expected) {
33
+ return true;
34
+ // } else if (actual instanceof Buffer && expected instanceof Buffer) {
35
+ // return compare(actual, expected) === 0;
36
+ // // 7.2. If the expected value is a Date object, the actual value is
37
+ // // equivalent if it is also a Date object that refers to the same time.
38
+ }
39
+ else if (actual instanceof Date && expected instanceof Date) {
40
+ return actual.getTime() === expected.getTime();
41
+ // 7.3 If the expected value is a RegExp object, the actual value is
42
+ // equivalent if it is also a RegExp object with the same source and
43
+ // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
44
+ }
45
+ else if (actual instanceof RegExp && expected instanceof RegExp) {
46
+ return (actual.source === expected.source &&
47
+ actual.global === expected.global &&
48
+ actual.multiline === expected.multiline &&
49
+ actual.lastIndex === expected.lastIndex &&
50
+ actual.ignoreCase === expected.ignoreCase);
51
+ // 7.4. Other pairs that do not both pass typeof value == 'object',
52
+ // equivalence is determined by ==.
53
+ }
54
+ else if ((actual === null || typeof actual !== 'object') &&
55
+ (expected === null || typeof expected !== 'object')) {
56
+ // eslint-disable-next-line eqeqeq
57
+ return strict ? actual === expected : actual == expected;
58
+ // 7.5 For all other Object pairs, including Array objects, equivalence is
59
+ // determined by having the same number of owned properties (as verified
60
+ // with Object.prototype.hasOwnProperty.call), the same set of keys
61
+ // (although not necessarily the same order), equivalent values for every
62
+ // corresponding key, and an identical 'prototype' property. Note: this
63
+ // accounts for both named and indexed properties on Arrays.
64
+ }
65
+ return objEquiv(actual, expected, strict);
66
+ }
67
+ exports.deepStrictEqual = deepStrictEqual;
68
+ // eslint-disable-next-line @typescript-eslint/unbound-method
69
+ const pSlice = Array.prototype.slice;
70
+ function isPrimitive(arg) {
71
+ return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');
72
+ }
73
+ function isArguments(object) {
74
+ // eslint-disable-next-line eqeqeq
75
+ return Object.prototype.toString.call(object) == '[object Arguments]';
76
+ }
77
+ // eslint-disable-next-line complexity
78
+ function objEquiv(a, b, strict) {
79
+ if (a === null || a === undefined || b === null || b === undefined)
80
+ return false;
81
+ // if one is a primitive, the other must be same
82
+ if (isPrimitive(a) || isPrimitive(b))
83
+ return a === b;
84
+ if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
85
+ return false;
86
+ const aIsArgs = isArguments(a);
87
+ const bIsArgs = isArguments(b);
88
+ if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
89
+ return false;
90
+ if (aIsArgs) {
91
+ a = pSlice.call(a);
92
+ b = pSlice.call(b);
93
+ return deepStrictEqual(a, b, strict);
94
+ }
95
+ const ka = Object.keys(a);
96
+ const kb = Object.keys(b);
97
+ let key;
98
+ let i;
99
+ // having the same number of owned properties (keys incorporates
100
+ // hasOwnProperty)
101
+ if (ka.length !== kb.length)
102
+ return false;
103
+ // the same set of keys (although not necessarily the same order),
104
+ ka.sort();
105
+ kb.sort();
106
+ // ~~~cheap key test
107
+ for (i = ka.length - 1; i >= 0; i--) {
108
+ if (ka[i] !== kb[i])
109
+ return false;
110
+ }
111
+ // equivalent values for every corresponding key, and
112
+ // ~~~possibly expensive deep test
113
+ for (i = ka.length - 1; i >= 0; i--) {
114
+ key = ka[i];
115
+ if (!deepStrictEqual(a[key], b[key], strict))
116
+ return false;
117
+ }
118
+ return true;
119
+ }
@@ -0,0 +1,28 @@
1
+ import type { Geometry, Position } from '@loaders.gl/schema';
2
+ export type ParseGMLOptions = {
3
+ transformCoords?: Function;
4
+ stride?: 2 | 3 | 4;
5
+ };
6
+ export type ParseGMLContext = {
7
+ srsDimension?: number;
8
+ [key: string]: any;
9
+ };
10
+ /**
11
+ * Parses a typed data structure from raw XML for GML features
12
+ * @note Error handlings is fairly weak
13
+ */
14
+ export declare function parseGML(text: string, options: any): Geometry | null;
15
+ /** Parse a GeoJSON geometry from GML XML */
16
+ export declare function parseGMLToGeometry(inputXML: any, options: ParseGMLOptions, context: ParseGMLContext): Geometry | null;
17
+ export declare function parsePosList(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[];
18
+ export declare function parsePos(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position;
19
+ export declare function parsePoint(xml: any, options: ParseGMLOptions, context: ParseGMLContext): number[];
20
+ export declare function parseLinearRingOrLineString(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[];
21
+ export declare function parseCurveSegments(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[];
22
+ export declare function parseRing(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[];
23
+ export declare function parseExteriorOrInterior(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[];
24
+ export declare function parsePolygonOrRectangle(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[][];
25
+ export declare function parseSurface(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[][][];
26
+ export declare function parseCompositeSurface(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[][][];
27
+ export declare function parseMultiSurface(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position[][][];
28
+ //# sourceMappingURL=parse-gml.d.ts.map