@loaders.gl/wms 4.0.0-beta.2 → 4.0.0-beta.4

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 (216) hide show
  1. package/dist/{esm/csw-capabilities-loader.js → csw-capabilities-loader.js} +2 -2
  2. package/dist/csw-capabilities-loader.js.map +1 -0
  3. package/dist/{esm/csw-domain-loader.js → csw-domain-loader.js} +2 -2
  4. package/dist/csw-domain-loader.js.map +1 -0
  5. package/dist/{esm/csw-records-loader.js → csw-records-loader.js} +2 -2
  6. package/dist/csw-records-loader.js.map +1 -0
  7. package/dist/{dist.min.js → dist.dev.js} +998 -1229
  8. package/dist/{esm/gml-loader.js → gml-loader.js} +2 -2
  9. package/dist/gml-loader.js.map +1 -0
  10. package/dist/index.cjs +1641 -0
  11. package/dist/index.js +18 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/{esm/lerc-loader.js → lerc-loader.js} +1 -1
  14. package/dist/lerc-loader.js.map +1 -0
  15. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-capabilities.js +1 -1
  16. package/dist/lib/parsers/csw/parse-csw-capabilities.js.map +1 -0
  17. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-domain.js +1 -1
  18. package/dist/lib/parsers/csw/parse-csw-domain.js.map +1 -0
  19. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-records.js +2 -2
  20. package/dist/lib/parsers/csw/parse-csw-records.js.map +1 -0
  21. package/dist/{esm/lib → lib}/parsers/csw/parse-exception-report.js +1 -1
  22. package/dist/lib/parsers/csw/parse-exception-report.js.map +1 -0
  23. package/dist/lib/parsers/gml/deep-strict-equal.js.map +1 -0
  24. package/dist/{esm/lib → lib}/parsers/gml/parse-gml.js +13 -13
  25. package/dist/lib/parsers/gml/parse-gml.js.map +1 -0
  26. package/dist/lib/parsers/lerc/lerc-types.js.map +1 -0
  27. package/dist/{esm/lib → lib}/parsers/wms/parse-wms-capabilities.js +1 -1
  28. package/dist/lib/parsers/wms/parse-wms-capabilities.js.map +1 -0
  29. package/dist/lib/parsers/wms/parse-wms-error.js.map +1 -0
  30. package/dist/lib/parsers/wms/parse-wms-features.js.map +1 -0
  31. package/dist/lib/parsers/wms/parse-wms-layer-description.js.map +1 -0
  32. package/dist/lib/parsers/xml/parse-xml-helpers.js.map +1 -0
  33. package/dist/lib/services/create-image-service.js.map +1 -0
  34. package/dist/{esm/lib → lib}/services/image-service.js +4 -5
  35. package/dist/lib/services/image-service.js.map +1 -0
  36. package/dist/{esm/services → services}/arcgis/arcgis-image-service.js +7 -7
  37. package/dist/services/arcgis/arcgis-image-service.js.map +1 -0
  38. package/dist/{esm/services → services}/arcgis/arcgis-server.js +5 -5
  39. package/dist/services/arcgis/arcgis-server.js.map +1 -0
  40. package/dist/services/create-image-source.js +8 -0
  41. package/dist/services/create-image-source.js.map +1 -0
  42. package/dist/services/ogc/csw-service.d.ts +1 -1
  43. package/dist/services/ogc/csw-service.d.ts.map +1 -1
  44. package/dist/{esm/services → services}/ogc/csw-service.js +10 -11
  45. package/dist/services/ogc/csw-service.js.map +1 -0
  46. package/dist/services/ogc/wms-service.d.ts.map +1 -1
  47. package/dist/{esm/services → services}/ogc/wms-service.js +12 -12
  48. package/dist/services/ogc/wms-service.js.map +1 -0
  49. package/dist/wip/data-source.js.map +1 -0
  50. package/dist/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -0
  51. package/dist/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -0
  52. package/dist/wip/lib/wfs/parse-wfs.js.map +1 -0
  53. package/dist/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -0
  54. package/dist/wip/lib/wmts/parse-wmts.js.map +1 -0
  55. package/dist/{esm/wip → wip}/services/arcgis-feature-service.js +3 -4
  56. package/dist/wip/services/arcgis-feature-service.js.map +1 -0
  57. package/dist/{esm/wip → wip}/wcs-capabilities-loader.js +2 -2
  58. package/dist/wip/wcs-capabilities-loader.js.map +1 -0
  59. package/dist/{esm/wip → wip}/wfs-capabilities-loader.js +2 -2
  60. package/dist/wip/wfs-capabilities-loader.js.map +1 -0
  61. package/dist/{esm/wip → wip}/wms-feature-info-loader.js +2 -2
  62. package/dist/wip/wms-feature-info-loader.js.map +1 -0
  63. package/dist/{esm/wip → wip}/wms-layer-description-loader.js +2 -2
  64. package/dist/wip/wms-layer-description-loader.js.map +1 -0
  65. package/dist/{esm/wip → wip}/wmts-capabilities-loader.js +2 -2
  66. package/dist/wip/wmts-capabilities-loader.js.map +1 -0
  67. package/dist/{esm/wms-capabilities-loader.js → wms-capabilities-loader.js} +2 -2
  68. package/dist/wms-capabilities-loader.js.map +1 -0
  69. package/dist/{esm/wms-error-loader.js → wms-error-loader.js} +3 -3
  70. package/dist/wms-error-loader.js.map +1 -0
  71. package/package.json +18 -10
  72. package/src/services/ogc/csw-service.ts +1 -1
  73. package/src/services/ogc/wms-service.ts +1 -0
  74. package/dist/bundle.d.ts +0 -2
  75. package/dist/bundle.d.ts.map +0 -1
  76. package/dist/es5/bundle.js +0 -6
  77. package/dist/es5/bundle.js.map +0 -1
  78. package/dist/es5/csw-capabilities-loader.js +0 -49
  79. package/dist/es5/csw-capabilities-loader.js.map +0 -1
  80. package/dist/es5/csw-domain-loader.js +0 -49
  81. package/dist/es5/csw-domain-loader.js.map +0 -1
  82. package/dist/es5/csw-records-loader.js +0 -49
  83. package/dist/es5/csw-records-loader.js.map +0 -1
  84. package/dist/es5/gml-loader.js +0 -49
  85. package/dist/es5/gml-loader.js.map +0 -1
  86. package/dist/es5/index.js +0 -131
  87. package/dist/es5/index.js.map +0 -1
  88. package/dist/es5/lerc-loader.js +0 -67
  89. package/dist/es5/lerc-loader.js.map +0 -1
  90. package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js +0 -25
  91. package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +0 -1
  92. package/dist/es5/lib/parsers/csw/parse-csw-domain.js +0 -43
  93. package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +0 -1
  94. package/dist/es5/lib/parsers/csw/parse-csw-records.js +0 -76
  95. package/dist/es5/lib/parsers/csw/parse-csw-records.js.map +0 -1
  96. package/dist/es5/lib/parsers/csw/parse-exception-report.js +0 -16
  97. package/dist/es5/lib/parsers/csw/parse-exception-report.js.map +0 -1
  98. package/dist/es5/lib/parsers/gml/deep-strict-equal.js +0 -56
  99. package/dist/es5/lib/parsers/gml/deep-strict-equal.js.map +0 -1
  100. package/dist/es5/lib/parsers/gml/parse-gml.js +0 -405
  101. package/dist/es5/lib/parsers/gml/parse-gml.js.map +0 -1
  102. package/dist/es5/lib/parsers/lerc/lerc-types.js +0 -2
  103. package/dist/es5/lib/parsers/lerc/lerc-types.js.map +0 -1
  104. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +0 -274
  105. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +0 -1
  106. package/dist/es5/lib/parsers/wms/parse-wms-error.js +0 -15
  107. package/dist/es5/lib/parsers/wms/parse-wms-error.js.map +0 -1
  108. package/dist/es5/lib/parsers/wms/parse-wms-features.js +0 -32
  109. package/dist/es5/lib/parsers/wms/parse-wms-features.js.map +0 -1
  110. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js +0 -13
  111. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js.map +0 -1
  112. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js +0 -67
  113. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js.map +0 -1
  114. package/dist/es5/lib/services/create-image-service.js +0 -53
  115. package/dist/es5/lib/services/create-image-service.js.map +0 -1
  116. package/dist/es5/lib/services/image-service.js +0 -118
  117. package/dist/es5/lib/services/image-service.js.map +0 -1
  118. package/dist/es5/services/arcgis/arcgis-image-service.js +0 -168
  119. package/dist/es5/services/arcgis/arcgis-image-service.js.map +0 -1
  120. package/dist/es5/services/arcgis/arcgis-server.js +0 -111
  121. package/dist/es5/services/arcgis/arcgis-server.js.map +0 -1
  122. package/dist/es5/services/create-image-source.js +0 -14
  123. package/dist/es5/services/create-image-source.js.map +0 -1
  124. package/dist/es5/services/ogc/csw-service.js +0 -359
  125. package/dist/es5/services/ogc/csw-service.js.map +0 -1
  126. package/dist/es5/services/ogc/wms-service.js +0 -539
  127. package/dist/es5/services/ogc/wms-service.js.map +0 -1
  128. package/dist/es5/wip/data-source.js +0 -2
  129. package/dist/es5/wip/data-source.js.map +0 -1
  130. package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js +0 -22
  131. package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +0 -1
  132. package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js +0 -23
  133. package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +0 -1
  134. package/dist/es5/wip/lib/wfs/parse-wfs.js +0 -41
  135. package/dist/es5/wip/lib/wfs/parse-wfs.js.map +0 -1
  136. package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js +0 -23
  137. package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js.map +0 -1
  138. package/dist/es5/wip/lib/wmts/parse-wmts.js +0 -41
  139. package/dist/es5/wip/lib/wmts/parse-wmts.js.map +0 -1
  140. package/dist/es5/wip/services/arcgis-feature-service.js +0 -40
  141. package/dist/es5/wip/services/arcgis-feature-service.js.map +0 -1
  142. package/dist/es5/wip/wcs-capabilities-loader.js +0 -51
  143. package/dist/es5/wip/wcs-capabilities-loader.js.map +0 -1
  144. package/dist/es5/wip/wfs-capabilities-loader.js +0 -51
  145. package/dist/es5/wip/wfs-capabilities-loader.js.map +0 -1
  146. package/dist/es5/wip/wms-feature-info-loader.js +0 -42
  147. package/dist/es5/wip/wms-feature-info-loader.js.map +0 -1
  148. package/dist/es5/wip/wms-layer-description-loader.js +0 -42
  149. package/dist/es5/wip/wms-layer-description-loader.js.map +0 -1
  150. package/dist/es5/wip/wmts-capabilities-loader.js +0 -51
  151. package/dist/es5/wip/wmts-capabilities-loader.js.map +0 -1
  152. package/dist/es5/wms-capabilities-loader.js +0 -49
  153. package/dist/es5/wms-capabilities-loader.js.map +0 -1
  154. package/dist/es5/wms-error-loader.js +0 -66
  155. package/dist/es5/wms-error-loader.js.map +0 -1
  156. package/dist/esm/bundle.js +0 -4
  157. package/dist/esm/bundle.js.map +0 -1
  158. package/dist/esm/csw-capabilities-loader.js.map +0 -1
  159. package/dist/esm/csw-domain-loader.js.map +0 -1
  160. package/dist/esm/csw-records-loader.js.map +0 -1
  161. package/dist/esm/gml-loader.js.map +0 -1
  162. package/dist/esm/index.js +0 -18
  163. package/dist/esm/index.js.map +0 -1
  164. package/dist/esm/lerc-loader.js.map +0 -1
  165. package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js.map +0 -1
  166. package/dist/esm/lib/parsers/csw/parse-csw-domain.js.map +0 -1
  167. package/dist/esm/lib/parsers/csw/parse-csw-records.js.map +0 -1
  168. package/dist/esm/lib/parsers/csw/parse-exception-report.js.map +0 -1
  169. package/dist/esm/lib/parsers/gml/deep-strict-equal.js.map +0 -1
  170. package/dist/esm/lib/parsers/gml/parse-gml.js.map +0 -1
  171. package/dist/esm/lib/parsers/lerc/lerc-types.js.map +0 -1
  172. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +0 -1
  173. package/dist/esm/lib/parsers/wms/parse-wms-error.js.map +0 -1
  174. package/dist/esm/lib/parsers/wms/parse-wms-features.js.map +0 -1
  175. package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js.map +0 -1
  176. package/dist/esm/lib/parsers/xml/parse-xml-helpers.js.map +0 -1
  177. package/dist/esm/lib/services/create-image-service.js.map +0 -1
  178. package/dist/esm/lib/services/image-service.js.map +0 -1
  179. package/dist/esm/services/arcgis/arcgis-image-service.js.map +0 -1
  180. package/dist/esm/services/arcgis/arcgis-server.js.map +0 -1
  181. package/dist/esm/services/create-image-source.js +0 -8
  182. package/dist/esm/services/create-image-source.js.map +0 -1
  183. package/dist/esm/services/ogc/csw-service.js.map +0 -1
  184. package/dist/esm/services/ogc/wms-service.js.map +0 -1
  185. package/dist/esm/wip/data-source.js.map +0 -1
  186. package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js.map +0 -1
  187. package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js.map +0 -1
  188. package/dist/esm/wip/lib/wfs/parse-wfs.js.map +0 -1
  189. package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js.map +0 -1
  190. package/dist/esm/wip/lib/wmts/parse-wmts.js.map +0 -1
  191. package/dist/esm/wip/services/arcgis-feature-service.js.map +0 -1
  192. package/dist/esm/wip/services/wmts-service.ts.disabled +0 -348
  193. package/dist/esm/wip/wcs-capabilities-loader.js.map +0 -1
  194. package/dist/esm/wip/wfs-capabilities-loader.js.map +0 -1
  195. package/dist/esm/wip/wms-feature-info-loader.js.map +0 -1
  196. package/dist/esm/wip/wms-layer-description-loader.js.map +0 -1
  197. package/dist/esm/wip/wms-layer-description-loader.md.disabled.md +0 -47
  198. package/dist/esm/wip/wmts-capabilities-loader.js.map +0 -1
  199. package/dist/esm/wms-capabilities-loader.js.map +0 -1
  200. package/dist/esm/wms-error-loader.js.map +0 -1
  201. package/src/bundle.ts +0 -6
  202. /package/dist/{esm/lib → lib}/parsers/gml/deep-strict-equal.js +0 -0
  203. /package/dist/{esm/lib → lib}/parsers/lerc/lerc-types.js +0 -0
  204. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-error.js +0 -0
  205. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-features.js +0 -0
  206. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-layer-description.js +0 -0
  207. /package/dist/{esm/lib → lib}/parsers/xml/parse-xml-helpers.js +0 -0
  208. /package/dist/{esm/lib → lib}/services/create-image-service.js +0 -0
  209. /package/dist/{esm/wip → wip}/data-source.js +0 -0
  210. /package/dist/{esm/wip → wip}/lib/wcs/parse-wcs-capabilities.js +0 -0
  211. /package/dist/{esm/wip → wip}/lib/wfs/parse-wfs-capabilities.js +0 -0
  212. /package/dist/{esm/wip → wip}/lib/wfs/parse-wfs.js +0 -0
  213. /package/dist/{esm/wip → wip}/lib/wmts/parse-wmts-capabilities.js +0 -0
  214. /package/dist/{esm/wip → wip}/lib/wmts/parse-wmts.js +0 -0
  215. /package/dist/{es5/wip → wip}/services/wmts-service.ts.disabled +0 -0
  216. /package/dist/{es5/wip → wip}/wms-layer-description-loader.md.disabled.md +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ export { CSWCapabilitiesLoader } from "./csw-capabilities-loader.js";
