@loaders.gl/wms 3.3.0-alpha.8 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +6 -0
- package/dist/dist.min.js +4141 -1479
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js +77 -0
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lerc-loader.js +74 -0
- package/dist/es5/lerc-loader.js.map +1 -0
- package/dist/es5/lib/data-sources/adhoc-image-service.js +129 -0
- package/dist/es5/lib/data-sources/adhoc-image-service.js.map +1 -0
- package/dist/es5/lib/data-sources/arcgis-image-service.js +180 -0
- package/dist/es5/lib/data-sources/arcgis-image-service.js.map +1 -0
- package/dist/es5/lib/data-sources/create-image-source.js +45 -0
- package/dist/es5/lib/data-sources/create-image-source.js.map +1 -0
- package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js +179 -0
- package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
- package/dist/es5/lib/data-sources/image-services/image-service.js +163 -0
- package/dist/es5/lib/data-sources/image-services/image-service.js.map +1 -0
- package/dist/es5/lib/data-sources/image-services/wms-service.js +400 -0
- package/dist/es5/lib/data-sources/image-services/wms-service.js.map +1 -0
- package/dist/es5/lib/data-sources/image-source.js +14 -0
- package/dist/es5/lib/data-sources/image-source.js.map +1 -0
- package/dist/es5/lib/gml/deep-strict-equal.js +64 -0
- package/dist/es5/lib/gml/deep-strict-equal.js.map +1 -0
- package/dist/es5/lib/gml/parse-gml.js +416 -0
- package/dist/es5/lib/gml/parse-gml.js.map +1 -0
- package/dist/es5/lib/lerc/lerc-types.js +2 -0
- package/dist/es5/lib/lerc/lerc-types.js.map +1 -0
- package/dist/es5/lib/wcs/parse-wcs.js +43 -0
- package/dist/es5/lib/wcs/parse-wcs.js.map +1 -0
- package/dist/es5/lib/wcs/wcs-types.js +2 -0
- package/dist/es5/lib/wcs/wcs-types.js.map +1 -0
- package/dist/es5/lib/wfs/parse-wfs.js +43 -0
- package/dist/es5/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/es5/lib/wfs/wfs-types.js +2 -0
- package/dist/es5/lib/wfs/wfs-types.js.map +1 -0
- package/dist/es5/lib/wms/parse-wms.js +135 -0
- package/dist/es5/lib/wms/parse-wms.js.map +1 -0
- package/dist/es5/{wms-types.js → lib/wms/wms-types.js} +0 -0
- package/dist/{esm → es5/lib/wms}/wms-types.js.map +1 -1
- package/dist/es5/lib/wmts/parse-wmts.js +43 -0
- package/dist/es5/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/es5/lib/wmts/wmts-types.js +2 -0
- package/dist/es5/lib/wmts/wmts-types.js.map +1 -0
- package/dist/es5/wip/arcgis-feature-service.js +45 -0
- package/dist/es5/wip/arcgis-feature-service.js.map +1 -0
- package/dist/es5/wip/data-source.js +4 -0
- package/dist/es5/wip/data-source.js.map +1 -0
- package/dist/es5/wip/gml-loader.js +54 -0
- package/dist/es5/wip/gml-loader.js.map +1 -0
- package/dist/es5/wip/wcs-capabilities-loader.js +54 -0
- package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -0
- package/dist/es5/wip/wfs-capabilities-loader.js +54 -0
- package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -0
- package/dist/es5/wip/wms-feature-info-loader.js +44 -0
- package/dist/es5/wip/wms-feature-info-loader.js.map +1 -0
- package/dist/es5/wip/wms-layer-description-loader.js +44 -0
- package/dist/es5/wip/wms-layer-description-loader.js.map +1 -0
- package/dist/es5/wip/wms-layer-description-loader.md.disabled.md +47 -0
- package/dist/es5/wip/wmts-capabilities-loader.js +54 -0
- package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -0
- package/dist/es5/wms-capabilities-loader.js +7 -6
- package/dist/es5/wms-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-error-loader.js +70 -0
- package/dist/es5/wms-error-loader.js.map +1 -0
- package/dist/esm/bundle.js +1 -0
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lerc-loader.js +25 -0
- package/dist/esm/lerc-loader.js.map +1 -0
- package/dist/esm/lib/data-sources/adhoc-image-service.js +43 -0
- package/dist/esm/lib/data-sources/adhoc-image-service.js.map +1 -0
- package/dist/esm/lib/data-sources/arcgis-image-service.js +62 -0
- package/dist/esm/lib/data-sources/arcgis-image-service.js.map +1 -0
- package/dist/esm/lib/data-sources/create-image-source.js +30 -0
- package/dist/esm/lib/data-sources/create-image-source.js.map +1 -0
- package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js +61 -0
- package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
- package/dist/esm/lib/data-sources/image-services/image-service.js +72 -0
- package/dist/esm/lib/data-sources/image-services/image-service.js.map +1 -0
- package/dist/esm/lib/data-sources/image-services/wms-service.js +190 -0
- package/dist/esm/lib/data-sources/image-services/wms-service.js.map +1 -0
- package/dist/esm/lib/data-sources/image-source.js +4 -0
- package/dist/esm/lib/data-sources/image-source.js.map +1 -0
- package/dist/esm/lib/gml/deep-strict-equal.js +57 -0
- package/dist/esm/lib/gml/deep-strict-equal.js.map +1 -0
- package/dist/esm/lib/gml/parse-gml.js +348 -0
- package/dist/esm/lib/gml/parse-gml.js.map +1 -0
- package/dist/esm/lib/lerc/lerc-types.js +2 -0
- package/dist/esm/lib/lerc/lerc-types.js.map +1 -0
- package/dist/esm/lib/wcs/parse-wcs.js +32 -0
- package/dist/esm/lib/wcs/parse-wcs.js.map +1 -0
- package/dist/esm/lib/wcs/wcs-types.js +2 -0
- package/dist/esm/lib/wcs/wcs-types.js.map +1 -0
- package/dist/esm/lib/wfs/parse-wfs.js +32 -0
- package/dist/esm/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/esm/lib/wfs/wfs-types.js +2 -0
- package/dist/esm/lib/wfs/wfs-types.js.map +1 -0
- package/dist/esm/lib/wms/parse-wms.js +101 -0
- package/dist/esm/lib/wms/parse-wms.js.map +1 -0
- package/dist/esm/{wms-types.js → lib/wms/wms-types.js} +0 -0
- package/dist/{es5 → esm/lib/wms}/wms-types.js.map +1 -1
- package/dist/esm/lib/wmts/parse-wmts.js +32 -0
- package/dist/esm/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/esm/lib/wmts/wmts-types.js +2 -0
- package/dist/esm/lib/wmts/wmts-types.js.map +1 -0
- package/dist/esm/wip/arcgis-feature-service.js +28 -0
- package/dist/esm/wip/arcgis-feature-service.js.map +1 -0
- package/dist/esm/wip/data-source.js +2 -0
- package/dist/esm/wip/data-source.js.map +1 -0
- package/dist/esm/wip/gml-loader.js +25 -0
- package/dist/esm/wip/gml-loader.js.map +1 -0
- package/dist/esm/wip/wcs-capabilities-loader.js +25 -0
- package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -0
- package/dist/esm/wip/wfs-capabilities-loader.js +25 -0
- package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -0
- package/dist/esm/wip/wms-feature-info-loader.js +14 -0
- package/dist/esm/wip/wms-feature-info-loader.js.map +1 -0
- package/dist/esm/wip/wms-layer-description-loader.js +14 -0
- package/dist/esm/wip/wms-layer-description-loader.js.map +1 -0
- package/dist/esm/wip/wms-layer-description-loader.md.disabled.md +47 -0
- package/dist/esm/wip/wmts-capabilities-loader.js +25 -0
- package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -0
- package/dist/esm/wms-capabilities-loader.js +6 -4
- package/dist/esm/wms-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-error-loader.js +40 -0
- package/dist/esm/wms-error-loader.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/lerc-loader.d.ts +30 -0
- package/dist/lerc-loader.d.ts.map +1 -0
- package/dist/lerc-loader.js +56 -0
- package/dist/lib/data-sources/adhoc-image-service.d.ts +24 -0
- package/dist/lib/data-sources/adhoc-image-service.d.ts.map +1 -0
- package/dist/lib/data-sources/adhoc-image-service.js +46 -0
- package/dist/lib/data-sources/arcgis-image-service.d.ts +79 -0
- package/dist/lib/data-sources/arcgis-image-service.d.ts.map +1 -0
- package/dist/lib/data-sources/arcgis-image-service.js +85 -0
- package/dist/lib/data-sources/create-image-source.d.ts +16 -0
- package/dist/lib/data-sources/create-image-source.d.ts.map +1 -0
- package/dist/lib/data-sources/create-image-source.js +39 -0
- package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts +71 -0
- package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts.map +1 -0
- package/dist/lib/data-sources/image-services/arcgis-image-service.js +85 -0
- package/dist/lib/data-sources/image-services/image-service.d.ts +39 -0
- package/dist/lib/data-sources/image-services/image-service.d.ts.map +1 -0
- package/dist/lib/data-sources/image-services/image-service.js +82 -0
- package/dist/lib/data-sources/image-services/wms-service.d.ts +188 -0
- package/dist/lib/data-sources/image-services/wms-service.d.ts.map +1 -0
- package/dist/lib/data-sources/image-services/wms-service.js +218 -0
- package/dist/lib/data-sources/image-source.d.ts +73 -0
- package/dist/lib/data-sources/image-source.d.ts.map +1 -0
- package/dist/lib/data-sources/image-source.js +12 -0
- package/dist/lib/gml/deep-strict-equal.d.ts +3 -0
- package/dist/lib/gml/deep-strict-equal.d.ts.map +1 -0
- package/dist/lib/gml/deep-strict-equal.js +119 -0
- package/dist/lib/gml/parse-gml.d.ts +28 -0
- package/dist/lib/gml/parse-gml.d.ts.map +1 -0
- package/dist/lib/gml/parse-gml.js +371 -0
- package/dist/lib/lerc/lerc-types.d.ts +30 -0
- package/dist/lib/lerc/lerc-types.d.ts.map +1 -0
- package/dist/lib/lerc/lerc-types.js +3 -0
- package/dist/lib/wcs/parse-wcs.d.ts +7 -0
- package/dist/lib/wcs/parse-wcs.d.ts.map +1 -0
- package/dist/lib/wcs/parse-wcs.js +36 -0
- package/dist/lib/wcs/wcs-types.d.ts +73 -0
- package/dist/lib/wcs/wcs-types.d.ts.map +1 -0
- package/dist/lib/wcs/wcs-types.js +3 -0
- package/dist/lib/wfs/parse-wfs.d.ts +7 -0
- package/dist/lib/wfs/parse-wfs.d.ts.map +1 -0
- package/dist/lib/wfs/parse-wfs.js +36 -0
- package/dist/lib/wfs/wfs-types.d.ts +73 -0
- package/dist/lib/wfs/wfs-types.d.ts.map +1 -0
- package/dist/lib/wfs/wfs-types.js +3 -0
- package/dist/lib/wms/parse-wms.d.ts +24 -0
- package/dist/lib/wms/parse-wms.d.ts.map +1 -0
- package/dist/lib/wms/parse-wms.js +115 -0
- package/dist/lib/wms/wms-types.d.ts +100 -0
- package/dist/lib/wms/wms-types.d.ts.map +1 -0
- package/dist/lib/wms/wms-types.js +1908 -0
- package/dist/lib/wmts/parse-wmts.d.ts +7 -0
- package/dist/lib/wmts/parse-wmts.d.ts.map +1 -0
- package/dist/lib/wmts/parse-wmts.js +36 -0
- package/dist/lib/wmts/wmts-types.d.ts +73 -0
- package/dist/lib/wmts/wmts-types.d.ts.map +1 -0
- package/dist/lib/wmts/wmts-types.js +3 -0
- package/dist/wip/arcgis-feature-service.d.ts +56 -0
- package/dist/wip/arcgis-feature-service.d.ts.map +1 -0
- package/dist/wip/arcgis-feature-service.js +28 -0
- package/dist/wip/data-source.d.ts +54 -0
- package/dist/wip/data-source.d.ts.map +1 -0
- package/dist/wip/data-source.js +59 -0
- package/dist/wip/gml-loader.d.ts +26 -0
- package/dist/wip/gml-loader.d.ts.map +1 -0
- package/dist/wip/gml-loader.js +31 -0
- package/dist/wip/wcs-capabilities-loader.d.ts +26 -0
- package/dist/wip/wcs-capabilities-loader.d.ts.map +1 -0
- package/dist/wip/wcs-capabilities-loader.js +31 -0
- package/dist/wip/wfs-capabilities-loader.d.ts +26 -0
- package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -0
- package/dist/wip/wfs-capabilities-loader.js +31 -0
- package/dist/wip/wms-feature-info-loader.d.ts +22 -0
- package/dist/wip/wms-feature-info-loader.d.ts.map +1 -0
- package/dist/wip/wms-feature-info-loader.js +17 -0
- package/dist/wip/wms-layer-description-loader.d.ts +22 -0
- package/dist/wip/wms-layer-description-loader.d.ts.map +1 -0
- package/dist/wip/wms-layer-description-loader.js +17 -0
- package/dist/wip/wmts-capabilities-loader.d.ts +26 -0
- package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -0
- package/dist/wip/wmts-capabilities-loader.js +31 -0
- package/dist/wms-capabilities-loader.d.ts +26 -0
- package/dist/wms-capabilities-loader.d.ts.map +1 -0
- package/dist/wms-capabilities-loader.js +31 -0
- package/dist/wms-error-loader.d.ts +34 -0
- package/dist/wms-error-loader.d.ts.map +1 -0
- package/dist/wms-error-loader.js +43 -0
- package/package.json +17 -6
- package/src/bundle.ts +2 -0
- package/src/index.ts +54 -2
- package/src/lerc-loader.ts +50 -0
- package/src/lib/data-sources/adhoc-image-service.ts +61 -0
- package/src/lib/data-sources/arcgis-image-service.ts +146 -0
- package/src/lib/data-sources/create-image-source.ts +46 -0
- package/src/lib/data-sources/image-services/arcgis-image-service.ts +136 -0
- package/src/lib/data-sources/image-services/image-service.ts +105 -0
- package/src/lib/data-sources/image-services/wms-service.ts +351 -0
- package/src/lib/data-sources/image-source.ts +82 -0
- package/src/lib/gml/deep-strict-equal.ts +119 -0
- package/src/lib/gml/parse-gml.ts +500 -0
- package/src/lib/lerc/lerc-types.ts +43 -0
- package/src/lib/wcs/parse-wcs.ts +39 -0
- package/src/lib/wcs/wcs-types.ts +77 -0
- package/src/lib/wfs/parse-wfs.ts +39 -0
- package/src/lib/wfs/wfs-types.ts +78 -0
- package/src/lib/wms/parse-wms.ts +142 -0
- package/src/{wms-types.ts → lib/wms/wms-types.ts} +76 -24
- package/src/lib/wmts/parse-wmts.ts +39 -0
- package/src/lib/wmts/wmts-types.ts +77 -0
- package/src/wip/arcgis-feature-service.ts +89 -0
- package/src/wip/data-source.ts +62 -0
- package/src/wip/gml-loader.ts +40 -0
- package/src/wip/wcs-capabilities-loader.ts +40 -0
- package/src/wip/wfs-capabilities-loader.ts +40 -0
- package/src/wip/wms-feature-info-loader.ts +21 -0
- package/src/wip/wms-layer-description-loader.md.disabled.md +47 -0
- package/src/wip/wms-layer-description-loader.ts +21 -0
- package/src/wip/wmts-capabilities-loader.ts +40 -0
- package/src/wms-capabilities-loader.ts +10 -8
- package/src/wms-error-loader.ts +59 -0
- package/dist/es5/lib/parse-wms-capabilities.js +0 -19
- package/dist/es5/lib/parse-wms-capabilities.js.map +0 -1
- package/dist/esm/lib/parse-wms-capabilities.js +0 -14
- package/dist/esm/lib/parse-wms-capabilities.js.map +0 -1
- package/src/lib/parse-wms-capabilities.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-gml.d.ts","sourceRoot":"","sources":["../../../src/lib/gml/parse-gml.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAIV,QAAQ,EACR,QAAQ,EAST,MAAM,oBAAoB,CAAC;AAU5B,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAA,mBAQ7C;AAED,4CAA4C;AAC5C,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,GAAG,EACb,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,GAAG,IAAI,CAuDjB;AAsBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,cASxF;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,QAAQ,CAa/F;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,EAAE,CASjG;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,CA4BZ;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,CA0BZ;AAED,wBAAgB,SAAS,CACvB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,CAuCZ;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,CAYZ;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,EAAE,CAoBd;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,EAAE,EAAE,CA0BhB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,EAAE,EAAE,CAyBhB;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,QAAQ,EAAE,EAAE,EAAE,CAmChB"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.parseMultiSurface = exports.parseCompositeSurface = exports.parseSurface = exports.parsePolygonOrRectangle = exports.parseExteriorOrInterior = exports.parseRing = exports.parseCurveSegments = exports.parseLinearRingOrLineString = exports.parsePoint = exports.parsePos = exports.parsePosList = exports.parseGMLToGeometry = exports.parseGML = void 0;
|
|
8
|
+
const xml_1 = require("@loaders.gl/xml");
|
|
9
|
+
const deep_strict_equal_1 = require("./deep-strict-equal");
|
|
10
|
+
const rewind_1 = __importDefault(require("@turf/rewind"));
|
|
11
|
+
function noTransform(...coords) {
|
|
12
|
+
return coords;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parses a typed data structure from raw XML for GML features
|
|
16
|
+
* @note Error handlings is fairly weak
|
|
17
|
+
*/
|
|
18
|
+
function parseGML(text, options) {
|
|
19
|
+
// GeoJSON | null {
|
|
20
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync(text, options);
|
|
21
|
+
options = { transformCoords: noTransform, stride: 2, ...options };
|
|
22
|
+
const context = createChildContext(parsedXML, options, {});
|
|
23
|
+
return parseGMLToGeometry(parsedXML, options, context);
|
|
24
|
+
}
|
|
25
|
+
exports.parseGML = parseGML;
|
|
26
|
+
/** Parse a GeoJSON geometry from GML XML */
|
|
27
|
+
function parseGMLToGeometry(inputXML, options, context) {
|
|
28
|
+
const childContext = createChildContext(inputXML, options, context);
|
|
29
|
+
let geometry = null;
|
|
30
|
+
const [name, xml] = getFirstKeyValue(inputXML);
|
|
31
|
+
switch (name) {
|
|
32
|
+
// case 'gml:MultiPoint':
|
|
33
|
+
// geometry = {
|
|
34
|
+
// type: 'MultiPoint',
|
|
35
|
+
// coordinates: parseMultiPoint(xml, options, childContext)
|
|
36
|
+
// };
|
|
37
|
+
// break;
|
|
38
|
+
case 'gml:LineString':
|
|
39
|
+
geometry = {
|
|
40
|
+
type: 'LineString',
|
|
41
|
+
coordinates: parseLinearRingOrLineString(xml, options, childContext)
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
44
|
+
// case 'gml:MultiLineString':
|
|
45
|
+
// geometry = {
|
|
46
|
+
// type: 'MultiLineString',
|
|
47
|
+
// coordinates: parseMultiLineString(xml, options, childContext)
|
|
48
|
+
// };
|
|
49
|
+
// break;
|
|
50
|
+
case 'gml:Polygon':
|
|
51
|
+
case 'gml:Rectangle':
|
|
52
|
+
geometry = {
|
|
53
|
+
type: 'Polygon',
|
|
54
|
+
coordinates: parsePolygonOrRectangle(xml, options, childContext)
|
|
55
|
+
};
|
|
56
|
+
break;
|
|
57
|
+
case 'gml:Surface':
|
|
58
|
+
geometry = {
|
|
59
|
+
type: 'MultiPolygon',
|
|
60
|
+
coordinates: parseSurface(xml, options, childContext)
|
|
61
|
+
};
|
|
62
|
+
break;
|
|
63
|
+
case 'gml:MultiSurface':
|
|
64
|
+
geometry = {
|
|
65
|
+
type: 'MultiPolygon',
|
|
66
|
+
coordinates: parseMultiSurface(xml, options, childContext)
|
|
67
|
+
};
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
// todo
|
|
73
|
+
return (0, rewind_1.default)(geometry, { mutate: true });
|
|
74
|
+
}
|
|
75
|
+
exports.parseGMLToGeometry = parseGMLToGeometry;
|
|
76
|
+
/** Parse a list of coordinates from a string */
|
|
77
|
+
function parseCoords(s, options, context) {
|
|
78
|
+
const stride = context.srsDimension || options.stride || 2;
|
|
79
|
+
// Handle white space
|
|
80
|
+
const coords = s.replace(/\s+/g, ' ').trim().split(' ');
|
|
81
|
+
if (coords.length === 0 || coords.length % stride !== 0) {
|
|
82
|
+
throw new Error(`invalid coordinates list (stride ${stride})`);
|
|
83
|
+
}
|
|
84
|
+
const points = [];
|
|
85
|
+
for (let i = 0; i < coords.length - 1; i += stride) {
|
|
86
|
+
const point = coords.slice(i, i + stride).map(parseFloat);
|
|
87
|
+
points.push(options.transformCoords?.(...point) || point);
|
|
88
|
+
}
|
|
89
|
+
return points;
|
|
90
|
+
}
|
|
91
|
+
function parsePosList(xml, options, context) {
|
|
92
|
+
const childContext = createChildContext(xml, options, context);
|
|
93
|
+
const coords = textOf(xml);
|
|
94
|
+
if (!coords) {
|
|
95
|
+
throw new Error('invalid gml:posList element');
|
|
96
|
+
}
|
|
97
|
+
return parseCoords(coords, options, childContext);
|
|
98
|
+
}
|
|
99
|
+
exports.parsePosList = parsePosList;
|
|
100
|
+
function parsePos(xml, options, context) {
|
|
101
|
+
const childContext = createChildContext(xml, options, context);
|
|
102
|
+
const coords = textOf(xml);
|
|
103
|
+
if (!coords) {
|
|
104
|
+
throw new Error('invalid gml:pos element');
|
|
105
|
+
}
|
|
106
|
+
const points = parseCoords(coords, options, childContext);
|
|
107
|
+
if (points.length !== 1) {
|
|
108
|
+
throw new Error('gml:pos must have 1 point');
|
|
109
|
+
}
|
|
110
|
+
return points[0];
|
|
111
|
+
}
|
|
112
|
+
exports.parsePos = parsePos;
|
|
113
|
+
function parsePoint(xml, options, context) {
|
|
114
|
+
const childContext = createChildContext(xml, options, context);
|
|
115
|
+
// TODO AV: Parse other gml:Point options
|
|
116
|
+
const pos = findIn(xml, 'gml:pos');
|
|
117
|
+
if (!pos) {
|
|
118
|
+
throw new Error('invalid gml:Point element, expected a gml:pos subelement');
|
|
119
|
+
}
|
|
120
|
+
return parsePos(pos, options, childContext);
|
|
121
|
+
}
|
|
122
|
+
exports.parsePoint = parsePoint;
|
|
123
|
+
function parseLinearRingOrLineString(xml, options, context) {
|
|
124
|
+
// or a LineStringSegment
|
|
125
|
+
const childContext = createChildContext(xml, options, context);
|
|
126
|
+
let points = [];
|
|
127
|
+
const posList = findIn(xml, 'gml:posList');
|
|
128
|
+
if (posList) {
|
|
129
|
+
points = parsePosList(posList, options, childContext);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
133
|
+
switch (childName) {
|
|
134
|
+
case 'gml:Point':
|
|
135
|
+
points.push(parsePoint(childXML, options, childContext));
|
|
136
|
+
break;
|
|
137
|
+
case 'gml:pos':
|
|
138
|
+
points.push(parsePos(childXML, options, childContext));
|
|
139
|
+
break;
|
|
140
|
+
default:
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (points.length === 0) {
|
|
146
|
+
throw new Error(`${xml.name} must have > 0 points`);
|
|
147
|
+
}
|
|
148
|
+
return points;
|
|
149
|
+
}
|
|
150
|
+
exports.parseLinearRingOrLineString = parseLinearRingOrLineString;
|
|
151
|
+
function parseCurveSegments(xml, options, context) {
|
|
152
|
+
const points = [];
|
|
153
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
154
|
+
switch (childName) {
|
|
155
|
+
case 'gml:LineStringSegment':
|
|
156
|
+
const points2 = parseLinearRingOrLineString(childXML, options, context);
|
|
157
|
+
// remove overlapping
|
|
158
|
+
const end = points[points.length - 1];
|
|
159
|
+
const start = points2[0];
|
|
160
|
+
if (end && start && (0, deep_strict_equal_1.deepStrictEqual)(end, start)) {
|
|
161
|
+
points2.shift();
|
|
162
|
+
}
|
|
163
|
+
points.push(...points2);
|
|
164
|
+
break;
|
|
165
|
+
default:
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (points.length === 0) {
|
|
170
|
+
throw new Error('gml:Curve > gml:segments must have > 0 points');
|
|
171
|
+
}
|
|
172
|
+
return points;
|
|
173
|
+
}
|
|
174
|
+
exports.parseCurveSegments = parseCurveSegments;
|
|
175
|
+
function parseRing(xml, options, context) {
|
|
176
|
+
const childContext = createChildContext(xml, options, context);
|
|
177
|
+
const points = [];
|
|
178
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
179
|
+
switch (childName) {
|
|
180
|
+
case 'gml:curveMember':
|
|
181
|
+
let points2;
|
|
182
|
+
const lineString = findIn(childXML, 'gml:LineString');
|
|
183
|
+
if (lineString) {
|
|
184
|
+
points2 = parseLinearRingOrLineString(lineString, options, childContext);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
const segments = findIn(childXML, 'gml:Curve', 'gml:segments');
|
|
188
|
+
if (!segments) {
|
|
189
|
+
throw new Error(`invalid ${childName} element`);
|
|
190
|
+
}
|
|
191
|
+
points2 = parseCurveSegments(segments, options, childContext);
|
|
192
|
+
}
|
|
193
|
+
// remove overlapping
|
|
194
|
+
const end = points[points.length - 1];
|
|
195
|
+
const start = points2[0];
|
|
196
|
+
if (end && start && (0, deep_strict_equal_1.deepStrictEqual)(end, start)) {
|
|
197
|
+
points2.shift();
|
|
198
|
+
}
|
|
199
|
+
points.push(...points2);
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (points.length < 4) {
|
|
204
|
+
throw new Error(`${xml.name} must have >= 4 points`);
|
|
205
|
+
}
|
|
206
|
+
return points;
|
|
207
|
+
}
|
|
208
|
+
exports.parseRing = parseRing;
|
|
209
|
+
function parseExteriorOrInterior(xml, options, context) {
|
|
210
|
+
const linearRing = findIn(xml, 'gml:LinearRing');
|
|
211
|
+
if (linearRing) {
|
|
212
|
+
return parseLinearRingOrLineString(linearRing, options, context);
|
|
213
|
+
}
|
|
214
|
+
const ring = findIn(xml, 'gml:Ring');
|
|
215
|
+
if (!ring) {
|
|
216
|
+
throw new Error(`invalid ${xml.name} element`);
|
|
217
|
+
}
|
|
218
|
+
return parseRing(ring, options, context);
|
|
219
|
+
}
|
|
220
|
+
exports.parseExteriorOrInterior = parseExteriorOrInterior;
|
|
221
|
+
function parsePolygonOrRectangle(xml, options, context) {
|
|
222
|
+
// or PolygonPatch
|
|
223
|
+
const childContext = createChildContext(xml, options, context);
|
|
224
|
+
const exterior = findIn(xml, 'gml:exterior');
|
|
225
|
+
if (!exterior) {
|
|
226
|
+
throw new Error(`invalid ${xml.name} element`);
|
|
227
|
+
}
|
|
228
|
+
const pointLists = [parseExteriorOrInterior(exterior, options, childContext)];
|
|
229
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
230
|
+
switch (childName) {
|
|
231
|
+
case 'gml:interior':
|
|
232
|
+
pointLists.push(parseExteriorOrInterior(childXML, options, childContext));
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return pointLists;
|
|
237
|
+
}
|
|
238
|
+
exports.parsePolygonOrRectangle = parsePolygonOrRectangle;
|
|
239
|
+
function parseSurface(xml, options, context) {
|
|
240
|
+
const childContext = createChildContext(xml, options, context);
|
|
241
|
+
const patches = findIn(xml, 'gml:patches');
|
|
242
|
+
if (!patches) {
|
|
243
|
+
throw new Error(`invalid ${xml.name} element`);
|
|
244
|
+
}
|
|
245
|
+
const polygons = [];
|
|
246
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
247
|
+
switch (childName) {
|
|
248
|
+
case 'gml:PolygonPatch':
|
|
249
|
+
case 'gml:Rectangle':
|
|
250
|
+
polygons.push(parsePolygonOrRectangle(childXML, options, childContext));
|
|
251
|
+
break;
|
|
252
|
+
default:
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (polygons.length === 0) {
|
|
257
|
+
throw new Error(`${xml.name} must have > 0 polygons`);
|
|
258
|
+
}
|
|
259
|
+
return polygons;
|
|
260
|
+
}
|
|
261
|
+
exports.parseSurface = parseSurface;
|
|
262
|
+
function parseCompositeSurface(xml, options, context) {
|
|
263
|
+
const childContext = createChildContext(xml, options, context);
|
|
264
|
+
const polygons = [];
|
|
265
|
+
for (const [childName, childXML] of Object.entries(xml)) {
|
|
266
|
+
switch (childName) {
|
|
267
|
+
case 'gml:surfaceMember':
|
|
268
|
+
case 'gml:surfaceMembers':
|
|
269
|
+
const [c2Name, c2Xml] = getFirstKeyValue(childXML);
|
|
270
|
+
switch (c2Name) {
|
|
271
|
+
case 'gml:Surface':
|
|
272
|
+
polygons.push(...parseSurface(c2Xml, options, childContext));
|
|
273
|
+
break;
|
|
274
|
+
case 'gml:Polygon':
|
|
275
|
+
polygons.push(parsePolygonOrRectangle(c2Xml, options, childContext));
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (polygons.length === 0) {
|
|
282
|
+
throw new Error(`${xml.name} must have > 0 polygons`);
|
|
283
|
+
}
|
|
284
|
+
return polygons;
|
|
285
|
+
}
|
|
286
|
+
exports.parseCompositeSurface = parseCompositeSurface;
|
|
287
|
+
function parseMultiSurface(xml, options, context) {
|
|
288
|
+
let el = xml;
|
|
289
|
+
const surfaceMembers = findIn(xml, 'gml:LinearRing');
|
|
290
|
+
if (surfaceMembers) {
|
|
291
|
+
el = surfaceMembers;
|
|
292
|
+
}
|
|
293
|
+
const polygons = [];
|
|
294
|
+
for (const [childName, childXML] of Object.entries(el)) {
|
|
295
|
+
switch (childName) {
|
|
296
|
+
case 'gml:Surface':
|
|
297
|
+
const polygons2 = parseSurface(childXML, options, context);
|
|
298
|
+
polygons.push(...polygons2);
|
|
299
|
+
break;
|
|
300
|
+
case 'gml:surfaceMember':
|
|
301
|
+
const polygons3 = parseSurfaceMember(childXML, options, context);
|
|
302
|
+
polygons.push(...polygons3);
|
|
303
|
+
break;
|
|
304
|
+
case 'gml:surfaceMembers':
|
|
305
|
+
const polygonXML = findIn(childXML, 'gml:Polygon');
|
|
306
|
+
for (const surfaceMemberXML of polygonXML) {
|
|
307
|
+
const polygons3 = parseSurfaceMember(surfaceMemberXML, options, context);
|
|
308
|
+
polygons.push(...polygons3);
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (polygons.length === 0) {
|
|
314
|
+
throw new Error(`${xml.name} must have > 0 polygons`);
|
|
315
|
+
}
|
|
316
|
+
return polygons;
|
|
317
|
+
}
|
|
318
|
+
exports.parseMultiSurface = parseMultiSurface;
|
|
319
|
+
function parseSurfaceMember(xml, options, context) {
|
|
320
|
+
const [childName, childXml] = getFirstKeyValue(xml);
|
|
321
|
+
switch (childName) {
|
|
322
|
+
case 'gml:CompositeSurface':
|
|
323
|
+
return parseCompositeSurface(childXml, options, context);
|
|
324
|
+
case 'gml:Surface':
|
|
325
|
+
return parseSurface(childXml, options, context);
|
|
326
|
+
case 'gml:Polygon':
|
|
327
|
+
return [parsePolygonOrRectangle(childXml, options, context)];
|
|
328
|
+
}
|
|
329
|
+
throw new Error(`${childName} must have polygons`);
|
|
330
|
+
}
|
|
331
|
+
// Helpers
|
|
332
|
+
function textOf(el) {
|
|
333
|
+
if (typeof el !== 'string') {
|
|
334
|
+
throw new Error('expected string');
|
|
335
|
+
}
|
|
336
|
+
return el;
|
|
337
|
+
}
|
|
338
|
+
function findIn(root, ...tags) {
|
|
339
|
+
let el = root;
|
|
340
|
+
for (const tag of tags) {
|
|
341
|
+
const child = el[tag];
|
|
342
|
+
if (!child) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
el = child;
|
|
346
|
+
}
|
|
347
|
+
return el;
|
|
348
|
+
}
|
|
349
|
+
/** @returns the first [key, value] pair in an object, or ['', null] if empty object */
|
|
350
|
+
function getFirstKeyValue(object) {
|
|
351
|
+
if (object && typeof object === 'object') {
|
|
352
|
+
for (const [key, value] of Object.entries(object)) {
|
|
353
|
+
return [key, value];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return ['', null];
|
|
357
|
+
}
|
|
358
|
+
/** A bit heavyweight for just tracking dimension? */
|
|
359
|
+
function createChildContext(xml, options, context) {
|
|
360
|
+
const srsDimensionAttribute = xml.attributes && xml.attributes.srsDimension;
|
|
361
|
+
if (srsDimensionAttribute) {
|
|
362
|
+
const srsDimension = parseInt(srsDimensionAttribute);
|
|
363
|
+
if (Number.isNaN(srsDimension) || srsDimension <= 0) {
|
|
364
|
+
throw new Error(`invalid srsDimension attribute value "${srsDimensionAttribute}", expected a positive integer`);
|
|
365
|
+
}
|
|
366
|
+
const childContext = Object.create(context);
|
|
367
|
+
childContext.srsDimension = srsDimension;
|
|
368
|
+
return childContext;
|
|
369
|
+
}
|
|
370
|
+
return context;
|
|
371
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Data returned by LERC loader */
|
|
2
|
+
export type LERCData = {
|
|
3
|
+
/** Width of decoded image */
|
|
4
|
+
width: number;
|
|
5
|
+
/** Height of decoded image */
|
|
6
|
+
height: number;
|
|
7
|
+
/** The type of pixels represented in the output */
|
|
8
|
+
pixelType: LercPixelType;
|
|
9
|
+
/** [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values */
|
|
10
|
+
statistics: BandStats[];
|
|
11
|
+
/** [band1, band2, …] Each band is a typed array of width * height * depthCount */
|
|
12
|
+
pixels: TypedArray[];
|
|
13
|
+
/** Typed array with a size of width*height, or null if all pixels are valid */
|
|
14
|
+
mask: Uint8Array;
|
|
15
|
+
/** Depth count */
|
|
16
|
+
depthCount: number;
|
|
17
|
+
/** array [band1_mask, band2_mask, …] Each band is a Uint8Array of width * height * depthCount */
|
|
18
|
+
bandMasks?: Uint8Array[];
|
|
19
|
+
};
|
|
20
|
+
export type LercPixelType = 'S8' | 'U8' | 'S16' | 'U16' | 'S32' | 'U32' | 'F32' | 'F64';
|
|
21
|
+
export interface BandStats {
|
|
22
|
+
minValue: number;
|
|
23
|
+
maxValue: number;
|
|
24
|
+
depthStats?: {
|
|
25
|
+
minValues: Float64Array;
|
|
26
|
+
maxValues: Float64Array;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
30
|
+
//# sourceMappingURL=lerc-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lerc-types.d.ts","sourceRoot":"","sources":["../../../src/lib/lerc/lerc-types.ts"],"names":[],"mappings":"AAEA,mCAAmC;AACnC,MAAM,MAAM,QAAQ,GAAG;IACrB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,SAAS,EAAE,aAAa,CAAC;IACzB,mHAAmH;IACnH,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,kFAAkF;IAClF,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,+EAA+E;IAC/E,IAAI,EAAE,UAAU,CAAC;IACjB,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAExF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,SAAS,EAAE,YAAY,CAAC;QACxB,SAAS,EAAE,YAAY,CAAC;KACzB,CAAC;CACH;AAED,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WFSCapabilities } from './wcs-types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
4
|
+
* @note Error handlings is fairly weak
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseWFSCapabilities(text: string, options: any): WFSCapabilities;
|
|
7
|
+
//# sourceMappingURL=parse-wcs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wcs.d.ts","sourceRoot":"","sources":["../../../src/lib/wcs/parse-wcs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAMjD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAA,GAAG,eAAe,CAM3E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.parseWFSCapabilities = void 0;
|
|
5
|
+
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
+
// GetCapabilities
|
|
7
|
+
/**
|
|
8
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
9
|
+
* @note Error handlings is fairly weak
|
|
10
|
+
*/
|
|
11
|
+
function parseWFSCapabilities(text, options) {
|
|
12
|
+
// Remove namespaces in XML
|
|
13
|
+
options = { ...options, xml: { ...options?.xml, removeNSPrefix: true } };
|
|
14
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync(text, options);
|
|
15
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
16
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
17
|
+
}
|
|
18
|
+
exports.parseWFSCapabilities = parseWFSCapabilities;
|
|
19
|
+
function uncapitalizeKeys(object) {
|
|
20
|
+
if (object && typeof object === 'object') {
|
|
21
|
+
const newObject = {};
|
|
22
|
+
for (const [key, value] of Object.entries(object)) {
|
|
23
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
24
|
+
}
|
|
25
|
+
return newObject;
|
|
26
|
+
}
|
|
27
|
+
return object;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Uncapitalize first letter of a string
|
|
31
|
+
* @param {string} str
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
function uncapitalize(str) {
|
|
35
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
36
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */
|
|
2
|
+
export type WFSCapabilities = {
|
|
3
|
+
serviceIdentification: {
|
|
4
|
+
title: string;
|
|
5
|
+
serviceTypeVersion: string;
|
|
6
|
+
serviceType: string;
|
|
7
|
+
};
|
|
8
|
+
serviceProvider: {
|
|
9
|
+
providerName: string;
|
|
10
|
+
providerSite: string;
|
|
11
|
+
serviceContact: {
|
|
12
|
+
individualName: string;
|
|
13
|
+
positionName: string;
|
|
14
|
+
contactInfo: {
|
|
15
|
+
address: {
|
|
16
|
+
administrativeArea: string;
|
|
17
|
+
city: string;
|
|
18
|
+
country: string;
|
|
19
|
+
deliveryPoint: string;
|
|
20
|
+
electronicMailAddress: string;
|
|
21
|
+
postalCode: string;
|
|
22
|
+
};
|
|
23
|
+
phone: {
|
|
24
|
+
voice: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
operationsMetadata: {
|
|
30
|
+
GetCapabilities: any;
|
|
31
|
+
GetFeatureInfo: any;
|
|
32
|
+
GetTile: any;
|
|
33
|
+
};
|
|
34
|
+
contents: {
|
|
35
|
+
layers: {
|
|
36
|
+
abstract: string;
|
|
37
|
+
identifier: string;
|
|
38
|
+
title: string;
|
|
39
|
+
formats: string[];
|
|
40
|
+
styles: {
|
|
41
|
+
identifier: string;
|
|
42
|
+
isDefault: string;
|
|
43
|
+
title: string;
|
|
44
|
+
abstract?: string;
|
|
45
|
+
}[];
|
|
46
|
+
bounds: {
|
|
47
|
+
left: number;
|
|
48
|
+
right: number;
|
|
49
|
+
bottom: number;
|
|
50
|
+
top: number;
|
|
51
|
+
};
|
|
52
|
+
tileMatrixSetLinks: {
|
|
53
|
+
tileMatrixSet: string;
|
|
54
|
+
}[];
|
|
55
|
+
tileMatrixSets: {
|
|
56
|
+
identifier: string;
|
|
57
|
+
matrixIds: {
|
|
58
|
+
identifier: string;
|
|
59
|
+
matrixHeight: number;
|
|
60
|
+
matrixWidth: number;
|
|
61
|
+
scaleDenominator: number;
|
|
62
|
+
tileWidth: number;
|
|
63
|
+
tileHeight: number;
|
|
64
|
+
topLeftCorner: {
|
|
65
|
+
lon: number;
|
|
66
|
+
lat: number;
|
|
67
|
+
};
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=wcs-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wcs-types.d.ts","sourceRoot":"","sources":["../../../src/lib/wcs/wcs-types.ts"],"names":[],"mappings":"AAEA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC5B,qBAAqB,EAAE;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB,EAAE,MAAM,CAAC;QAC3B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,eAAe,EAAE;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE;YACd,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE;gBACX,OAAO,EAAE;oBACP,kBAAkB,EAAE,MAAM,CAAC;oBAC3B,IAAI,EAAE,MAAM,CAAC;oBACb,OAAO,EAAE,MAAM,CAAC;oBAChB,aAAa,EAAE,MAAM,CAAC;oBACtB,qBAAqB,EAAE,MAAM,CAAC;oBAC9B,UAAU,EAAE,MAAM,CAAC;iBACpB,CAAC;gBACF,KAAK,EAAE;oBACL,KAAK,EAAE,MAAM,CAAC;iBACf,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IAEF,kBAAkB,EAAE;QAClB,eAAe,EAAE,GAAG,CAAC;QACrB,cAAc,EAAE,GAAG,CAAC;QACpB,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAEF,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,OAAO,EAAE,MAAM,EAAE,CAAC;YAClB,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC;gBAClB,KAAK,EAAE,MAAM,CAAC;gBACd,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,EAAE,CAAC;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM,CAAC;gBACb,KAAK,EAAE,MAAM,CAAC;gBACd,MAAM,EAAE,MAAM,CAAC;gBACf,GAAG,EAAE,MAAM,CAAC;aACb,CAAC;YACF,kBAAkB,EAAE;gBAClB,aAAa,EAAE,MAAM,CAAC;aACvB,EAAE,CAAC;YACJ,cAAc,EAAE;gBACd,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE;oBACT,UAAU,EAAE,MAAM,CAAC;oBACnB,YAAY,EAAE,MAAM,CAAC;oBACrB,WAAW,EAAE,MAAM,CAAC;oBACpB,gBAAgB,EAAE,MAAM,CAAC;oBACzB,SAAS,EAAE,MAAM,CAAC;oBAClB,UAAU,EAAE,MAAM,CAAC;oBACnB,aAAa,EAAE;wBACb,GAAG,EAAE,MAAM,CAAC;wBACZ,GAAG,EAAE,MAAM,CAAC;qBACb,CAAC;iBACH,EAAE,CAAC;aACL,CAAC;SACH,EAAE,CAAC;KACL,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WFSCapabilities } from './wfs-types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
4
|
+
* @note Error handlings is fairly weak
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseWFSCapabilities(text: string, options: any): WFSCapabilities;
|
|
7
|
+
//# sourceMappingURL=parse-wfs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wfs.d.ts","sourceRoot":"","sources":["../../../src/lib/wfs/parse-wfs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAMjD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAA,GAAG,eAAe,CAM3E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.parseWFSCapabilities = void 0;
|
|
5
|
+
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
+
// GetCapabilities
|
|
7
|
+
/**
|
|
8
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
9
|
+
* @note Error handlings is fairly weak
|
|
10
|
+
*/
|
|
11
|
+
function parseWFSCapabilities(text, options) {
|
|
12
|
+
// Remove namespaces in XML
|
|
13
|
+
options = { ...options, xml: { ...options?.xml, removeNSPrefix: true } };
|
|
14
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync(text, options);
|
|
15
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
16
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
17
|
+
}
|
|
18
|
+
exports.parseWFSCapabilities = parseWFSCapabilities;
|
|
19
|
+
function uncapitalizeKeys(object) {
|
|
20
|
+
if (object && typeof object === 'object') {
|
|
21
|
+
const newObject = {};
|
|
22
|
+
for (const [key, value] of Object.entries(object)) {
|
|
23
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
24
|
+
}
|
|
25
|
+
return newObject;
|
|
26
|
+
}
|
|
27
|
+
return object;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Uncapitalize first letter of a string
|
|
31
|
+
* @param {string} str
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
function uncapitalize(str) {
|
|
35
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
36
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */
|
|
2
|
+
export type WFSCapabilities = {
|
|
3
|
+
serviceIdentification: {
|
|
4
|
+
title: string;
|
|
5
|
+
serviceTypeVersion: string;
|
|
6
|
+
serviceType: string;
|
|
7
|
+
};
|
|
8
|
+
serviceProvider: {
|
|
9
|
+
providerName: string;
|
|
10
|
+
providerSite: string;
|
|
11
|
+
serviceContact: {
|
|
12
|
+
individualName: string;
|
|
13
|
+
positionName: string;
|
|
14
|
+
contactInfo: {
|
|
15
|
+
address: {
|
|
16
|
+
administrativeArea: string;
|
|
17
|
+
city: string;
|
|
18
|
+
country: string;
|
|
19
|
+
deliveryPoint: string;
|
|
20
|
+
electronicMailAddress: string;
|
|
21
|
+
postalCode: string;
|
|
22
|
+
};
|
|
23
|
+
phone: {
|
|
24
|
+
voice: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
operationsMetadata: {
|
|
30
|
+
GetCapabilities: any;
|
|
31
|
+
GetFeatureInfo: any;
|
|
32
|
+
GetTile: any;
|
|
33
|
+
};
|
|
34
|
+
contents: {
|
|
35
|
+
layers: {
|
|
36
|
+
abstract: string;
|
|
37
|
+
identifier: string;
|
|
38
|
+
title: string;
|
|
39
|
+
formats: string[];
|
|
40
|
+
styles: {
|
|
41
|
+
identifier: string;
|
|
42
|
+
isDefault: string;
|
|
43
|
+
title: string;
|
|
44
|
+
abstract?: string;
|
|
45
|
+
}[];
|
|
46
|
+
bounds: {
|
|
47
|
+
left: number;
|
|
48
|
+
right: number;
|
|
49
|
+
bottom: number;
|
|
50
|
+
top: number;
|
|
51
|
+
};
|
|
52
|
+
tileMatrixSetLinks: {
|
|
53
|
+
tileMatrixSet: string;
|
|
54
|
+
}[];
|
|
55
|
+
tileMatrixSets: {
|
|
56
|
+
identifier: string;
|
|
57
|
+
matrixIds: {
|
|
58
|
+
identifier: string;
|
|
59
|
+
matrixHeight: number;
|
|
60
|
+
matrixWidth: number;
|
|
61
|
+
scaleDenominator: number;
|
|
62
|
+
tileWidth: number;
|
|
63
|
+
tileHeight: number;
|
|
64
|
+
topLeftCorner: {
|
|
65
|
+
lon: number;
|
|
66
|
+
lat: number;
|
|
67
|
+
};
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=wfs-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wfs-types.d.ts","sourceRoot":"","sources":["../../../src/lib/wfs/wfs-types.ts"],"names":[],"mappings":"AAEA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC1B,qBAAqB,EAAE;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB,EAAE,MAAM,CAAC;QAC3B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,eAAe,EAAE;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE;YACd,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE;gBACX,OAAO,EAAE;oBACP,kBAAkB,EAAE,MAAM,CAAC;oBAC3B,IAAI,EAAE,MAAM,CAAC;oBACb,OAAO,EAAE,MAAM,CAAC;oBAChB,aAAa,EAAE,MAAM,CAAC;oBACtB,qBAAqB,EAAE,MAAM,CAAC;oBAC9B,UAAU,EAAE,MAAM,CAAC;iBACpB,CAAC;gBACF,KAAK,EAAE;oBACL,KAAK,EAAE,MAAM,CAAC;iBACf,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IAEF,kBAAkB,EAAE;QAClB,eAAe,EAAE,GAAG,CAAC;QACrB,cAAc,EAAE,GAAG,CAAC;QACpB,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAEF,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,OAAO,EAAE,MAAM,EAAE,CAAC;YAClB,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC;gBAClB,KAAK,EAAE,MAAM,CAAC;gBACd,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,EAAE,CAAC;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM,CAAC;gBACb,KAAK,EAAE,MAAM,CAAC;gBACd,MAAM,EAAE,MAAM,CAAC;gBACf,GAAG,EAAE,MAAM,CAAC;aACb,CAAC;YACF,kBAAkB,EAAE;gBAClB,aAAa,EAAE,MAAM,CAAC;aACvB,EAAE,CAAC;YACJ,cAAc,EAAE;gBACd,UAAU,EAAE,MAAM,CAAC;gBACnB,SAAS,EAAE;oBACT,UAAU,EAAE,MAAM,CAAC;oBACnB,YAAY,EAAE,MAAM,CAAC;oBACrB,WAAW,EAAE,MAAM,CAAC;oBACpB,gBAAgB,EAAE,MAAM,CAAC;oBACzB,SAAS,EAAE,MAAM,CAAC;oBAClB,UAAU,EAAE,MAAM,CAAC;oBACnB,aAAa,EAAE;wBACb,GAAG,EAAE,MAAM,CAAC;wBACZ,GAAG,EAAE,MAAM,CAAC;qBACb,CAAC;iBACH,EAAE,CAAC;aACL,CAAC;SACH,EAAE,CAAC;KACL,CAAC;CACH,CAAC"}
|