2
+ export { CSWDomainLoader } from "./csw-domain-loader.js";
3
+ export { CSWRecordsLoader } from "./csw-records-loader.js";
4
+ export { WMSErrorLoader } from "./wms-error-loader.js";
5
+ export { WMSCapabilitiesLoader } from "./wms-capabilities-loader.js";
6
+ export { WMSFeatureInfoLoader as _WMSFeatureInfoLoader } from "./wip/wms-feature-info-loader.js";
7
+ export { WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader } from "./wip/wms-layer-description-loader.js";
8
+ export { WFSCapabilitiesLoader as _WFSCapabilitiesLoader } from "./wip/wfs-capabilities-loader.js";
9
+ export { GMLLoader as _GMLLoader } from "./gml-loader.js";
10
+ export { createImageService } from "./lib/services/create-image-service.js";
11
+ export { createImageSource } from "./services/create-image-source.js";
12
+ export { ImageService } from "./lib/services/image-service.js";
13
+ export { CSWService } from "./services/ogc/csw-service.js";
14
+ export { WMSSource, WMSService } from "./services/ogc/wms-service.js";
15
+ export { getArcGISServices as _getArcGISServices } from "./services/arcgis/arcgis-server.js";
16
+ export { ArcGISImageService as _ArcGISImageService } from "./services/arcgis/arcgis-image-service.js";
17
+ export { ImageSource } from '@loaders.gl/loader-utils';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","createImageService","createImageSource","ImageService","CSWService","WMSSource","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageService","_ArcGISImageService","ImageSource"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension\n} from './wms-capabilities-loader';\nexport type {WMSCapabilitiesLoaderOptions} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {ImageType} from '@loaders.gl/images';\n\nexport type {CreateImageServiceProps} from './lib/services/create-image-service';\nexport {createImageService} from './lib/services/create-image-service';\n\nexport type {ImageServiceType} from './services/create-image-source';\nexport {createImageSource} from './services/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/image-service';\nexport {ImageService} from './lib/services/image-service';\n\n// OGC Services\n\nexport {CSWService} from './services/ogc/csw-service';\nexport {WMSSource, WMSService} from './services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';\nexport {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';\n\n// LERC - Limited Error Raster Compression\n// TODO - restore once esbuild bundling issues have been resolved\n// export type {LERCData} from './lib/lerc/lerc-types';\n// export {LERCLoader} from './lerc-loader';\n\n/** @deprecated Use WMSCapabilitiesLoaderOptions */\nexport type {WMSCapabilitiesLoaderOptions as WMSLoaderOptions} from './wms-capabilities-loader';\n\n// TODO - restore once deck.gl has been udpated\nexport {ImageSource} from '@loaders.gl/loader-utils';\n"],"mappings":"SAOQA,qBAAqB;AAAA,SAGrBC,eAAe;AAAA,SAGfC,gBAAgB;AAAA,SAIhBC,cAAc;AAAA,SASdC,qBAAqB;AAAA,SAGrBC,oBAAoB,IAAIC,qBAAqB;AAAA,SAG7CC,yBAAyB,IAAIC,0BAA0B;AAAA,SAavDC,qBAAqB,IAAIC,sBAAsB;AAAA,SAM/CC,SAAS,IAAIC,UAAU;AAAA,SAOvBC,kBAAkB;AAAA,SAGlBC,iBAAiB;AAAA,SAKjBC,YAAY;AAAA,SAIZC,UAAU;AAAA,SACVC,SAAS,EAAEC,UAAU;AAAA,SAIrBC,iBAAiB,IAAIC,kBAAkB;AAAA,SACvCC,kBAAkB,IAAIC,mBAAmB;AAWjD,SAAQC,WAAW,QAAO,0BAA0B"}
@@ -1,5 +1,5 @@
1
1
  import * as Lerc from 'lerc';
2
- const VERSION = typeof "4.0.0-beta.2" !== 'undefined' ? "4.0.0-beta.2" : 'latest';
2
+ const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
3
3
  export const LERCLoader = {
4
4
  id: 'lerc',
5
5
  name: 'LERC',
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lerc-loader.js","names":["Lerc","VERSION","__VERSION__","LERCLoader","id","name","module","version","worker","extensions","mimeTypes","options","wms","parse","arrayBuffer","parseLERC","load","pixelBlock","decode","lerc"],"sources":["../src/lerc-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {LERCData} from './lib/parsers/lerc/lerc-types';\nimport * as Lerc from 'lerc';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type LERCLoaderOptions = LoaderOptions & {\n lerc?: {\n /**\tThe number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */\n inputOffset?: number;\n /**\tIt is recommended to use the returned mask instead of setting this value. */\n noDataValue?: number;\n /**\t(ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */\n returnInterleaved?: boolean;\n };\n};\n\n/**\n * Loader for the LERC raster format\n */\nexport const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions> = {\n id: 'lerc',\n name: 'LERC',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n // test: ?,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions) =>\n parseLERC(arrayBuffer, options)\n};\n\nasync function parseLERC(arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions): Promise<LERCData> {\n // Load the WASM library\n await Lerc.load();\n // Perform the decode\n const pixelBlock = Lerc.decode(arrayBuffer, options?.lerc);\n return pixelBlock;\n}\n"],"mappings":"AAIA,OAAO,KAAKA,IAAI,MAAM,MAAM;AAI5B,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAgB3E,OAAO,MAAMC,UAAgE,GAAG;EAC9EC,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,MAAM;EAEZC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;EAC7CC,SAAS,EAAE,CAAC,0BAA0B,CAAC;EAEvCC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA2B,KACjEI,SAAS,CAACD,WAAW,EAAEH,OAAO;AAClC,CAAC;AAED,eAAeI,SAASA,CAACD,WAAwB,EAAEH,OAA2B,EAAqB;EAEjG,MAAMX,IAAI,CAACgB,IAAI,CAAC,CAAC;EAEjB,MAAMC,UAAU,GAAGjB,IAAI,CAACkB,MAAM,CAACJ,WAAW,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ,IAAI,CAAC;EAC1D,OAAOF,UAAU;AACnB"}
@@ -1,5 +1,5 @@
1
1
  import { XMLLoader } from '@loaders.gl/xml';
2
- import { parseExceptionReport } from './parse-exception-report';
2
+ import { parseExceptionReport } from "./parse-exception-report.js";
3
3
  export function parseCSWCapabilities(text, options) {
4
4
  var _XMLLoader$parseTextS;
5
5
  const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-csw-capabilities.js","names":["XMLLoader","parseExceptionReport","parseCSWCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","capabilities"],"sources":["../../../../src/lib/parsers/csw/parse-csw-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n// CSW:GetCapabilitiesResponse\n\n/** All capabilities of a CSW service - response to a CSW `GetCapabilities` data structure extracted from XML */\nexport type CSWCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWCapabilities(text: string, options?: XMLLoaderOptions): CSWCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlCapabilities: any = parsedXML.capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAGA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAoF5B,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAA0B,EAAmB;EAAA,IAAAC,qBAAA;EAC9F,MAAMC,SAAS,IAAAD,qBAAA,GAAGL,SAAS,CAACO,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAR,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVK,GAAG,EAAE;MACH,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EACF,CAAC,CAAC;EAEFV,oBAAoB,CAACK,SAAS,CAAC;EAE/B,MAAMM,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
@@ -1,5 +1,5 @@
1
1
  import { XMLLoader } from '@loaders.gl/xml';
2
- import { parseExceptionReport } from './parse-exception-report';
2
+ import { parseExceptionReport } from "./parse-exception-report.js";
3
3
  export function parseCSWDomain(text, options) {
4
4
  var _XMLLoader$parseTextS;
5
5
  const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-csw-domain.js","names":["XMLLoader","parseExceptionReport","parseCSWDomain","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","arrayPaths","xmlDomain","getDomainResponse","domainValue","domainValues","_domainValue$listOfVa","values","listOfValues","value"],"sources":["../../../../src/lib/parsers/csw/parse-csw-domain.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n/** Describes the values of resource */\nexport type CSWDomain = {\n domainValues: {\n type: string;\n propertyName: string;\n values: {\n [key: string]: unknown;\n }[];\n }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWDomain(text: string, options?: XMLLoaderOptions): CSWDomain {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true,\n arrayPaths: [\n 'GetDomainResponse.DomainValues',\n 'GetDomainResponse.DomainValues.ListOfValues.value'\n ]\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlDomain: any = parsedXML.getDomainResponse;\n for (const domainValue of xmlDomain.domainValues) {\n // Drop the nested <listOfValues><value><value><listOfValues> => values[]\n domainValue.values = domainValue.listOfValues?.value;\n delete domainValue.listOfValues;\n }\n return xmlDomain as CSWDomain;\n}\n"],"mappings":"AAGA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAiB5B,OAAO,SAASC,cAAcA,CAACC,IAAY,EAAEC,OAA0B,EAAa;EAAA,IAAAC,qBAAA;EAClF,MAAMC,SAAS,IAAAD,qBAAA,GAAGL,SAAS,CAACO,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAR,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVK,GAAG,EAAE;MACH,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE,IAAI;MACtBC,UAAU,EAAE,CACV,gCAAgC,EAChC,mDAAmD;IAEvD;EACF,CAAC,CAAC;EAEFX,oBAAoB,CAACK,SAAS,CAAC;EAE/B,MAAMO,SAAc,GAAGP,SAAS,CAACQ,iBAAiB;EAClD,KAAK,MAAMC,WAAW,IAAIF,SAAS,CAACG,YAAY,EAAE;IAAA,IAAAC,qBAAA;IAEhDF,WAAW,CAACG,MAAM,IAAAD,qBAAA,GAAGF,WAAW,CAACI,YAAY,cAAAF,qBAAA,uBAAxBA,qBAAA,CAA0BG,KAAK;IACpD,OAAOL,WAAW,CAACI,YAAY;EACjC;EACA,OAAON,SAAS;AAClB"}
@@ -1,6 +1,6 @@
1
1
  import { convertXMLFieldToArrayInPlace } from '@loaders.gl/xml';
2
2
  import { XMLLoader } from '@loaders.gl/xml';
3
- import { parseExceptionReport } from './parse-exception-report';
3
+ import { parseExceptionReport } from "./parse-exception-report.js";
4
4
  export function parseCSWRecords(text, options) {
5
5
  var _XMLLoader$parseTextS, _options$xml;
6
6
  const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
@@ -19,7 +19,7 @@ export function parseCSWRecords(text, options) {
19
19
  parseExceptionReport(parsedXML);
20
20
  const xmlRecords = parsedXML.getRecordsResponse;
21
21
  const elementSet = xmlRecords.searchResults.elementSet;
22
- const recordsFieldName = "".concat(elementSet, "Record");
22
+ const recordsFieldName = `${elementSet}Record`;
23
23
  xmlRecords.records = xmlRecords.searchResults[recordsFieldName];
24
24
  delete xmlRecords.searchResults[recordsFieldName];
25
25
  convertXMLFieldToArrayInPlace(xmlRecords, 'records');
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-csw-records.js","names":["convertXMLFieldToArrayInPlace","XMLLoader","parseExceptionReport","parseCSWRecords","text","options","_XMLLoader$parseTextS","_options$xml","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","arrayPaths","_fastXML","parseAttributeValue","xmlRecords","getRecordsResponse","elementSet","searchResults","recordsFieldName","records","record","boundingBoxes","boundingBox","value","upperCorner","lowerCorner","renameXMLTags","renameKeys","oldKey","newKey","Object","entries"],"sources":["../../../../src/lib/parsers/csw/parse-csw-records.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoaderOptions, convertXMLFieldToArrayInPlace} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\nexport type CSWRecords = {\n searchStatus: {\n timestamp?: string;\n };\n searchResults: {\n numberOfRecordsMatched: number;\n numberOfRecordsReturned: number;\n elementSet: string;\n nextRecord: number;\n };\n records: {\n type: string;\n title: string;\n abstract: string;\n subject: string[];\n boundingBoxes: {\n crs: string;\n value: [number, number, number, number];\n }[];\n references: {\n value: string;\n scheme: string;\n }[];\n }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetRecords` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWRecords(text: string, options?: XMLLoaderOptions): CSWRecords {\n const parsedXML = XMLLoader.parseTextSync?.(text, {\n ...options,\n xml: {\n ...options?.xml,\n removeNSPrefix: true,\n uncapitalizeKeys: true,\n arrayPaths: [],\n _fastXML: {\n ...options?.xml?._fastXML,\n parseAttributeValue: true\n }\n }\n });\n\n parseExceptionReport(parsedXML);\n\n const xmlRecords: any = parsedXML.getRecordsResponse;\n\n // Move results to top\n const elementSet = xmlRecords.searchResults.elementSet;\n const recordsFieldName = `${elementSet}Record`;\n xmlRecords.records = xmlRecords.searchResults[recordsFieldName];\n delete xmlRecords.searchResults[recordsFieldName];\n\n convertXMLFieldToArrayInPlace(xmlRecords, 'records');\n\n for (const record of xmlRecords.records) {\n record.boundingBoxes = record.boundingBox;\n delete record.boundingBox;\n\n convertXMLFieldToArrayInPlace(record, 'boundingBoxes');\n\n for (const boundingBox of record.boundingBoxes) {\n boundingBox.value = [\n boundingBox.upperCorner[0],\n boundingBox.upperCorner[1],\n boundingBox.lowerCorner[0],\n boundingBox.lowerCorner[1]\n ];\n delete boundingBox.upperCorner;\n delete boundingBox.lowerCorner;\n }\n }\n\n return xmlRecords as CSWRecords;\n}\n\nexport function renameXMLTags(xml: any, renameKeys: Record<string, string>): void {\n for (const [oldKey, newKey] of Object.entries(renameKeys)) {\n xml[newKey] = xml[oldKey];\n delete xml[oldKey];\n }\n}\n"],"mappings":"AAEA,SAA0BA,6BAA6B,QAAO,iBAAiB;AAC/E,SAAQC,SAAS,QAAO,iBAAiB;AAAC,SAClCC,oBAAoB;AAgC5B,OAAO,SAASC,eAAeA,CAACC,IAAY,EAAEC,OAA0B,EAAc;EAAA,IAAAC,qBAAA,EAAAC,YAAA;EACpF,MAAMC,SAAS,IAAAF,qBAAA,GAAGL,SAAS,CAACQ,aAAa,cAAAH,qBAAA,uBAAvBA,qBAAA,CAAAI,IAAA,CAAAT,SAAS,EAAiBG,IAAI,EAAE;IAChD,GAAGC,OAAO;IACVM,GAAG,EAAE;MACH,IAAGN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE,IAAI;MACtBC,UAAU,EAAE,EAAE;MACdC,QAAQ,EAAE;QACR,IAAGV,OAAO,aAAPA,OAAO,wBAAAE,YAAA,GAAPF,OAAO,CAAEM,GAAG,cAAAJ,YAAA,uBAAZA,YAAA,CAAcQ,QAAQ;QACzBC,mBAAmB,EAAE;MACvB;IACF;EACF,CAAC,CAAC;EAEFd,oBAAoB,CAACM,SAAS,CAAC;EAE/B,MAAMS,UAAe,GAAGT,SAAS,CAACU,kBAAkB;EAGpD,MAAMC,UAAU,GAAGF,UAAU,CAACG,aAAa,CAACD,UAAU;EACtD,MAAME,gBAAgB,GAAI,GAAEF,UAAW,QAAO;EAC9CF,UAAU,CAACK,OAAO,GAAGL,UAAU,CAACG,aAAa,CAACC,gBAAgB,CAAC;EAC/D,OAAOJ,UAAU,CAACG,aAAa,CAACC,gBAAgB,CAAC;EAEjDrB,6BAA6B,CAACiB,UAAU,EAAE,SAAS,CAAC;EAEpD,KAAK,MAAMM,MAAM,IAAIN,UAAU,CAACK,OAAO,EAAE;IACvCC,MAAM,CAACC,aAAa,GAAGD,MAAM,CAACE,WAAW;IACzC,OAAOF,MAAM,CAACE,WAAW;IAEzBzB,6BAA6B,CAACuB,MAAM,EAAE,eAAe,CAAC;IAEtD,KAAK,MAAME,WAAW,IAAIF,MAAM,CAACC,aAAa,EAAE;MAC9CC,WAAW,CAACC,KAAK,GAAG,CAClBD,WAAW,CAACE,WAAW,CAAC,CAAC,CAAC,EAC1BF,WAAW,CAACE,WAAW,CAAC,CAAC,CAAC,EAC1BF,WAAW,CAACG,WAAW,CAAC,CAAC,CAAC,EAC1BH,WAAW,CAACG,WAAW,CAAC,CAAC,CAAC,CAC3B;MACD,OAAOH,WAAW,CAACE,WAAW;MAC9B,OAAOF,WAAW,CAACG,WAAW;IAChC;EACF;EAEA,OAAOX,UAAU;AACnB;AAEA,OAAO,SAASY,aAAaA,CAAClB,GAAQ,EAAEmB,UAAkC,EAAQ;EAChF,KAAK,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACJ,UAAU,CAAC,EAAE;IACzDnB,GAAG,CAACqB,MAAM,CAAC,GAAGrB,GAAG,CAACoB,MAAM,CAAC;IACzB,OAAOpB,GAAG,CAACoB,MAAM,CAAC;EACpB;AACF"}
@@ -5,6 +5,6 @@ export function parseExceptionReport(parsedXML) {
5
5
  return;
6
6
  }
7
7
  const errorMessage = ((_exceptionReport$exce = exceptionReport.exception) === null || _exceptionReport$exce === void 0 ? void 0 : _exceptionReport$exce.exceptionText) || ((_exceptionReport$exce2 = exceptionReport.exception) === null || _exceptionReport$exce2 === void 0 ? void 0 : _exceptionReport$exce2.exceptionCode) || ((_exceptionReport$exce3 = exceptionReport.exception) === null || _exceptionReport$exce3 === void 0 ? void 0 : _exceptionReport$exce3.locator) || 'server error';
8
- throw new Error("Catalog Server: ".concat(errorMessage));
8
+ throw new Error(`Catalog Server: ${errorMessage}`);
9
9
  }
10
10
  //# sourceMappingURL=parse-exception-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-exception-report.js","names":["parseExceptionReport","parsedXML","_exceptionReport$exce","_exceptionReport$exce2","_exceptionReport$exce3","exceptionReport","errorMessage","exception","exceptionText","exceptionCode","locator","Error"],"sources":["../../../../src/lib/parsers/csw/parse-exception-report.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// import type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseExceptionReport(parsedXML: any): void {\n // const parsedXML = XMLLoader.parseTextSync?.(text, {\n // ...options,\n // xml: {\n // ...options?.xml,\n // removeNSPrefix: true,\n // uncapitalizeKeys: true\n // }\n // });\n\n const exceptionReport: any = parsedXML.exceptionReport;\n if (!exceptionReport) {\n return;\n }\n const errorMessage =\n exceptionReport.exception?.exceptionText ||\n exceptionReport.exception?.exceptionCode ||\n exceptionReport.exception?.locator ||\n 'server error';\n\n throw new Error(`Catalog Server: ${errorMessage}`);\n}\n"],"mappings":"AASA,OAAO,SAASA,oBAAoBA,CAACC,SAAc,EAAQ;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAUzD,MAAMC,eAAoB,GAAGJ,SAAS,CAACI,eAAe;EACtD,IAAI,CAACA,eAAe,EAAE;IACpB;EACF;EACA,MAAMC,YAAY,GAChB,EAAAJ,qBAAA,GAAAG,eAAe,CAACE,SAAS,cAAAL,qBAAA,uBAAzBA,qBAAA,CAA2BM,aAAa,OAAAL,sBAAA,GACxCE,eAAe,CAACE,SAAS,cAAAJ,sBAAA,uBAAzBA,sBAAA,CAA2BM,aAAa,OAAAL,sBAAA,GACxCC,eAAe,CAACE,SAAS,cAAAH,sBAAA,uBAAzBA,sBAAA,CAA2BM,OAAO,KAClC,cAAc;EAEhB,MAAM,IAAIC,KAAK,CAAE,mBAAkBL,YAAa,EAAC,CAAC;AACpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-strict-equal.js","names":["deepStrictEqual","actual","expected","strict","Date","getTime","RegExp","source","global","multiline","lastIndex","ignoreCase","objEquiv","pSlice","Array","prototype","slice","isPrimitive","arg","isArguments","object","Object","toString","call","a","b","undefined","getPrototypeOf","aIsArgs","bIsArgs","ka","keys","kb","key","i","length","sort"],"sources":["../../../../src/lib/parsers/gml/deep-strict-equal.ts"],"sourcesContent":["// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** @todo replace this ridiculous choice of deepStrictEqual */\n// eslint-disable-next-line complexity\nexport function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n // } else if (actual instanceof Buffer && expected instanceof Buffer) {\n // return compare(actual, expected) === 0;\n\n // // 7.2. If the expected value is a Date object, the actual value is\n // // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (actual instanceof RegExp && expected instanceof RegExp) {\n return (\n actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase\n );\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (\n (actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')\n ) {\n // eslint-disable-next-line eqeqeq\n return strict ? actual === expected : actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n }\n return objEquiv(actual, expected, strict);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst pSlice = Array.prototype.slice;\n\nfunction isPrimitive(arg) {\n return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');\n}\n\nfunction isArguments(object) {\n // eslint-disable-next-line eqeqeq\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\n// eslint-disable-next-line complexity\nfunction objEquiv(a: unknown, b: unknown, strict) {\n if (a === null || a === undefined || b === null || b === undefined) return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b)) return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n const aIsArgs = isArguments(a);\n const bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepStrictEqual(a, b, strict);\n }\n const ka = Object.keys(a);\n const kb = Object.keys(b);\n let key;\n let i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length) return false;\n // the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n // ~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i]) return false;\n }\n // equivalent values for every corresponding key, and\n // ~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepStrictEqual(a[key], b[key], strict)) return false;\n }\n return true;\n}\n"],"mappings":"AA4BA,OAAO,SAASA,eAAeA,CAACC,MAAe,EAAEC,QAAiB,EAAEC,MAAgB,EAAE;EAEpF,IAAIF,MAAM,KAAKC,QAAQ,EAAE;IACvB,OAAO,IAAI;EAMb,CAAC,MAAM,IAAID,MAAM,YAAYG,IAAI,IAAIF,QAAQ,YAAYE,IAAI,EAAE;IAC7D,OAAOH,MAAM,CAACI,OAAO,CAAC,CAAC,KAAKH,QAAQ,CAACG,OAAO,CAAC,CAAC;EAKhD,CAAC,MAAM,IAAIJ,MAAM,YAAYK,MAAM,IAAIJ,QAAQ,YAAYI,MAAM,EAAE;IACjE,OACEL,MAAM,CAACM,MAAM,KAAKL,QAAQ,CAACK,MAAM,IACjCN,MAAM,CAACO,MAAM,KAAKN,QAAQ,CAACM,MAAM,IACjCP,MAAM,CAACQ,SAAS,KAAKP,QAAQ,CAACO,SAAS,IACvCR,MAAM,CAACS,SAAS,KAAKR,QAAQ,CAACQ,SAAS,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AO,IAAI,CAACC,OAAO,IAAM,CAACD,OAAO,IAAIC,OAAQ,EAAE,OAAO,KAAK;EAChE,IAAID,OAAO,EAAE;IACXJ,CAAC,GAAGX,MAAM,CAACU,IAAI,CAACC,CAAC,CAAC;IAClBC,CAAC,GAAGZ,MAAM,CAACU,IAAI,CAACE,CAAC,CAAC;IAClB,OAAOzB,eAAe,CAACwB,CAAC,EAAEC,CAAC,EAAEtB,MAAM,CAAC;EACtC;EACA,MAAM2B,EAAE,GAAGT,MAAM,CAACU,IAAI,CAACP,CAAC,CAAC;EACzB,MAAMQ,EAAE,GAAGX,MAAM,CAACU,IAAI,CAACN,CAAC,CAAC;EACzB,IAAIQ,GAAG;EACP,IAAIC,CAAC;EAGL,IAAIJ,EAAE,CAACK,MAAM,KAAKH,EAAE,CAACG,MAAM,EAAE,OAAO,KAAK;EAEzCL,EAAE,CAACM,IAAI,CAAC,CAAC;EACTJ,EAAE,CAACI,IAAI,CAAC,CAAC;EAET,KAAKF,CAAC,GAAGJ,EAAE,CAACK,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;IACnC,IAAIJ,EAAE,CAACI,CAAC,CAAC,KAAKF,EAAE,CAACE,CAAC,CAAC,EAAE,OAAO,KAAK;EACnC;EAGA,KAAKA,CAAC,GAAGJ,EAAE,CAACK,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;IACnCD,GAAG,GAAGH,EAAE,CAACI,CAAC,CAAC;IACX,IAAI,CAAClC,eAAe,CAACwB,CAAC,CAACS,GAAG,CAAC,EAAER,CAAC,CAACQ,GAAG,CAAC,EAAE9B,MAAM,CAAC,EAAE,OAAO,KAAK;EAC5D;EACA,OAAO,IAAI;AACb"}
@@ -1,5 +1,5 @@
1
1
  import { XMLLoader } from '@loaders.gl/xml';
2
- import { deepStrictEqual } from './deep-strict-equal';
2
+ import { deepStrictEqual } from "./deep-strict-equal.js";
3
3
  import rewind from '@turf/rewind';
4
4
  function noTransform() {
5
5
  for (var _len = arguments.length, coords = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -59,7 +59,7 @@ function parseCoords(s, options, context) {
59
59
  const stride = context.srsDimension || options.stride || 2;
60
60
  const coords = s.replace(/\s+/g, ' ').trim().split(' ');
61
61
  if (coords.length === 0 || coords.length % stride !== 0) {
62
- throw new Error("invalid coordinates list (stride ".concat(stride, ")"));
62
+ throw new Error(`invalid coordinates list (stride ${stride})`);
63
63
  }
64
64
  const points = [];
65
65
  for (let i = 0; i < coords.length - 1; i += stride) {
@@ -118,7 +118,7 @@ export function parseLinearRingOrLineString(xml, options, context) {
118
118
  }
119
119
  }
120
120
  if (points.length === 0) {
121
- throw new Error("".concat(xml.name, " must have > 0 points"));
121
+ throw new Error(`${xml.name} must have > 0 points`);
122
122
  }
123
123
  return points;
124
124
  }
@@ -157,7 +157,7 @@ export function parseRing(xml, options, context) {
157
157
  } else {
158
158
  const segments = findIn(childXML, 'gml:Curve', 'gml:segments');
159
159
  if (!segments) {
160
- throw new Error("invalid ".concat(childName, " element"));
160
+ throw new Error(`invalid ${childName} element`);
161
161
  }
162
162
  points2 = parseCurveSegments(segments, options, childContext);
163
163
  }
@@ -171,7 +171,7 @@ export function parseRing(xml, options, context) {
171
171
  }
172
172
  }
173
173
  if (points.length < 4) {
174
- throw new Error("".concat(xml.name, " must have >= 4 points"));
174
+ throw new Error(`${xml.name} must have >= 4 points`);
175
175
  }
176
176
  return points;
177
177
  }
@@ -182,7 +182,7 @@ export function parseExteriorOrInterior(xml, options, context) {
182
182
  }
183
183
  const ring = findIn(xml, 'gml:Ring');
184
184
  if (!ring) {
185
- throw new Error("invalid ".concat(xml.name, " element"));
185
+ throw new Error(`invalid ${xml.name} element`);
186
186
  }
187
187
  return parseRing(ring, options, context);
188
188
  }
@@ -190,7 +190,7 @@ export function parsePolygonOrRectangle(xml, options, context) {
190
190
  const childContext = createChildContext(xml, options, context);
191
191
  const exterior = findIn(xml, 'gml:exterior');
192
192
  if (!exterior) {
193
- throw new Error("invalid ".concat(xml.name, " element"));
193
+ throw new Error(`invalid ${xml.name} element`);
194
194
  }
195
195
  const pointLists = [parseExteriorOrInterior(exterior, options, childContext)];
196
196
  for (const [childName, childXML] of Object.entries(xml)) {
@@ -206,7 +206,7 @@ export function parseSurface(xml, options, context) {
206
206
  const childContext = createChildContext(xml, options, context);
207
207
  const patches = findIn(xml, 'gml:patches');
208
208
  if (!patches) {
209
- throw new Error("invalid ".concat(xml.name, " element"));
209
+ throw new Error(`invalid ${xml.name} element`);
210
210
  }
211
211
  const polygons = [];
212
212
  for (const [childName, childXML] of Object.entries(xml)) {
@@ -220,7 +220,7 @@ export function parseSurface(xml, options, context) {
220
220
  }
221
221
  }
222
222
  if (polygons.length === 0) {
223
- throw new Error("".concat(xml.name, " must have > 0 polygons"));
223
+ throw new Error(`${xml.name} must have > 0 polygons`);
224
224
  }
225
225
  return polygons;
226
226
  }
@@ -244,7 +244,7 @@ export function parseCompositeSurface(xml, options, context) {
244
244
  }
245
245
  }
246
246
  if (polygons.length === 0) {
247
- throw new Error("".concat(xml.name, " must have > 0 polygons"));
247
+ throw new Error(`${xml.name} must have > 0 polygons`);
248
248
  }
249
249
  return polygons;
250
250
  }
@@ -275,7 +275,7 @@ export function parseMultiSurface(xml, options, context) {
275
275
  }
276
276
  }
277
277
  if (polygons.length === 0) {
278
- throw new Error("".concat(xml.name, " must have > 0 polygons"));
278
+ throw new Error(`${xml.name} must have > 0 polygons`);
279
279
  }
280
280
  return polygons;
281
281
  }
@@ -289,7 +289,7 @@ function parseSurfaceMember(xml, options, context) {
289
289
  case 'gml:Polygon':
290
290
  return [parsePolygonOrRectangle(childXml, options, context)];
291
291
  }
292
- throw new Error("".concat(childName, " must have polygons"));
292
+ throw new Error(`${childName} must have polygons`);
293
293
  }
294
294
  function textOf(el) {
295
295
  if (typeof el !== 'string') {
@@ -324,7 +324,7 @@ function createChildContext(xml, options, context) {
324
324
  if (srsDimensionAttribute) {
325
325
  const srsDimension = parseInt(srsDimensionAttribute);
326
326
  if (Number.isNaN(srsDimension) || srsDimension <= 0) {
327
- throw new Error("invalid srsDimension attribute value \"".concat(srsDimensionAttribute, "\", expected a positive integer"));
327
+ throw new Error(`invalid srsDimension attribute value "${srsDimensionAttribute}", expected a positive integer`);
328
328
  }
329
329
  const childContext = Object.create(context);
330
330
  childContext.srsDimension = srsDimension;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-gml.js","names":["XMLLoader","deepStrictEqual","rewind","noTransform","_len","arguments","length","coords","Array","_key","parseGML","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","transformCoords","stride","context","createChildContext","parseGMLToGeometry","inputXML","childContext","geometry","name","xml","getFirstKeyValue","type","coordinates","parseLinearRingOrLineString","parsePolygonOrRectangle","parseSurface","parseMultiSurface","mutate","parseCoords","s","srsDimension","replace","trim","split","Error","points","i","_options$transformCoo","point","slice","map","parseFloat","push","parsePosList","textOf","parsePos","parsePoint","pos","findIn","posList","childName","childXML","Object","entries","parseCurveSegments","points2","end","start","shift","parseRing","lineString","segments","parseExteriorOrInterior","linearRing","ring","exterior","pointLists","patches","polygons","parseCompositeSurface","c2Name","c2Xml","el","surfaceMembers","polygons2","polygons3","parseSurfaceMember","polygonXML","surfaceMemberXML","childXml","root","_len2","tags","_key2","tag","child","object","key","value","srsDimensionAttribute","attributes","parseInt","Number","isNaN","create"],"sources":["../../../../src/lib/parsers/gml/parse-gml.ts"],"sourcesContent":["// loaders.gl, 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 {Geometry};\n\nexport type ParseGMLOptions = {\n transformCoords?: Function;\n stride?: 2 | 3 | 4;\n};\n\nexport type ParseGMLContext = {\n srsDimension?: number;\n [key: string]: any;\n};\n\n/**\n * Parses a typed data structure from raw XML for GML features\n * @note Error handlings is fairly weak\n */\nexport function parseGML(text: string, options) {\n // GeoJSON | null {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n\n options = {transformCoords: noTransform, stride: 2, ...options};\n const context = createChildContext(parsedXML, options, {});\n\n return parseGMLToGeometry(parsedXML, options, context);\n}\n\n/** Parse a GeoJSON geometry from GML XML */\nexport function parseGMLToGeometry(\n inputXML: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Geometry | null {\n const childContext = createChildContext(inputXML, options, context);\n\n let geometry: Geometry | null = null;\n\n const [name, xml] = getFirstKeyValue(inputXML);\n\n switch (name) {\n // case 'gml:MultiPoint':\n // geometry = {\n // type: 'MultiPoint',\n // coordinates: parseMultiPoint(xml, options, childContext)\n // };\n // break;\n\n case 'gml:LineString':\n geometry = {\n type: 'LineString',\n coordinates: parseLinearRingOrLineString(xml, options, childContext)\n };\n break;\n\n // case 'gml:MultiLineString':\n // geometry = {\n // type: 'MultiLineString',\n // coordinates: parseMultiLineString(xml, options, childContext)\n // };\n // break;\n\n case 'gml:Polygon':\n case 'gml:Rectangle':\n geometry = {\n type: 'Polygon',\n coordinates: parsePolygonOrRectangle(xml, options, childContext)\n };\n break;\n case 'gml:Surface':\n geometry = {\n type: 'MultiPolygon',\n coordinates: parseSurface(xml, options, childContext)\n };\n break;\n case 'gml:MultiSurface':\n geometry = {\n type: 'MultiPolygon',\n coordinates: parseMultiSurface(xml, options, childContext)\n };\n break;\n\n default:\n return null;\n }\n\n // todo\n return rewind(geometry, {mutate: true});\n}\n\n/** Parse a list of coordinates from a string */\nfunction parseCoords(s: string, options: ParseGMLOptions, context: ParseGMLContext): Position[] {\n const stride = context.srsDimension || options.stride || 2;\n\n // Handle white space\n const coords = s.replace(/\\s+/g, ' ').trim().split(' ');\n\n if (coords.length === 0 || coords.length % stride !== 0) {\n throw new Error(`invalid coordinates list (stride ${stride})`);\n }\n\n const points: Position[] = [];\n for (let i = 0; i < coords.length - 1; i += stride) {\n const point = coords.slice(i, i + stride).map(parseFloat);\n points.push(options.transformCoords?.(...point) || point);\n }\n\n return points;\n}\n\nexport function parsePosList(xml: any, options: ParseGMLOptions, context: ParseGMLContext) {\n const childContext = createChildContext(xml, options, context);\n\n const coords = textOf(xml);\n if (!coords) {\n throw new Error('invalid gml:posList element');\n }\n\n return parseCoords(coords, options, childContext);\n}\n\nexport function parsePos(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position {\n const childContext = createChildContext(xml, options, context);\n\n const coords = textOf(xml);\n if (!coords) {\n throw new Error('invalid gml:pos element');\n }\n\n const points = parseCoords(coords, options, childContext);\n if (points.length !== 1) {\n throw new Error('gml:pos must have 1 point');\n }\n return points[0];\n}\n\nexport function parsePoint(xml: any, options: ParseGMLOptions, context: ParseGMLContext): number[] {\n const childContext = createChildContext(xml, options, context);\n\n // TODO AV: Parse other gml:Point options\n const pos = findIn(xml, 'gml:pos');\n if (!pos) {\n throw new Error('invalid gml:Point element, expected a gml:pos subelement');\n }\n return parsePos(pos, options, childContext);\n}\n\nexport function parseLinearRingOrLineString(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n // or a LineStringSegment\n const childContext = createChildContext(xml, options, context);\n\n let points: Position[] = [];\n\n const posList = findIn(xml, 'gml:posList');\n if (posList) {\n points = parsePosList(posList, options, childContext);\n } else {\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:Point':\n points.push(parsePoint(childXML, options, childContext));\n break;\n case 'gml:pos':\n points.push(parsePos(childXML, options, childContext));\n break;\n default:\n continue;\n }\n }\n }\n\n if (points.length === 0) {\n throw new Error(`${xml.name} must have > 0 points`);\n }\n return points;\n}\n\nexport function parseCurveSegments(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const points: Position[] = [];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:LineStringSegment':\n const points2 = parseLinearRingOrLineString(childXML, options, context);\n\n // remove overlapping\n const end = points[points.length - 1];\n const start = points2[0];\n if (end && start && deepStrictEqual(end, start)) {\n points2.shift();\n }\n\n points.push(...points2);\n break;\n default:\n continue;\n }\n }\n\n if (points.length === 0) {\n throw new Error('gml:Curve > gml:segments must have > 0 points');\n }\n return points;\n}\n\nexport function parseRing(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const childContext = createChildContext(xml, options, context);\n\n const points: Position[] = [];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:curveMember':\n let points2;\n\n const lineString = findIn(childXML, 'gml:LineString');\n if (lineString) {\n points2 = parseLinearRingOrLineString(lineString, options, childContext);\n } else {\n const segments = findIn(childXML, 'gml:Curve', 'gml:segments');\n if (!segments) {\n throw new Error(`invalid ${childName} element`);\n }\n\n points2 = parseCurveSegments(segments, options, childContext);\n }\n\n // remove overlapping\n const end = points[points.length - 1];\n const start = points2[0];\n if (end && start && deepStrictEqual(end, start)) {\n points2.shift();\n }\n\n points.push(...points2);\n\n break;\n }\n }\n\n if (points.length < 4) {\n throw new Error(`${xml.name} must have >= 4 points`);\n }\n return points;\n}\n\nexport function parseExteriorOrInterior(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[] {\n const linearRing = findIn(xml, 'gml:LinearRing');\n if (linearRing) {\n return parseLinearRingOrLineString(linearRing, options, context);\n }\n\n const ring = findIn(xml, 'gml:Ring');\n if (!ring) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n return parseRing(ring, options, context);\n}\n\nexport function parsePolygonOrRectangle(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][] {\n // or PolygonPatch\n const childContext = createChildContext(xml, options, context);\n\n const exterior = findIn(xml, 'gml:exterior');\n if (!exterior) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n const pointLists: Position[][] = [parseExteriorOrInterior(exterior, options, childContext)];\n\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:interior':\n pointLists.push(parseExteriorOrInterior(childXML, options, childContext));\n break;\n }\n }\n\n return pointLists;\n}\n\nexport function parseSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const childContext = createChildContext(xml, options, context);\n\n const patches = findIn(xml, 'gml:patches');\n if (!patches) {\n throw new Error(`invalid ${xml.name} element`);\n }\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:PolygonPatch':\n case 'gml:Rectangle':\n polygons.push(parsePolygonOrRectangle(childXML, options, childContext));\n break;\n\n default:\n continue;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n\n return polygons;\n}\n\nexport function parseCompositeSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const childContext = createChildContext(xml, options, context);\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(xml)) {\n switch (childName) {\n case 'gml:surfaceMember':\n case 'gml:surfaceMembers':\n const [c2Name, c2Xml] = getFirstKeyValue(childXML);\n switch (c2Name) {\n case 'gml:Surface':\n polygons.push(...parseSurface(c2Xml, options, childContext));\n break;\n case 'gml:Polygon':\n polygons.push(parsePolygonOrRectangle(c2Xml, options, childContext));\n break;\n }\n break;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n return polygons;\n}\n\nexport function parseMultiSurface(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n let el = xml;\n\n const surfaceMembers = findIn(xml, 'gml:LinearRing');\n if (surfaceMembers) {\n el = surfaceMembers;\n }\n\n const polygons: Position[][][] = [];\n for (const [childName, childXML] of Object.entries(el)) {\n switch (childName) {\n case 'gml:Surface':\n const polygons2 = parseSurface(childXML, options, context);\n polygons.push(...polygons2);\n break;\n case 'gml:surfaceMember':\n const polygons3 = parseSurfaceMember(childXML, options, context);\n polygons.push(...polygons3);\n break;\n\n case 'gml:surfaceMembers':\n const polygonXML = findIn(childXML, 'gml:Polygon');\n for (const surfaceMemberXML of polygonXML as []) {\n const polygons3 = parseSurfaceMember(surfaceMemberXML, options, context);\n polygons.push(...polygons3);\n }\n break;\n }\n }\n\n if (polygons.length === 0) {\n throw new Error(`${xml.name} must have > 0 polygons`);\n }\n\n return polygons;\n}\n\nfunction parseSurfaceMember(\n xml: any,\n options: ParseGMLOptions,\n context: ParseGMLContext\n): Position[][][] {\n const [childName, childXml] = getFirstKeyValue(xml);\n switch (childName) {\n case 'gml:CompositeSurface':\n return parseCompositeSurface(childXml, options, context);\n case 'gml:Surface':\n return parseSurface(childXml, options, context);\n case 'gml:Polygon':\n return [parsePolygonOrRectangle(childXml, options, context)];\n }\n throw new Error(`${childName} must have polygons`);\n}\n\n// Helpers\n\nfunction textOf(el: any): string {\n if (typeof el !== 'string') {\n throw new Error('expected string');\n }\n return el;\n}\n\nfunction findIn(root: any, ...tags: string[]): any {\n let el = root;\n for (const tag of tags) {\n const child = el[tag];\n if (!child) {\n return null;\n }\n el = child;\n }\n return el;\n}\n\n/** @returns the first [key, value] pair in an object, or ['', null] if empty object */\nfunction getFirstKeyValue(object: any): [string, any] {\n if (object && typeof object === 'object') {\n for (const [key, value] of Object.entries(object)) {\n return [key, value];\n }\n }\n return ['', null];\n}\n\n/** A bit heavyweight for just tracking dimension? */\nfunction createChildContext(xml, options, context): ParseGMLContext {\n const srsDimensionAttribute = xml.attributes && xml.attributes.srsDimension;\n\n if (srsDimensionAttribute) {\n const srsDimension = parseInt(srsDimensionAttribute);\n if (Number.isNaN(srsDimension) || srsDimension <= 0) {\n throw new Error(\n `invalid srsDimension attribute value \"${srsDimensionAttribute}\", expected a positive integer`\n );\n }\n\n const childContext = Object.create(context);\n childContext.srsDimension = srsDimension;\n return childContext;\n }\n\n return context;\n}\n"],"mappings":"AAuBA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAClCC,eAAe;AACvB,OAAOC,MAAM,MAAM,cAAc;AAEjC,SAASC,WAAWA,CAAA,EAAY;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAARC,MAAM,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAANF,MAAM,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;EAAA;EAC5B,OAAOF,MAAM;AACf;AAkBA,OAAO,SAASG,QAAQA,CAACC,IAAY,EAAEC,OAAO,EAAE;EAAA,IAAAC,qBAAA;EAE9C,MAAMC,SAAS,IAAAD,qBAAA,GAAGb,SAAS,CAACe,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAhB,SAAS,EAAiBW,IAAI,EAAEC,OAAO,CAAC;EAE1DA,OAAO,GAAG;IAACK,eAAe,EAAEd,WAAW;IAAEe,MAAM,EAAE,CAAC;IAAE,GAAGN;EAAO,CAAC;EAC/D,MAAMO,OAAO,GAAGC,kBAAkB,CAACN,SAAS,EAAEF,OAAO,EAAE,CAAC,CAAC,CAAC;EAE1D,OAAOS,kBAAkB,CAACP,SAAS,EAAEF,OAAO,EAAEO,OAAO,CAAC;AACxD;AAGA,OAAO,SAASE,kBAAkBA,CAChCC,QAAa,EACbV,OAAwB,EACxBO,OAAwB,EACP;EACjB,MAAMI,YAAY,GAAGH,kBAAkB,CAACE,QAAQ,EAAEV,OAAO,EAAEO,OAAO,CAAC;EAEnE,IAAIK,QAAyB,GAAG,IAAI;EAEpC,MAAM,CAACC,IAAI,EAAEC,GAAG,CAAC,G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,IAAI,EAAE;IACtB,MAAMG,KAAK,GAAGb,EAAE,CAACY,GAAG,CAAC;IACrB,IAAI,CAACC,KAAK,EAAE;MACV,OAAO,IAAI;IACb;IACAb,EAAE,GAAGa,KAAK;EACZ;EACA,OAAOb,EAAE;AACX;AAGA,SAASpD,gBAAgBA,CAACkE,MAAW,EAAiB;EACpD,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIpC,MAAM,CAACC,OAAO,CAACiC,MAAM,CAAC,EAAE;MACjD,OAAO,CAACC,GAAG,EAAEC,KAAK,CAAC;IACrB;EACF;EACA,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC;AACnB;AAGA,SAAS3E,kBAAkBA,CAACM,GAAG,EAAEd,OAAO,EAAEO,OAAO,EAAmB;EAClE,MAAM6E,qBAAqB,GAAGtE,GAAG,CAACuE,UAAU,IAAIvE,GAAG,CAACuE,UAAU,CAAC5D,YAAY;EAE3E,IAAI2D,qBAAqB,EAAE;IACzB,MAAM3D,YAAY,GAAG6D,QAAQ,CAACF,qBAAqB,CAAC;IACpD,IAAIG,MAAM,CAACC,KAAK,CAAC/D,YAAY,CAAC,IAAIA,YAAY,IAAI,CAAC,EAAE;MACnD,MAAM,IAAII,KAAK,CACZ,yCAAwCuD,qBAAsB,gCACjE,CAAC;IACH;IAEA,MAAMzE,YAAY,GAAGoC,MAAM,CAAC0C,MAAM,CAAClF,OAAO,CAAC;IAC3CI,YAAY,CAACc,YAAY,GAAGA,YAAY;IACxC,OAAOd,YAAY;EACrB;EAEA,OAAOJ,OAAO;AAChB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lerc-types.js","names":[],"sources":["../../../../src/lib/parsers/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":""}
@@ -1,5 +1,5 @@
1
1
  import { XMLLoader } from '@loaders.gl/xml';
2
- import { getXMLArray, getXMLStringArray, getXMLInteger, getXMLFloat, getXMLBoolean } from '../xml/parse-xml-helpers';
2
+ import { getXMLArray, getXMLStringArray, getXMLInteger, getXMLFloat, getXMLBoolean } from "../xml/parse-xml-helpers.js";
3
3
  export function parseWMSCapabilities(xmlText, options) {
4
4
  var _XMLLoader$parseTextS;
5
5
  const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, xmlText, options);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","name","Service","Name","title","Title","undefined","abstract","Abstract","keywords","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","Layer","xmlSubLayer","push","extractLayer","key","value","Object","entries","xmlRequests","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","length","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","Array","isArray","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","xmlDimensions","Dimension","dimensions","map","extractDimension","opaque","cascaded","queryable","xmlBoundingBox","westBoundLongitude","w","northBoundLatitude","n","eastBoundLongitude","e","southBoundLatitude","s","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","xResolution","yResolution","xmlDimension","units","extent","dimension","unitSymbol","default","defaultValue","multipleValues","nearestValue","current","parent","subLayer"],"sources":["../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** any extra dimension such as time */\n dimensions?: WMSDimension[];\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/**\n * An optional dimension that can be queried using the `name=...` parameter\n * Note that layers that have at least one dimension without `default` value\n * become unrenderable unless the dimension value is supplied to GetMap requests.\n */\nexport type WMSDimension = {\n /** name of dimension, becomes a valid parameter key for this layer */\n name: string;\n /** Textual units for this dimensional axis */\n units: string;\n /** Unit symbol for this dimensional axis */\n unitSymbol?: string;\n /** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */\n defaultValue?: string;\n /** Can multiple values of the dimension be requested? */\n multipleValues?: boolean;\n /* Will nearest values will be substituted when out of range, if false exact values are required */\n nearestValue?: boolean;\n /** A special value \"current\" is supported, typically for time dimension */\n current?: boolean;\n /** Text content indicating available values for dimension */\n extent: string;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type ParseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n // xml options are passed through to xml loader\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n xmlText: string,\n options?: ParseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: xmlLayer?.Name && String(xmlLayer?.Name),\n abstract: xmlLayer?.Name && String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n // Extract dimensions\n const xmlDimensions = getXMLArray(xmlLayer?.Dimension);\n const dimensions = xmlDimensions.map((xml) => extractDimension(xml));\n if (dimensions.length) {\n layer.dimensions = dimensions;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/**\n * Extracts optional WMS Dimension layer field\n * @param xmlDimension\n * @example <Dimension name=\"time\" units=\"ISO8601\" default=\"2018-01-01\" nearestValue=\"0\">2001-01-01/2018-01-01/P1Y</Dimension>\n * @see https://mapserver.org/ogc/wms_dimension.html\n */\nfunction extractDimension(xmlDimension: any): WMSDimension {\n const {name, units, value: extent} = xmlDimension;\n\n const dimension: WMSDimension = {name, units, extent};\n\n if (xmlDimension.unitSymbol) {\n dimension.unitSymbol = xmlDimension.unitSymbol;\n }\n if (xmlDimension.default) {\n dimension.defaultValue = xmlDimension.default;\n }\n if (xmlDimension.multipleValues) {\n dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);\n }\n if (xmlDimension.nearestValue) {\n dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);\n }\n if (xmlDimension.current) {\n dimension.current = getXMLBoolean(xmlDimension.current);\n }\n\n return dimension;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent?.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent?.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent?.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n if (parent?.dimensions && !layer.dimensions) {\n layer.dimensions = [...parent.dimensions];\n }\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAAC,SAExCC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa;AAyJf,OAAO,SAASC,oBAAoBA,CAClCC,OAAe,EACfC,OAAqC,EACpB;EAAA,IAAAC,qBAAA;EACjB,MAAMC,SAAS,IAAAD,qBAAA,GAAGT,SAAS,CAACW,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAZ,SAAS,EAAiBO,OAAO,EAAEC,OAAO,CAAC;EAC7D,MAAMK,eAAoB,GACxBH,SAAS,CAACI,mBAAmB,IAAIJ,SAAS,CAACK,gBAAgB,IAAIL,SAAS;EAC1E,MAAMM,YAAY,GAAGC,mBAAmB,CAACJ,eAAe,CAAC;EAGzD,IAAIL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEU,mBAAmB,EAAE;IAEhC,KAAK,MAAMC,KAAK,IAAIH,YAAY,CAACI,MAAM,EAAE;MACvCC,sBAAsB,CAACF,KAAK,EAAE,IAAI,CAAC;IACrC;EAEF;EAEA,IAAIX,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEc,cAAc,IAAId,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEe,GAAG,EAAE;IAC3CP,YAAY,CAACO,GAAG,GAAGV,eAAe;EACpC;EAEA,IAAIL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEgB,cAAc,EAAE;IAC3BR,YAAY,CAACS,GAAG,GAAGlB,OAAO;EAC5B;EAEA,OAAOS,YAAY;AACrB;AAGA,SAASC,mBAAmBA,C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jE9E,KAAK,CAAC8E,qBAAqB,GAAG,CAAC,GAAGgD,MAAM,CAAChD,qBAAqB,CAAC;EACjE;EAEA,IAAIgD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEvD,GAAG,IAAI,CAACvE,KAAK,CAACuE,GAAG,EAAE;IAC7BvE,KAAK,CAACuE,GAAG,GAAG,CAAC,GAAGuD,MAAM,CAACvD,GAAG,CAAC;EAC7B;EAEA,IAAIuD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAE3C,aAAa,IAAI,CAACnF,KAAK,CAACmF,aAAa,EAAE;IACjDnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG2C,MAAM,CAAC3C,aAAa,CAAC;EACjD;EAEA,IAAI2C,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEtC,UAAU,IAAI,CAACxF,KAAK,CAACwF,UAAU,EAAE;IAC3CxF,KAAK,CAACwF,UAAU,GAAG,CAAC,GAAGsC,MAAM,CAACtC,UAAU,CAAC;EAC3C;EAEA,KAAK,MAAMuC,QAAQ,IAAI/H,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC6H,QAAQ,EAAE/H,KAAK,CAAC;EACzC;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wms-error.js","names":["XMLLoader","parseWMSError","text","options","_XMLLoader$parseTextS","_parsedXML$ServiceExc","_parsedXML$ogcServic","parsedXML","parseTextSync","call","serviceExceptionXML","ServiceExceptionReport","ServiceException","message","value","code"],"sources":["../../../../src/lib/parsers/wms/parse-wms-error.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Extract an error message from WMS error response XML\n * @param text\n * @param options\n * @returns a string with a human readable message\n */\nexport function parseWMSError(text: string, options): string {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const serviceExceptionXML =\n parsedXML?.ServiceExceptionReport?.ServiceException ||\n parsedXML?.['ogc:ServiceExceptionReport']?.['ogc:ServiceException'];\n // Sigh, can be either a string or an object\n const message =\n typeof serviceExceptionXML === 'string'\n ? serviceExceptionXML\n : serviceExceptionXML.value || serviceExceptionXML.code || 'Unknown error';\n return message;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,aAAaA,CAACC,IAAY,EAAEC,OAAO,EAAU;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,oBAAA;EAC3D,MAAMC,SAAS,IAAAH,qBAAA,GAAGJ,SAAS,CAACQ,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAT,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMO,mBAAmB,GACvB,CAAAH,SAAS,aAATA,SAAS,wBAAAF,qBAAA,GAATE,SAAS,CAAEI,sBAAsB,cAAAN,qBAAA,uBAAjCA,qBAAA,CAAmCO,gBAAgB,MACnDL,SAAS,aAATA,SAAS,wBAAAD,oBAAA,GAATC,SAAS,CAAG,4BAA4B,CAAC,cAAAD,oBAAA,uBAAzCA,oBAAA,CAA4C,sBAAsB,CAAC;EAErE,MAAMO,OAAO,GACX,OAAOH,mBAAmB,KAAK,QAAQ,GACnCA,mBAAmB,GACnBA,mBAAmB,CAACI,KAAK,IAAIJ,mBAAmB,CAACK,IAAI,IAAI,eAAe;EAC9E,OAAOF,OAAO;AAChB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wms-features.js","names":["XMLLoader","parseWMSFeatureInfo","text","options","_XMLLoader$parseTextS","_parsedXML$FeatureInf","parsedXML","parseTextSync","call","xmlFeatureInfo","FeatureInfoResponse","FIELDS","xmlFeatures","Array","isArray","features","map","xmlFeature","extractFeature","xmlFields","attributes","type","bounds","bottom","top","left","right"],"sources":["../../../../src/lib/parsers/wms/parse-wms-features.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** WMS Feature info - response to a WMS `GetFeatureInfo` request */\nexport type WMSFeatureInfo = {\n features: WMSFeature[];\n};\n\nexport type WMSFeature = {\n attributes: Record<string, number | string>;\n type: string;\n bounds: {top: number; bottom: number; left: number; right: number};\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSFeatureInfo(text: string, options): WMSFeatureInfo {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlFeatureInfo: any = parsedXML.FeatureInfoResponse?.FIELDS || [];\n\n const xmlFeatures = Array.isArray(xmlFeatureInfo) ? xmlFeatureInfo : [xmlFeatureInfo];\n\n return {\n features: xmlFeatures.map((xmlFeature) => extractFeature(xmlFeature))\n };\n}\n\nfunction extractFeature(xmlFeature: any) {\n const xmlFields = xmlFeature || {};\n // TODO - not correct\n return {\n attributes: xmlFields,\n type: '',\n bounds: {bottom: 0, top: 0, left: 0, right: 0}\n };\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAiBzC,OAAO,SAASC,mBAAmBA,CAACC,IAAY,EAAEC,OAAO,EAAkB;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EACzE,MAAMC,SAAS,IAAAF,qBAAA,GAAGJ,SAAS,CAACO,aAAa,cAAAH,qBAAA,uBAAvBA,qBAAA,CAAAI,IAAA,CAAAR,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMM,cAAmB,GAAG,EAAAJ,qBAAA,GAAAC,SAAS,CAACI,mBAAmB,cAAAL,qBAAA,uBAA7BA,qBAAA,CAA+BM,MAAM,KAAI,EAAE;EAEvE,MAAMC,WAAW,GAAGC,KAAK,CAACC,OAAO,CAACL,cAAc,CAAC,GAAGA,cAAc,GAAG,CAACA,cAAc,CAAC;EAErF,OAAO;IACLM,QAAQ,EAAEH,WAAW,CAACI,GAAG,CAAEC,UAAU,IAAKC,cAAc,CAACD,UAAU,CAAC;EACtE,CAAC;AACH;AAEA,SAASC,cAAcA,CAACD,UAAe,EAAE;EACvC,MAAME,SAAS,GAAGF,UAAU,IAAI,CAAC,CAAC;EAElC,OAAO;IACLG,UAAU,EAAED,SAAS;IACrBE,IAAI,EAAE,EAAE;IACRC,MAAM,EAAE;MAACC,MAAM,EAAE,CAAC;MAAEC,GAAG,EAAE,CAAC;MAAEC,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAC;EAC/C,CAAC;AACH"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-wms-layer-description.js","names":["XMLLoader","parseWMSLayerDescription","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call"],"sources":["../../../../src/lib/parsers/wms/parse-wms-layer-description.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** Layer description - response to a WMS `DescribeLayer` request */\nexport type WMSLayerDescription = {\n layers: {}[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSLayerDescription(\n text: string,\n options?: XMLLoaderOptions\n): WMSLayerDescription {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n // TODO - implement parser\n return parsedXML as unknown as WMSLayerDescription;\n}\n"],"mappings":"AAGA,SAAQA,SAAS,QAAO,iBAAiB;AAWzC,OAAO,SAASC,wBAAwBA,CACtCC,IAAY,EACZC,OAA0B,EACL;EAAA,IAAAC,qBAAA;EACrB,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAE1D,OAAOE,SAAS;AAClB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-xml-helpers.js","names":["getXMLArray","xmlValue","Array","isArray","getXMLStringArray","xmlArray","length","every","_","getXMLFloat","defaultValue","arguments","undefined","parseFloat","getXMLInteger","parseInt","getXMLBoolean"],"sources":["../../../../src/lib/parsers/xml/parse-xml-helpers.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/** A single element of an array is not represented as an array in XML */\nexport function getXMLArray(xmlValue: any): any[] {\n // Already an array, return as is\n if (Array.isArray(xmlValue)) {\n return xmlValue;\n }\n // Single value, wrap in array\n if (xmlValue) {\n return [xmlValue];\n }\n // nullish, return empty array\n return [];\n}\n\n/** Get a list of strings from XML */\nexport function getXMLStringArray(xmlValue: any): string[] {\n const xmlArray = getXMLArray(xmlValue);\n if (xmlArray.length > 0 && xmlArray.every((_) => typeof _ === 'string')) {\n return xmlArray as string[];\n }\n // TODO - error handling?\n return [];\n}\n\n/** Get XML float */\nexport function getXMLFloat(xmlValue: any, defaultValue = undefined): number | undefined {\n switch (typeof xmlValue) {\n case 'number':\n return xmlValue;\n case 'string':\n return parseFloat(xmlValue);\n default:\n return undefined;\n }\n}\n\n/** Get XML integer */\nexport function getXMLInteger(xmlValue: any, defaultValue = undefined): number | undefined {\n switch (typeof xmlValue) {\n case 'number':\n return xmlValue;\n case 'string':\n return parseInt(xmlValue, 10);\n default:\n return undefined;\n }\n}\n\n/** Somewhat arbitrary boolean parsing */\nexport function getXMLBoolean(xmlValue: any): boolean {\n switch (xmlValue) {\n case 'true':\n return true;\n case 'false':\n return false;\n case '1':\n return true;\n case '0':\n return false;\n default:\n return false;\n }\n}\n"],"mappings":"AAGA,OAAO,SAASA,WAAWA,CAACC,QAAa,EAAS;EAEhD,IAAIC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;IAC3B,OAAOA,QAAQ;EACjB;EAEA,IAAIA,QAAQ,EAAE;IACZ,OAAO,CAACA,QAAQ,CAAC;EACnB;EAEA,OAAO,EAAE;AACX;AAGA,OAAO,SAASG,iBAAiBA,CAACH,QAAa,EAAY;EACzD,MAAMI,QAAQ,GAAGL,WAAW,CAACC,QAAQ,CAAC;EACtC,IAAII,QAAQ,CAACC,MAAM,GAAG,CAAC,IAAID,QAAQ,CAACE,KAAK,CAAEC,CAAC,IAAK,OAAOA,CAAC,KAAK,QAAQ,CAAC,EAAE;IACvE,OAAOH,QAAQ;EACjB;EAEA,OAAO,EAAE;AACX;AAGA,OAAO,SAASI,WAAWA,CAACR,QAAa,EAAgD;EAAA,IAA9CS,YAAY,GAAAC,SAAA,CAAAL,MAAA,QAAAK,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAGC,SAAS;EACjE,QAAQ,OAAOX,QAAQ;IACrB,KAAK,QAAQ;MACX,OAAOA,QAAQ;IACjB,KAAK,QAAQ;MACX,OAAOY,UAAU,CAACZ,QAAQ,CAAC;IAC7B;MACE,OAAOW,SAAS;EACpB;AACF;AAGA,OAAO,SAASE,aAAaA,CAACb,QAAa,EAAgD;EAAA,IAA9CS,YAAY,GAAAC,SAAA,CAAAL,MAAA,QAAAK,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAGC,SAAS;EACnE,QAAQ,OAAOX,QAAQ;IACrB,KAAK,QAAQ;MACX,OAAOA,QAAQ;IACjB,KAAK,QAAQ;MACX,OAAOc,QAAQ,CAACd,QAAQ,EAAE,EAAE,CAAC;IAC/B;MACE,OAAOW,SAAS;EACpB;AACF;AAGA,OAAO,SAASI,aAAaA,CAACf,QAAa,EAAW;EACpD,QAAQA,QAAQ;IACd,KAAK,MAAM;MACT,OAAO,IAAI;IACb,KAAK,OAAO;MACV,OAAO,KAAK;IACd,KAAK,GAAG;MACN,OAAO,IAAI;IACb,KAAK,GAAG;MACN,OAAO,KAAK;IACd;MACE,OAAO,KAAK;EAChB;AACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-image-service.js","names":["createImageService","props","services","type","service","guessServiceType","url","getServiceOfType","Error","create","testURL"],"sources":["../../../src/lib/services/create-image-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {ImageSource, Service} from '@loaders.gl/loader-utils';\nimport {ImageServiceProps} from './image-service';\n\nexport type CreateImageServiceProps = ImageServiceProps & {\n type?: string | 'auto';\n};\n\n/**\n * Creates an image source\n * If type is not supplied, will try to automatically detect the the\n * @param url URL to the image source\n * @param type type of source. if not known, set to 'auto'\n * @returns an ImageSource instance\n */\nexport function createImageService(\n props: CreateImageServiceProps,\n services: Service[]\n): ImageSource {\n const {type = 'auto'} = props;\n const service: Service | null =\n type === 'auto' ? guessServiceType(props.url, services) : getServiceOfType(type, services);\n\n if (!service) {\n throw new Error('Not a valid image source type');\n }\n return service.create(props);\n}\n\n/** Guess service type from URL */\nfunction getServiceOfType(type: string, services: Service[]): Service | null {\n // if (type === 'template') {\n // return ImageService;\n // }\n\n for (const service of services) {\n if (service.type === type) {\n return service;\n }\n }\n\n return null;\n}\n\n/** Guess service type from URL */\nfunction guessServiceType(url: string, services: Service[]): Service | null {\n for (const service of services) {\n if (service.testURL && service.testURL(url)) {\n return service;\n }\n }\n\n return null;\n}\n"],"mappings":"AAgBA,OAAO,SAASA,kBAAkBA,CAChCC,KAA8B,EAC9BC,QAAmB,EACN;EACb,MAAM;IAACC,IAAI,GAAG;EAAM,CAAC,GAAGF,KAAK;EAC7B,MAAMG,OAAuB,GAC3BD,IAAI,KAAK,MAAM,GAAGE,gBAAgB,CAACJ,KAAK,CAACK,GAAG,EAAEJ,QAAQ,CAAC,GAAGK,gBAAgB,CAACJ,IAAI,EAAED,QAAQ,CAAC;EAE5F,IAAI,CAACE,OAAO,EAAE;IACZ,MAAM,IAAII,KAAK,CAAC,+BAA+B,CAAC;EAClD;EACA,OAAOJ,OAAO,CAACK,MAAM,CAACR,KAAK,CAAC;AAC9B;AAGA,SAASM,gBAAgBA,CAACJ,IAAY,EAAED,QAAmB,EAAkB;EAK3E,KAAK,MAAME,OAAO,IAAIF,QAAQ,EAAE;IAC9B,IAAIE,OAAO,CAACD,IAAI,KAAKA,IAAI,EAAE;MACzB,OAAOC,OAAO;IAChB;EACF;EAEA,OAAO,IAAI;AACb;AAGA,SAASC,gBAAgBA,CAACC,GAAW,EAAEJ,QAAmB,EAAkB;EAC1E,KAAK,MAAME,OAAO,IAAIF,QAAQ,EAAE;IAC9B,IAAIE,OAAO,CAACM,OAAO,IAAIN,OAAO,CAACM,OAAO,CAACJ,GAAG,CAAC,EAAE;MAC3C,OAAOF,OAAO;IAChB;EACF;EAEA,OAAO,IAAI;AACb"}
@@ -1,4 +1,3 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
1
  import { ImageLoader } from '@loaders.gl/images';
3
2
  import { ImageSource } from '@loaders.gl/loader-utils';
4
3
  export class ImageService extends ImageSource {
@@ -28,12 +27,12 @@ export class ImageService extends ImageSource {
28
27
  getURLFromTemplate(parameters) {
29
28
  let url = this.props.url;
30
29
  for (const [key, value] of Object.entries(parameters)) {
31
- url = url.replace("${".concat(key, "}"), String(value));
32
- url = url.replace("{".concat(key, "}"), String(value));
30
+ url = url.replace(`\${${key}}`, String(value));
31
+ url = url.replace(`{${key}}`, String(value));
33
32
  }
34
33
  return url;
35
34
  }
36
35
  }
37
- _defineProperty(ImageService, "type", 'template');
38
- _defineProperty(ImageService, "testURL", url => url.toLowerCase().includes('{'));
36
+ ImageService.type = 'template';
37
+ ImageService.testURL = url => url.toLowerCase().includes('{');
39
38
  //# sourceMappingURL=image-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-service.js","names":["ImageLoader","ImageSource","ImageService","constructor","props","getMetadata","Error","getImage","parameters","granularParameters","getGranularParameters","url","getURLFromTemplate","response","fetch","arrayBuffer","parse","east","north","west","south","bbox","key","value","Object","entries","replace","String","type","testURL","toLowerCase","includes"],"sources":["../../../src/lib/services/image-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\nimport {ImageSource} from '@loaders.gl/loader-utils';\n\n/** Template URL string should contain `${width}` etc which will be substituted. */\nexport type ImageServiceProps = {\n /** Base URL to the service */\n url: string;\n /** Any load options to the loaders.gl Loaders used by the WMSService methods */\n loadOptions?: LoaderOptions;\n};\n\n/**\n * Quickly connect to \"ad hoc\" image sources without subclassing ImageSource.\n * ImageSource allows template url strings to be used to ad hoc connect to arbitrary image data sources\n * Accepts a template url string and builds requests URLs\n */\nexport class ImageService<\n PropsT extends ImageServiceProps = ImageServiceProps\n> extends ImageSource<PropsT> {\n static type: string = 'template';\n static testURL = (url: string): boolean => url.toLowerCase().includes('{');\n\n constructor(props: PropsT) {\n super(props);\n }\n\n // IMAGE SOURCE API\n\n async getMetadata(): Promise<ImageSourceMetadata> {\n throw new Error('ImageSource.getMetadata not implemented');\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n const granularParameters = this.getGranularParameters(parameters);\n const url = this.getURLFromTemplate(granularParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n return await ImageLoader.parse(arrayBuffer);\n }\n\n // HELPERS\n\n /** Break up bounding box in east, north, south, west */\n protected getGranularParameters(parameters: GetImageParameters): Record<string, unknown> {\n const [east, north, west, south] = parameters.bbox;\n return {...parameters, east, north, south, west};\n }\n\n /** Supports both ${} and {} notations */\n protected getURLFromTemplate(parameters: Record<string, unknown>): string {\n let url = this.props.url;\n for (const [key, value] of Object.entries(parameters)) {\n // TODO - parameter could be repeated\n // const regex = new RegExp(`\\${${key}}`, 'g');\n url = url.replace(`\\${${key}}`, String(value));\n url = url.replace(`{${key}}`, String(value));\n }\n return url;\n }\n}\n"],"mappings":"AAIA,SAAQA,WAAW,QAAO,oBAAoB;AAG9C,SAAQC,WAAW,QAAO,0BAA0B;AAepD,OAAO,MAAMC,YAAY,SAEfD,WAAW,CAAS;EAI5BE,WAAWA,CAACC,KAAa,EAAE;IACzB,KAAK,CAACA,KAAK,CAAC;EACd;EAIA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,MAAM,IAAIC,KA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-1,4 +1,4 @@
1
- import { ImageService } from '../../lib/services/image-service';
1
+ import { ImageService } from "../../lib/services/image-service.js";
2
2
  export class ArcGISImageSource extends ImageService {
3
3
  constructor(props) {
4
4
  super(props);
@@ -16,11 +16,11 @@ export class ArcGISImageSource extends ImageService {
16
16
  throw new Error('not implemented');
17
17
  }
18
18
  metadataURL(options) {
19
- return "".concat(this.props.url, "?f=pjson");
19
+ return `${this.props.url}?f=pjson`;
20
20
  }
21
21
  exportImageURL(options) {
22
- const bbox = "bbox=".concat(options.bbox[0], ",").concat(options.bbox[1], ",").concat(options.bbox[2], ",").concat(options.bbox[3]);
23
- const size = "size=".concat(options.width, ",").concat(options.height);
22
+ const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;
23
+ const size = `size=${options.width},${options.height}`;
24
24
  const arcgisOptions = {
25
25
  ...options,
26
26
  bbox,
@@ -31,15 +31,15 @@ export class ArcGISImageSource extends ImageService {
31
31
  return this.getUrl('exportImage', arcgisOptions);
32
32
  }
33
33
  getUrl(path, options, extra) {
34
- let url = "".concat(this.props.url, "/").concat(path);
34
+ let url = `${this.props.url}/${path}`;
35
35
  let first = true;
36
36
  for (const [key, value] of Object.entries(options)) {
37
37
  url += first ? '?' : '&';
38
38
  first = false;
39
39
  if (Array.isArray(value)) {
40
- url += "".concat(key.toUpperCase(), "=").concat(value.join(','));
40
+ url += `${key.toUpperCase()}=${value.join(',')}`;
41
41
  } else {
42
- url += "".concat(key.toUpperCase(), "=").concat(value ? String(value) : '');
42
+ url += `${key.toUpperCase()}=${value ? String(value) : ''}`;
43
43
  }
44
44
  }
45
45
  return url;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcgis-image-service.js","names":["ImageService","ArcGISImageSource","constructor","props","getMetadata","metadata","getImage","parameters","Error","exportImage","options","metadataURL","url","exportImageURL","bbox","size","width","height","arcgisOptions","getUrl","path","extra","first","key","value","Object","entries","Array","isArray","toUpperCase","join","String","checkResponse","response","ok","ArcGISImageService","type","testURL","toLowerCase","includes","create"],"sources":["../../../src/services/arcgis/arcgis-image-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\n\nimport type {ImageServiceProps} from '../../lib/services/image-service';\nimport {ImageService} from '../../lib/services/image-service';\n\n// import type {ImageSourceProps} from '@loaders.gl/loader-utils';\n// import {ImageSource} from '@loaders.gl/loader-utils';\n\nexport type ArcGISImageServerProps = ImageServiceProps & {\n url: string;\n};\n\n/**\n * ArcGIS ImageServer\n * Note - exports a big API, that could be exposed here if there is a use case\n * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm\n */\nexport class ArcGISImageSource extends ImageService<ArcGISImageServerProps> {\n constructor(props: ArcGISImageServerProps) {\n super(props);\n }\n\n // ImageSource (normalized endpoints)\n\n async getMetadata(): Promise<ImageSourceMetadata> {\n return (await this.metadata()) as ImageSourceMetadata;\n // TODO - normalize metadata\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n throw new Error('not implemented');\n // TODO - Map generic parameters to ArcGIS specific parameters\n // return await this.exportImage(parameters);\n }\n\n // ImageServer endpoints\n\n async metadata(): Promise<unknown> {\n // We just need a JSON parsing...\n // return this.getUrl({path: '', ...options});\n throw new Error('not implemented');\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image`,\n */\n exportImage(options: {\n boundingBox: [number, number, number, number];\n boundingBoxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): Promise<ImageType> {\n // See WMSService.getMap()\n throw new Error('not implemented');\n }\n\n // URL creators\n\n metadataURL(options: {parameters?: Record<string, unknown>}): string {\n return `${this.props.url}?f=pjson`;\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?\n // bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&\n // size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&\n // noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&\n // compressionQuality=&bandIds=&mosaicRule=&renderingRule=&\n // f=image\n */\n exportImageURL(options: {\n bbox: [number, number, number, number];\n boxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): string {\n const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;\n const size = `size=${options.width},${options.height}`;\n const arcgisOptions = {...options, bbox, size};\n // @ts-expect-error\n delete arcgisOptions.width;\n // @ts-expect-error\n delete arcgisOptions.height;\n return this.getUrl('exportImage', arcgisOptions);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note protected, since perhaps getWMSUrl may need to be overridden to handle certain backends?\n * @note if override is common, maybe add a callback prop?\n * */\n protected getUrl(\n path: string,\n options: Record<string, unknown>,\n extra?: Record<string, unknown>\n ): string {\n let url = `${this.props.url}/${path}`;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return url;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected async checkResponse(response: Response) {\n if (!response.ok) {\n // } || response.headers['content-type'] === WMSErrorLoader.mimeTypes[0]) {\n // const arrayBuffer = await response.arrayBuffer();\n // const error = await WMSErrorLoader.parse(arrayBuffer, this.loadOptions);\n throw new Error('error');\n }\n }\n}\n\nexport const ArcGISImageService: Service = {\n type: 'arcgis-image-server',\n testURL: (url: string): boolean => url.toLowerCase().includes('ImageServer'),\n create: (props: ArcGISImageServerProps): ArcGISImageSource => new ArcGISImageSource(props)\n};\n"],"mappings":"SAMQA,YAAY;AAcpB,OAAO,MAAMC,iBAAiB,SAASD,YAAY,CAAyB;EAC1EE,WAAWA,CAACC,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,CAAC;EACd;EAIA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,OAAQ,MAAM,IAAI,CAACC,QAAQ,CAAC,CAAC;EAE/B;EAEA,MAAMC,QAAQA,CAACC,UAA8B,EAAsB;IACjE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EAGpC;EAIA,MAAMH,QAAQA,CAAA,EAAqB;IAGjC,MAAM,IAAIG,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAMAC,WAAWA,CAACC,OAkBX,EAAsB;IAErB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAIAG,WAAWA,CAACD,OAA+C,EAAU;IACnE,OAAQ,GAAE,IAAI,CAACP,KAAK,CAACS,GAAI,UAAS;EACpC;EAWAC,cAAcA,CAACH,OAkBd,EAAU;IACT,MAAMI,IAAI,GAAI,QAAOJ,OAAO,CAACI,IAAI,CAAC,CAA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