@loaders.gl/ogc 0.0.0-stage → 5.0.0-alpha.14
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/LICENSE +52 -0
- package/README.md +10 -2
- package/dist/index.cjs +7052 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/stac/index.cjs +1095 -0
- package/dist/stac/index.cjs.map +6 -0
- package/dist/stac/index.d.ts +4 -0
- package/dist/stac/index.d.ts.map +1 -0
- package/dist/stac/index.js +5 -0
- package/dist/stac/index.js.map +1 -0
- package/dist/stac/stac-source-loader-types.d.ts +44 -0
- package/dist/stac/stac-source-loader-types.d.ts.map +1 -0
- package/dist/stac/stac-source-loader-types.js +43 -0
- package/dist/stac/stac-source-loader-types.js.map +1 -0
- package/dist/stac/stac-source.cjs +1544 -0
- package/dist/stac/stac-source.cjs.map +6 -0
- package/dist/stac/stac-source.d.ts +92 -0
- package/dist/stac/stac-source.d.ts.map +1 -0
- package/dist/stac/stac-source.js +500 -0
- package/dist/stac/stac-source.js.map +1 -0
- package/dist/stac/stac-types.d.ts +213 -0
- package/dist/stac/stac-types.d.ts.map +1 -0
- package/dist/stac/stac-types.js +5 -0
- package/dist/stac/stac-types.js.map +1 -0
- package/dist/wms/bundled.cjs +7295 -0
- package/dist/wms/bundled.cjs.map +6 -0
- package/dist/wms/bundled.d.ts +24 -0
- package/dist/wms/bundled.d.ts.map +1 -0
- package/dist/wms/bundled.js +18 -0
- package/dist/wms/bundled.js.map +1 -0
- package/dist/wms/capability-graph.d.ts +42 -0
- package/dist/wms/capability-graph.d.ts.map +1 -0
- package/dist/wms/capability-graph.js +118 -0
- package/dist/wms/capability-graph.js.map +1 -0
- package/dist/wms/crs-utils.d.ts +24 -0
- package/dist/wms/crs-utils.d.ts.map +1 -0
- package/dist/wms/crs-utils.js +57 -0
- package/dist/wms/crs-utils.js.map +1 -0
- package/dist/wms/csw-capabilities-loader-with-parser.d.ts +34 -0
- package/dist/wms/csw-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/csw-capabilities-loader-with-parser.js +15 -0
- package/dist/wms/csw-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/csw-capabilities-loader.d.ts +56 -0
- package/dist/wms/csw-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/csw-capabilities-loader.js +38 -0
- package/dist/wms/csw-capabilities-loader.js.map +1 -0
- package/dist/wms/csw-domain-loader-with-parser.d.ts +33 -0
- package/dist/wms/csw-domain-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/csw-domain-loader-with-parser.js +15 -0
- package/dist/wms/csw-domain-loader-with-parser.js.map +1 -0
- package/dist/wms/csw-domain-loader.d.ts +55 -0
- package/dist/wms/csw-domain-loader.d.ts.map +1 -0
- package/dist/wms/csw-domain-loader.js +38 -0
- package/dist/wms/csw-domain-loader.js.map +1 -0
- package/dist/wms/csw-records-loader-with-parser.d.ts +33 -0
- package/dist/wms/csw-records-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/csw-records-loader-with-parser.js +15 -0
- package/dist/wms/csw-records-loader-with-parser.js.map +1 -0
- package/dist/wms/csw-records-loader.d.ts +55 -0
- package/dist/wms/csw-records-loader.d.ts.map +1 -0
- package/dist/wms/csw-records-loader.js +38 -0
- package/dist/wms/csw-records-loader.js.map +1 -0
- package/dist/wms/csw-source-loader.d.ts +165 -0
- package/dist/wms/csw-source-loader.d.ts.map +1 -0
- package/dist/wms/csw-source-loader.js +203 -0
- package/dist/wms/csw-source-loader.js.map +1 -0
- package/dist/wms/feature-pagination.d.ts +34 -0
- package/dist/wms/feature-pagination.d.ts.map +1 -0
- package/dist/wms/feature-pagination.js +159 -0
- package/dist/wms/feature-pagination.js.map +1 -0
- package/dist/wms/gml-loader-types.d.ts +68 -0
- package/dist/wms/gml-loader-types.d.ts.map +1 -0
- package/dist/wms/gml-loader-types.js +38 -0
- package/dist/wms/gml-loader-types.js.map +1 -0
- package/dist/wms/gml-loader.cjs +5779 -0
- package/dist/wms/gml-loader.cjs.map +6 -0
- package/dist/wms/gml-loader.d.ts +38 -0
- package/dist/wms/gml-loader.d.ts.map +1 -0
- package/dist/wms/gml-loader.js +195 -0
- package/dist/wms/gml-loader.js.map +1 -0
- package/dist/wms/index.cjs +12416 -0
- package/dist/wms/index.cjs.map +6 -0
- package/dist/wms/index.d.ts +61 -0
- package/dist/wms/index.d.ts.map +1 -0
- package/dist/wms/index.js +36 -0
- package/dist/wms/index.js.map +1 -0
- package/dist/wms/lib/deprecated/create-image-source.d.ts +27 -0
- package/dist/wms/lib/deprecated/create-image-source.d.ts.map +1 -0
- package/dist/wms/lib/deprecated/create-image-source.js +44 -0
- package/dist/wms/lib/deprecated/create-image-source.js.map +1 -0
- package/dist/wms/lib/deprecated/image-source-compatibility.d.ts +14 -0
- package/dist/wms/lib/deprecated/image-source-compatibility.d.ts.map +1 -0
- package/dist/wms/lib/deprecated/image-source-compatibility.js +21 -0
- package/dist/wms/lib/deprecated/image-source-compatibility.js.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-capabilities.d.ts +79 -0
- package/dist/wms/lib/parsers/csw/parse-csw-capabilities.d.ts.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-capabilities.js +23 -0
- package/dist/wms/lib/parsers/csw/parse-csw-capabilities.js.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-domain.d.ts +17 -0
- package/dist/wms/lib/parsers/csw/parse-csw-domain.d.ts.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-domain.js +32 -0
- package/dist/wms/lib/parsers/csw/parse-csw-domain.js.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-records.d.ts +34 -0
- package/dist/wms/lib/parsers/csw/parse-csw-records.d.ts.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-csw-records.js +56 -0
- package/dist/wms/lib/parsers/csw/parse-csw-records.js.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-exception-report.d.ts +6 -0
- package/dist/wms/lib/parsers/csw/parse-exception-report.d.ts.map +1 -0
- package/dist/wms/lib/parsers/csw/parse-exception-report.js +29 -0
- package/dist/wms/lib/parsers/csw/parse-exception-report.js.map +1 -0
- package/dist/wms/lib/parsers/gml/deep-strict-equal.d.ts +3 -0
- package/dist/wms/lib/parsers/gml/deep-strict-equal.d.ts.map +1 -0
- package/dist/wms/lib/parsers/gml/deep-strict-equal.js +118 -0
- package/dist/wms/lib/parsers/gml/deep-strict-equal.js.map +1 -0
- package/dist/wms/lib/parsers/gml/parse-gml.d.ts +66 -0
- package/dist/wms/lib/parsers/gml/parse-gml.d.ts.map +1 -0
- package/dist/wms/lib/parsers/gml/parse-gml.js +641 -0
- package/dist/wms/lib/parsers/gml/parse-gml.js.map +1 -0
- package/dist/wms/lib/parsers/gml/rewind-geometry.d.ts +4 -0
- package/dist/wms/lib/parsers/gml/rewind-geometry.d.ts.map +1 -0
- package/dist/wms/lib/parsers/gml/rewind-geometry.js +45 -0
- package/dist/wms/lib/parsers/gml/rewind-geometry.js.map +1 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-limits.d.ts +19 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-limits.d.ts.map +1 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-limits.js +74 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-limits.js.map +1 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-set.d.ts +63 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-set.d.ts.map +1 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-set.js +82 -0
- package/dist/wms/lib/parsers/ogc-api/tile-matrix-set.js.map +1 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs-capabilities.d.ts +97 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs-capabilities.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs-capabilities.js +60 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs-capabilities.js.map +1 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs.d.ts +7 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs.js +31 -0
- package/dist/wms/lib/parsers/wfs/parse-wfs.js.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-capabilities.d.ts +126 -0
- package/dist/wms/lib/parsers/wms/parse-wms-capabilities.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-capabilities.js +232 -0
- package/dist/wms/lib/parsers/wms/parse-wms-capabilities.js.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-error.d.ts +8 -0
- package/dist/wms/lib/parsers/wms/parse-wms-error.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-error.js +21 -0
- package/dist/wms/lib/parsers/wms/parse-wms-error.js.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-features.d.ts +20 -0
- package/dist/wms/lib/parsers/wms/parse-wms-features.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-features.js +26 -0
- package/dist/wms/lib/parsers/wms/parse-wms-features.js.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-layer-description.d.ts +11 -0
- package/dist/wms/lib/parsers/wms/parse-wms-layer-description.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wms/parse-wms-layer-description.js +14 -0
- package/dist/wms/lib/parsers/wms/parse-wms-layer-description.js.map +1 -0
- package/dist/wms/lib/parsers/wmts/parse-wmts-capabilities.d.ts +101 -0
- package/dist/wms/lib/parsers/wmts/parse-wmts-capabilities.d.ts.map +1 -0
- package/dist/wms/lib/parsers/wmts/parse-wmts-capabilities.js +175 -0
- package/dist/wms/lib/parsers/wmts/parse-wmts-capabilities.js.map +1 -0
- package/dist/wms/lib/parsers/xml/parse-xml-helpers.d.ts +11 -0
- package/dist/wms/lib/parsers/xml/parse-xml-helpers.d.ts.map +1 -0
- package/dist/wms/lib/parsers/xml/parse-xml-helpers.js +63 -0
- package/dist/wms/lib/parsers/xml/parse-xml-helpers.js.map +1 -0
- package/dist/wms/lib/parsers/xml/parse-xml-text.d.ts +4 -0
- package/dist/wms/lib/parsers/xml/parse-xml-text.d.ts.map +1 -0
- package/dist/wms/lib/parsers/xml/parse-xml-text.js +9 -0
- package/dist/wms/lib/parsers/xml/parse-xml-text.js.map +1 -0
- package/dist/wms/lib/tile-grid.d.ts +14 -0
- package/dist/wms/lib/tile-grid.d.ts.map +1 -0
- package/dist/wms/lib/tile-grid.js +28 -0
- package/dist/wms/lib/tile-grid.js.map +1 -0
- package/dist/wms/managed-vector-source.d.ts +66 -0
- package/dist/wms/managed-vector-source.d.ts.map +1 -0
- package/dist/wms/managed-vector-source.js +307 -0
- package/dist/wms/managed-vector-source.js.map +1 -0
- package/dist/wms/ogc-api-coverages-source-loader.d.ts +64 -0
- package/dist/wms/ogc-api-coverages-source-loader.d.ts.map +1 -0
- package/dist/wms/ogc-api-coverages-source-loader.js +78 -0
- package/dist/wms/ogc-api-coverages-source-loader.js.map +1 -0
- package/dist/wms/ogc-api-edr-source-loader.d.ts +72 -0
- package/dist/wms/ogc-api-edr-source-loader.d.ts.map +1 -0
- package/dist/wms/ogc-api-edr-source-loader.js +82 -0
- package/dist/wms/ogc-api-edr-source-loader.js.map +1 -0
- package/dist/wms/ogc-api-source-loader.d.ts +223 -0
- package/dist/wms/ogc-api-source-loader.d.ts.map +1 -0
- package/dist/wms/ogc-api-source-loader.js +517 -0
- package/dist/wms/ogc-api-source-loader.js.map +1 -0
- package/dist/wms/service-capabilities.d.ts +17 -0
- package/dist/wms/service-capabilities.d.ts.map +1 -0
- package/dist/wms/service-capabilities.js +110 -0
- package/dist/wms/service-capabilities.js.map +1 -0
- package/dist/wms/service-runtime.d.ts +67 -0
- package/dist/wms/service-runtime.d.ts.map +1 -0
- package/dist/wms/service-runtime.js +165 -0
- package/dist/wms/service-runtime.js.map +1 -0
- package/dist/wms/unbundled.cjs +5995 -0
- package/dist/wms/unbundled.cjs.map +6 -0
- package/dist/wms/unbundled.d.ts +18 -0
- package/dist/wms/unbundled.d.ts.map +1 -0
- package/dist/wms/unbundled.js +12 -0
- package/dist/wms/unbundled.js.map +1 -0
- package/dist/wms/wcs-source-loader.d.ts +99 -0
- package/dist/wms/wcs-source-loader.d.ts.map +1 -0
- package/dist/wms/wcs-source-loader.js +178 -0
- package/dist/wms/wcs-source-loader.js.map +1 -0
- package/dist/wms/wfs-capabilities-loader-with-parser.d.ts +35 -0
- package/dist/wms/wfs-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wfs-capabilities-loader-with-parser.js +17 -0
- package/dist/wms/wfs-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/wfs-capabilities-loader.d.ts +59 -0
- package/dist/wms/wfs-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/wfs-capabilities-loader.js +42 -0
- package/dist/wms/wfs-capabilities-loader.js.map +1 -0
- package/dist/wms/wfs-source-loader.d.ts +353 -0
- package/dist/wms/wfs-source-loader.d.ts.map +1 -0
- package/dist/wms/wfs-source-loader.js +606 -0
- package/dist/wms/wfs-source-loader.js.map +1 -0
- package/dist/wms/wip/data-source.d.ts +54 -0
- package/dist/wms/wip/data-source.d.ts.map +1 -0
- package/dist/wms/wip/data-source.js +62 -0
- package/dist/wms/wip/data-source.js.map +1 -0
- package/dist/wms/wip/lib/wcs/parse-wcs-capabilities.d.ts +78 -0
- package/dist/wms/wip/lib/wcs/parse-wcs-capabilities.d.ts.map +1 -0
- package/dist/wms/wip/lib/wcs/parse-wcs-capabilities.js +14 -0
- package/dist/wms/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -0
- package/dist/wms/wip/lib/wmts/parse-wmts-capabilities.d.ts +87 -0
- package/dist/wms/wip/lib/wmts/parse-wmts-capabilities.d.ts.map +1 -0
- package/dist/wms/wip/lib/wmts/parse-wmts-capabilities.js +76 -0
- package/dist/wms/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -0
- package/dist/wms/wip/lib/wmts/parse-wmts.d.ts +7 -0
- package/dist/wms/wip/lib/wmts/parse-wmts.d.ts.map +1 -0
- package/dist/wms/wip/lib/wmts/parse-wmts.js +34 -0
- package/dist/wms/wip/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/wms/wip/wcs-capabilities-loader-with-parser.d.ts +12 -0
- package/dist/wms/wip/wcs-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wip/wcs-capabilities-loader-with-parser.js +16 -0
- package/dist/wms/wip/wcs-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/wip/wcs-capabilities-loader.d.ts +12 -0
- package/dist/wms/wip/wcs-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/wip/wcs-capabilities-loader.js +36 -0
- package/dist/wms/wip/wcs-capabilities-loader.js.map +1 -0
- package/dist/wms/wip/wms-feature-info-loader-with-parser.d.ts +7 -0
- package/dist/wms/wip/wms-feature-info-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wip/wms-feature-info-loader-with-parser.js +15 -0
- package/dist/wms/wip/wms-feature-info-loader-with-parser.js.map +1 -0
- package/dist/wms/wip/wms-feature-info-loader.d.ts +7 -0
- package/dist/wms/wip/wms-feature-info-loader.d.ts.map +1 -0
- package/dist/wms/wip/wms-feature-info-loader.js +19 -0
- package/dist/wms/wip/wms-feature-info-loader.js.map +1 -0
- package/dist/wms/wip/wms-layer-description-loader-with-parser.d.ts +7 -0
- package/dist/wms/wip/wms-layer-description-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wip/wms-layer-description-loader-with-parser.js +15 -0
- package/dist/wms/wip/wms-layer-description-loader-with-parser.js.map +1 -0
- package/dist/wms/wip/wms-layer-description-loader.d.ts +7 -0
- package/dist/wms/wip/wms-layer-description-loader.d.ts.map +1 -0
- package/dist/wms/wip/wms-layer-description-loader.js +19 -0
- package/dist/wms/wip/wms-layer-description-loader.js.map +1 -0
- package/dist/wms/wip/wmts-capabilities-loader-with-parser.d.ts +11 -0
- package/dist/wms/wip/wmts-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wip/wmts-capabilities-loader-with-parser.js +17 -0
- package/dist/wms/wip/wmts-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/wip/wmts-capabilities-loader.d.ts +11 -0
- package/dist/wms/wip/wmts-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/wip/wmts-capabilities-loader.js +36 -0
- package/dist/wms/wip/wmts-capabilities-loader.js.map +1 -0
- package/dist/wms/wms-capabilities-loader-with-parser.d.ts +40 -0
- package/dist/wms/wms-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wms-capabilities-loader-with-parser.js +19 -0
- package/dist/wms/wms-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/wms-capabilities-loader.d.ts +62 -0
- package/dist/wms/wms-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/wms-capabilities-loader.js +38 -0
- package/dist/wms/wms-capabilities-loader.js.map +1 -0
- package/dist/wms/wms-error-loader-with-parser.d.ts +39 -0
- package/dist/wms/wms-error-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wms-error-loader-with-parser.js +28 -0
- package/dist/wms/wms-error-loader-with-parser.js.map +1 -0
- package/dist/wms/wms-error-loader.d.ts +64 -0
- package/dist/wms/wms-error-loader.d.ts.map +1 -0
- package/dist/wms/wms-error-loader.js +40 -0
- package/dist/wms/wms-error-loader.js.map +1 -0
- package/dist/wms/wms-format.d.ts +13 -0
- package/dist/wms/wms-format.d.ts.map +1 -0
- package/dist/wms/wms-format.js +25 -0
- package/dist/wms/wms-format.js.map +1 -0
- package/dist/wms/wms-source-loader.d.ts +226 -0
- package/dist/wms/wms-source-loader.d.ts.map +1 -0
- package/dist/wms/wms-source-loader.js +397 -0
- package/dist/wms/wms-source-loader.js.map +1 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.cjs +2189 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.cjs.map +6 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.d.ts +3 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.d.ts.map +1 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.js +13 -0
- package/dist/wms/wmts-capabilities-loader-with-parser.js.map +1 -0
- package/dist/wms/wmts-capabilities-loader.d.ts +7 -0
- package/dist/wms/wmts-capabilities-loader.d.ts.map +1 -0
- package/dist/wms/wmts-capabilities-loader.js +24 -0
- package/dist/wms/wmts-capabilities-loader.js.map +1 -0
- package/dist/wms/wmts-source-loader.d.ts +120 -0
- package/dist/wms/wmts-source-loader.d.ts.map +1 -0
- package/dist/wms/wmts-source-loader.js +472 -0
- package/dist/wms/wmts-source-loader.js.map +1 -0
- package/package.json +89 -4
- package/src/index.ts +6 -0
- package/src/stac/index.ts +25 -0
- package/src/stac/stac-source-loader-types.ts +65 -0
- package/src/stac/stac-source.ts +635 -0
- package/src/stac/stac-types.ts +230 -0
- package/src/wms/bundled.ts +30 -0
- package/src/wms/capability-graph.ts +152 -0
- package/src/wms/crs-utils.ts +67 -0
- package/src/wms/csw-capabilities-loader-with-parser.ts +30 -0
- package/src/wms/csw-capabilities-loader.ts +54 -0
- package/src/wms/csw-domain-loader-with-parser.ts +28 -0
- package/src/wms/csw-domain-loader.ts +53 -0
- package/src/wms/csw-records-loader-with-parser.ts +28 -0
- package/src/wms/csw-records-loader.ts +52 -0
- package/src/wms/csw-source-loader.ts +330 -0
- package/src/wms/feature-pagination.ts +198 -0
- package/src/wms/gml-loader-types.ts +62 -0
- package/src/wms/gml-loader.ts +228 -0
- package/src/wms/index.ts +171 -0
- package/src/wms/lib/deprecated/create-image-service.ts.disabled +57 -0
- package/src/wms/lib/deprecated/create-image-source.ts +75 -0
- package/src/wms/lib/deprecated/image-source-compatibility.ts +28 -0
- package/src/wms/lib/deprecated/template-image-service.ts.disabled +68 -0
- package/src/wms/lib/parsers/csw/parse-csw-capabilities.ts +105 -0
- package/src/wms/lib/parsers/csw/parse-csw-domain.ts +47 -0
- package/src/wms/lib/parsers/csw/parse-csw-records.ts +94 -0
- package/src/wms/lib/parsers/csw/parse-exception-report.ts +33 -0
- package/src/wms/lib/parsers/gml/deep-strict-equal.ts +122 -0
- package/src/wms/lib/parsers/gml/parse-gml.ts +849 -0
- package/src/wms/lib/parsers/gml/rewind-geometry.ts +45 -0
- package/src/wms/lib/parsers/ogc-api/tile-matrix-limits.ts +107 -0
- package/src/wms/lib/parsers/ogc-api/tile-matrix-set.ts +167 -0
- package/src/wms/lib/parsers/wfs/parse-wfs-capabilities.ts +165 -0
- package/src/wms/lib/parsers/wfs/parse-wfs.ts +36 -0
- package/src/wms/lib/parsers/wms/parse-wms-capabilities.ts +427 -0
- package/src/wms/lib/parsers/wms/parse-wms-error.ts +24 -0
- package/src/wms/lib/parsers/wms/parse-wms-features.ts +41 -0
- package/src/wms/lib/parsers/wms/parse-wms-layer-description.ts +24 -0
- package/src/wms/lib/parsers/wmts/parse-wmts-capabilities.ts +281 -0
- package/src/wms/lib/parsers/xml/parse-xml-helpers.ts +67 -0
- package/src/wms/lib/parsers/xml/parse-xml-text.ts +11 -0
- package/src/wms/lib/tile-grid.ts +47 -0
- package/src/wms/managed-vector-source.ts +384 -0
- package/src/wms/ogc-api-coverages-source-loader.ts +109 -0
- package/src/wms/ogc-api-edr-source-loader.ts +127 -0
- package/src/wms/ogc-api-source-loader.ts +742 -0
- package/src/wms/service-capabilities.ts +147 -0
- package/src/wms/service-runtime.ts +225 -0
- package/src/wms/unbundled.ts +24 -0
- package/src/wms/wcs-source-loader.ts +260 -0
- package/src/wms/wfs-capabilities-loader-with-parser.ts +30 -0
- package/src/wms/wfs-capabilities-loader.ts +57 -0
- package/src/wms/wfs-source-loader.ts +987 -0
- package/src/wms/wip/data-source.ts +64 -0
- package/src/wms/wip/lib/wcs/parse-wcs-capabilities.ts +91 -0
- package/src/wms/wip/lib/wmts/parse-wmts-capabilities.ts +171 -0
- package/src/wms/wip/lib/wmts/parse-wmts.ts +39 -0
- package/src/wms/wip/services/wmts-service.ts.disabled +348 -0
- package/src/wms/wip/wcs-capabilities-loader-with-parser.ts +29 -0
- package/src/wms/wip/wcs-capabilities-loader.ts +50 -0
- package/src/wms/wip/wms-feature-info-loader-with-parser.ts +25 -0
- package/src/wms/wip/wms-feature-info-loader.ts +28 -0
- package/src/wms/wip/wms-layer-description-loader-with-parser.ts +25 -0
- package/src/wms/wip/wms-layer-description-loader.md.disabled.md +47 -0
- package/src/wms/wip/wms-layer-description-loader.ts +28 -0
- package/src/wms/wip/wmts-capabilities-loader-with-parser.ts +30 -0
- package/src/wms/wip/wmts-capabilities-loader.ts +52 -0
- package/src/wms/wms-capabilities-loader-with-parser.ts +45 -0
- package/src/wms/wms-capabilities-loader.ts +68 -0
- package/src/wms/wms-error-loader-with-parser.ts +44 -0
- package/src/wms/wms-error-loader.ts +56 -0
- package/src/wms/wms-format.ts +52 -0
- package/src/wms/wms-source-loader.ts +686 -0
- package/src/wms/wmts-capabilities-loader-with-parser.ts +17 -0
- package/src/wms/wmts-capabilities-loader.ts +30 -0
- package/src/wms/wmts-source-loader.ts +649 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/** A four- or six-dimensional STAC bounding box. */
|
|
6
|
+
export type STACBoundingBox =
|
|
7
|
+
| readonly [number, number, number, number]
|
|
8
|
+
| readonly [number, number, number, number, number, number];
|
|
9
|
+
|
|
10
|
+
/** Hypermedia link shared by STAC catalogs, collections, items, and API responses. */
|
|
11
|
+
export type STACLink = {
|
|
12
|
+
/** Link relation such as `self`, `child`, `item`, `next`, or `search`. */
|
|
13
|
+
rel: string;
|
|
14
|
+
/** Absolute or document-relative target URL. */
|
|
15
|
+
href: string;
|
|
16
|
+
/** Optional media type of the target. */
|
|
17
|
+
type?: string;
|
|
18
|
+
/** Human-readable link title. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** HTTP method declared by STAC API pagination links. */
|
|
21
|
+
method?: 'GET' | 'POST';
|
|
22
|
+
/** Optional request headers declared by a STAC API link. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
/** Optional request body declared by a STAC API link. */
|
|
25
|
+
body?: Record<string, unknown>;
|
|
26
|
+
/** Whether a pagination body is merged with the previous request body. */
|
|
27
|
+
merge?: boolean;
|
|
28
|
+
/** STAC extension fields. */
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Downloadable or streamable resource described by one STAC Item. */
|
|
33
|
+
export type STACAsset = {
|
|
34
|
+
/** Absolute or document-relative asset URL. */
|
|
35
|
+
href: string;
|
|
36
|
+
/** Human-readable asset title. */
|
|
37
|
+
title?: string;
|
|
38
|
+
/** Human-readable asset description. */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** Asset media type. */
|
|
41
|
+
type?: string;
|
|
42
|
+
/** Semantic roles such as `data`, `thumbnail`, or `metadata`. */
|
|
43
|
+
roles?: string[];
|
|
44
|
+
/** STAC extension fields. */
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** Root object for a static STAC Catalog or STAC API. */
|
|
49
|
+
export type STACCatalog = {
|
|
50
|
+
/** STAC object discriminator. */
|
|
51
|
+
type: 'Catalog';
|
|
52
|
+
/** STAC specification version implemented by this object. */
|
|
53
|
+
stac_version: string;
|
|
54
|
+
/** STAC extension schema URLs. */
|
|
55
|
+
stac_extensions?: string[];
|
|
56
|
+
/** Catalog identifier. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** Human-readable title. */
|
|
59
|
+
title?: string;
|
|
60
|
+
/** Human-readable description. */
|
|
61
|
+
description: string;
|
|
62
|
+
/** Hypermedia links. */
|
|
63
|
+
links: STACLink[];
|
|
64
|
+
/** STAC API conformance declaration URLs. */
|
|
65
|
+
conformsTo?: string[];
|
|
66
|
+
/** STAC extension fields. */
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** Spatial and temporal extent of a STAC Collection. */
|
|
71
|
+
export type STACExtent = {
|
|
72
|
+
/** Collection spatial extents. */
|
|
73
|
+
spatial: {bbox: STACBoundingBox[]};
|
|
74
|
+
/** Collection temporal intervals. */
|
|
75
|
+
temporal: {interval: Array<readonly [string | null, string | null]>};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** STAC Collection describing a related set of Items. */
|
|
79
|
+
export type STACCollection = {
|
|
80
|
+
/** STAC object discriminator. */
|
|
81
|
+
type: 'Collection';
|
|
82
|
+
/** STAC specification version implemented by this object. */
|
|
83
|
+
stac_version: string;
|
|
84
|
+
/** STAC extension schema URLs. */
|
|
85
|
+
stac_extensions?: string[];
|
|
86
|
+
/** Collection identifier. */
|
|
87
|
+
id: string;
|
|
88
|
+
/** Human-readable title. */
|
|
89
|
+
title?: string;
|
|
90
|
+
/** Human-readable description. */
|
|
91
|
+
description: string;
|
|
92
|
+
/** Hypermedia links. */
|
|
93
|
+
links: STACLink[];
|
|
94
|
+
/** STAC API conformance declaration URLs. */
|
|
95
|
+
conformsTo?: string[];
|
|
96
|
+
/** SPDX identifier or `proprietary`/`various`. */
|
|
97
|
+
license: string;
|
|
98
|
+
/** Collection spatial and temporal extent. */
|
|
99
|
+
extent: STACExtent;
|
|
100
|
+
/** Collection-level assets. */
|
|
101
|
+
assets?: Record<string, STACAsset>;
|
|
102
|
+
/** Summary values for Item properties. */
|
|
103
|
+
summaries?: Record<string, unknown>;
|
|
104
|
+
/** STAC extension fields. */
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** GeoJSON geometry carried by a STAC Item. */
|
|
109
|
+
export type STACGeometry = {
|
|
110
|
+
/** GeoJSON geometry type. */
|
|
111
|
+
type: string;
|
|
112
|
+
/** GeoJSON coordinates. */
|
|
113
|
+
coordinates?: unknown;
|
|
114
|
+
/** Child geometries for a GeometryCollection. */
|
|
115
|
+
geometries?: STACGeometry[];
|
|
116
|
+
/** GeoJSON extension fields. */
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** One spatiotemporal record and its assets. */
|
|
121
|
+
export type STACItem = {
|
|
122
|
+
/** GeoJSON feature discriminator. */
|
|
123
|
+
type: 'Feature';
|
|
124
|
+
/** STAC specification version implemented by this object. */
|
|
125
|
+
stac_version: string;
|
|
126
|
+
/** STAC extension schema URLs. */
|
|
127
|
+
stac_extensions?: string[];
|
|
128
|
+
/** Item identifier. */
|
|
129
|
+
id: string;
|
|
130
|
+
/** Item geometry, or `null` when unavailable. */
|
|
131
|
+
geometry: STACGeometry | null;
|
|
132
|
+
/** Item bounding box. */
|
|
133
|
+
bbox?: STACBoundingBox;
|
|
134
|
+
/** Item properties, including `datetime` or start/end datetimes. */
|
|
135
|
+
properties: Record<string, unknown> & {
|
|
136
|
+
datetime?: string | null;
|
|
137
|
+
start_datetime?: string;
|
|
138
|
+
end_datetime?: string;
|
|
139
|
+
};
|
|
140
|
+
/** Collection identifier. */
|
|
141
|
+
collection?: string;
|
|
142
|
+
/** Hypermedia links. */
|
|
143
|
+
links: STACLink[];
|
|
144
|
+
/** Assets keyed by application-defined names. */
|
|
145
|
+
assets: Record<string, STACAsset>;
|
|
146
|
+
/** STAC extension fields. */
|
|
147
|
+
[key: string]: unknown;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/** Paginated STAC API search response. */
|
|
151
|
+
export type STACItemCollection = {
|
|
152
|
+
/** GeoJSON collection discriminator. */
|
|
153
|
+
type: 'FeatureCollection';
|
|
154
|
+
/** Items in this result page. */
|
|
155
|
+
features: STACItem[];
|
|
156
|
+
/** Pagination and related links. */
|
|
157
|
+
links: STACLink[];
|
|
158
|
+
/** Total matching Items when reported by the API. */
|
|
159
|
+
numberMatched?: number;
|
|
160
|
+
/** Items returned in this response when reported by the API. */
|
|
161
|
+
numberReturned?: number;
|
|
162
|
+
/** STAC extension fields. */
|
|
163
|
+
[key: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/** Response returned by a STAC API Collections endpoint. */
|
|
167
|
+
export type STACCollections = {
|
|
168
|
+
/** Collections in this result page. */
|
|
169
|
+
collections: STACCollection[];
|
|
170
|
+
/** Pagination and related links. */
|
|
171
|
+
links: STACLink[];
|
|
172
|
+
/** STAC extension fields. */
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** Any core STAC document understood by `STACSource`. */
|
|
177
|
+
export type STACObject = STACCatalog | STACCollection | STACItem | STACItemCollection;
|
|
178
|
+
|
|
179
|
+
/** Protocol mode discovered from the root STAC document. */
|
|
180
|
+
export type STACMode = 'static' | 'api';
|
|
181
|
+
|
|
182
|
+
/** Metadata returned by `STACSource.getMetadata()`. */
|
|
183
|
+
export type STACSourceMetadata = {
|
|
184
|
+
/** Root Catalog or Collection. */
|
|
185
|
+
root: STACCatalog | STACCollection;
|
|
186
|
+
/** Whether this source exposes a STAC API search endpoint. */
|
|
187
|
+
mode: STACMode;
|
|
188
|
+
/** Declared API conformance classes. */
|
|
189
|
+
conformsTo: readonly string[];
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/** Standard STAC API Item Search parameters supported without extensions. */
|
|
193
|
+
export type STACSearchQuery = {
|
|
194
|
+
/** Item identifiers to match. */
|
|
195
|
+
ids?: readonly string[];
|
|
196
|
+
/** Collection identifiers to match. */
|
|
197
|
+
collections?: readonly string[];
|
|
198
|
+
/** Spatial intersection bounding box. */
|
|
199
|
+
bbox?: STACBoundingBox;
|
|
200
|
+
/** RFC 3339 datetime or closed/open interval. */
|
|
201
|
+
datetime?: string;
|
|
202
|
+
/** Maximum Items requested per API response. */
|
|
203
|
+
limit?: number;
|
|
204
|
+
/** Abort this search and its pagination requests. */
|
|
205
|
+
signal?: AbortSignal;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/** Explicit traversal limits for linked static STAC catalogs. */
|
|
209
|
+
export type STACTraversalOptions = STACSearchQuery & {
|
|
210
|
+
/** Maximum child-catalog depth below the root. */
|
|
211
|
+
maxDepth?: number;
|
|
212
|
+
/** Maximum number of STAC documents fetched. */
|
|
213
|
+
maxRequests?: number;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/** Selects assets from one STAC Item. */
|
|
217
|
+
export type STACAssetSelection = {
|
|
218
|
+
/** Require at least one matching asset role. */
|
|
219
|
+
roles?: readonly string[];
|
|
220
|
+
/** Require an exact media type. */
|
|
221
|
+
mediaTypes?: readonly string[];
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/** Asset with its Item key and an absolute URL. */
|
|
225
|
+
export type STACResolvedAsset = STACAsset & {
|
|
226
|
+
/** Key of the asset in the Item. */
|
|
227
|
+
key: string;
|
|
228
|
+
/** Absolute asset URL resolved against its containing STAC document. */
|
|
229
|
+
href: string;
|
|
230
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export type {CSWLoaderOptions, CSWCapabilities} from './csw-capabilities-loader-with-parser';
|
|
6
|
+
export {CSWCapabilitiesLoaderWithParser as CSWCapabilitiesLoader} from './csw-capabilities-loader-with-parser';
|
|
7
|
+
export type {CSWDomain} from './csw-domain-loader-with-parser';
|
|
8
|
+
export {CSWDomainLoaderWithParser as CSWDomainLoader} from './csw-domain-loader-with-parser';
|
|
9
|
+
export type {CSWRecords} from './csw-records-loader-with-parser';
|
|
10
|
+
export {CSWRecordsLoaderWithParser as CSWRecordsLoader} from './csw-records-loader-with-parser';
|
|
11
|
+
|
|
12
|
+
export {WMSErrorLoaderWithParser as WMSErrorLoader} from './wms-error-loader-with-parser';
|
|
13
|
+
export type {WMTSLoaderOptions} from './wmts-capabilities-loader';
|
|
14
|
+
export type {WMTSCapabilities} from './lib/parsers/wmts/parse-wmts-capabilities';
|
|
15
|
+
export {WMTSCapabilitiesLoaderWithParser as WMTSCapabilitiesLoader} from './wmts-capabilities-loader-with-parser';
|
|
16
|
+
export type {WMSCapabilitiesLoaderOptions} from './wms-capabilities-loader-with-parser';
|
|
17
|
+
export {WMSCapabilitiesLoaderWithParser as WMSCapabilitiesLoader} from './wms-capabilities-loader-with-parser';
|
|
18
|
+
|
|
19
|
+
export type {WFSLoaderOptions as _WFSLoaderOptions} from './wfs-capabilities-loader-with-parser';
|
|
20
|
+
export type {WFSCapabilities as _WFSCapabilities} from './wfs-capabilities-loader-with-parser';
|
|
21
|
+
export {WFSCapabilitiesLoaderWithParser as WFSCapabilitiesLoader} from './wfs-capabilities-loader-with-parser';
|
|
22
|
+
export {WFSCapabilitiesLoaderWithParser as _WFSCapabilitiesLoader} from './wfs-capabilities-loader-with-parser';
|
|
23
|
+
|
|
24
|
+
export type {GMLLoaderOptions, GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader-types';
|
|
25
|
+
export {GMLLoaderWithParser as GMLLoader} from './gml-loader';
|
|
26
|
+
export {GMLLoaderWithParser as _GMLLoader} from './gml-loader';
|
|
27
|
+
export {WMSFeatureInfoLoaderWithParser as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader-with-parser';
|
|
28
|
+
export {WMSLayerDescriptionLoaderWithParser as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader-with-parser';
|
|
29
|
+
export {WMTSCapabilitiesLoaderWithParser as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader-with-parser';
|
|
30
|
+
export {WCSCapabilitiesLoaderWithParser as _WCSCapabilitiesLoader} from './wip/wcs-capabilities-loader-with-parser';
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {GeoServiceType, ServiceCapabilities} from './service-capabilities';
|
|
6
|
+
import {ServiceRuntime, type ServiceRuntimeOptions} from './service-runtime';
|
|
7
|
+
|
|
8
|
+
/** A discovered endpoint related to a service or catalog landing page. */
|
|
9
|
+
export type ServiceEndpoint = {
|
|
10
|
+
/** Endpoint URL. */
|
|
11
|
+
url: string;
|
|
12
|
+
/** Detected service family. */
|
|
13
|
+
type: GeoServiceType;
|
|
14
|
+
/** Relationship from the parent resource. */
|
|
15
|
+
relation: string;
|
|
16
|
+
/** Optional capability summary. */
|
|
17
|
+
capabilities?: ServiceCapabilities;
|
|
18
|
+
/** Measured request latency in milliseconds. */
|
|
19
|
+
latency?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Preferences used to rank service endpoints. */
|
|
23
|
+
export type ServiceEndpointPreferences = {
|
|
24
|
+
/** Preferred response formats. */
|
|
25
|
+
formats?: readonly string[];
|
|
26
|
+
/** Preferred coordinate reference systems. */
|
|
27
|
+
crs?: readonly string[];
|
|
28
|
+
/** Preferred service families. */
|
|
29
|
+
types?: readonly GeoServiceType[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** A capability graph containing discovered service endpoints. */
|
|
33
|
+
export class CapabilityGraph {
|
|
34
|
+
/** Discovered endpoints. */
|
|
35
|
+
readonly endpoints: ServiceEndpoint[];
|
|
36
|
+
|
|
37
|
+
/** Creates a capability graph. */
|
|
38
|
+
constructor(endpoints: readonly ServiceEndpoint[] = []) {
|
|
39
|
+
this.endpoints = [...endpoints];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Adds endpoints and returns this graph for fluent discovery pipelines. */
|
|
43
|
+
add(endpoints: readonly ServiceEndpoint[]): this {
|
|
44
|
+
this.endpoints.push(...endpoints);
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Ranks endpoints by type, format, CRS, and measured latency. */
|
|
49
|
+
rank(preferences: ServiceEndpointPreferences = {}): ServiceEndpoint[] {
|
|
50
|
+
return [...this.endpoints].sort(
|
|
51
|
+
(first, second) => scoreEndpoint(second, preferences) - scoreEndpoint(first, preferences)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Returns a serializable snapshot suitable for persistence. */
|
|
56
|
+
toJSON(): {endpoints: ServiceEndpoint[]} {
|
|
57
|
+
return {endpoints: this.endpoints};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Discovers ArcGIS directories and OGC landing-page relationships into a graph. */
|
|
62
|
+
export async function discoverServiceGraph(
|
|
63
|
+
url: string,
|
|
64
|
+
options: ServiceRuntimeOptions = {}
|
|
65
|
+
): Promise<CapabilityGraph> {
|
|
66
|
+
const runtime = new ServiceRuntime(options);
|
|
67
|
+
const response = await runtime.request(url, {
|
|
68
|
+
headers: {accept: 'application/json, application/xml, text/html'}
|
|
69
|
+
});
|
|
70
|
+
const contentType = response.headers.get('content-type') || '';
|
|
71
|
+
const text = await response.text();
|
|
72
|
+
const endpoints =
|
|
73
|
+
contentType.includes('json') || text.trim().startsWith('{')
|
|
74
|
+
? discoverJSONEndpoints(url, JSON.parse(text))
|
|
75
|
+
: discoverHTMLEndpoints(url, text);
|
|
76
|
+
return new CapabilityGraph(endpoints);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function discoverJSONEndpoints(url: string, document: any): ServiceEndpoint[] {
|
|
80
|
+
const endpoints: ServiceEndpoint[] = [];
|
|
81
|
+
for (const service of document.services || []) {
|
|
82
|
+
const endpointURL = service.url || `${url.replace(/\/$/, '')}/${service.name}/${service.type}`;
|
|
83
|
+
endpoints.push({
|
|
84
|
+
url: endpointURL,
|
|
85
|
+
type: detectServiceType(service.type, endpointURL),
|
|
86
|
+
relation: 'service'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
for (const link of document.links || []) {
|
|
90
|
+
if (!link.href) continue;
|
|
91
|
+
const endpointURL = new URL(link.href, url).toString();
|
|
92
|
+
endpoints.push({
|
|
93
|
+
url: endpointURL,
|
|
94
|
+
type: detectServiceType(link.type || '', endpointURL),
|
|
95
|
+
relation: link.rel || 'related'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return endpoints;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function discoverHTMLEndpoints(url: string, document: string): ServiceEndpoint[] {
|
|
102
|
+
const endpoints: ServiceEndpoint[] = [];
|
|
103
|
+
const linkPattern = /<link\b[^>]*>/gi;
|
|
104
|
+
for (const match of document.matchAll(linkPattern)) {
|
|
105
|
+
const href = /\bhref=["']([^"']+)["']/i.exec(match[0])?.[1];
|
|
106
|
+
if (!href) continue;
|
|
107
|
+
const relation = /\brel=["']([^"']+)["']/i.exec(match[0])?.[1] || 'related';
|
|
108
|
+
const endpointURL = new URL(href, url).toString();
|
|
109
|
+
endpoints.push({
|
|
110
|
+
url: endpointURL,
|
|
111
|
+
type: detectServiceType('', endpointURL),
|
|
112
|
+
relation
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return endpoints;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Infers a supported service family from a type hint and endpoint URL. */
|
|
119
|
+
function detectServiceType(value: string, url: string): GeoServiceType {
|
|
120
|
+
const text = `${value} ${url}`.toLowerCase();
|
|
121
|
+
if (text.includes('imageserver')) return 'arcgis-image-server';
|
|
122
|
+
if (text.includes('featureserver')) return 'arcgis-feature-server';
|
|
123
|
+
if (text.includes('vectortileserver')) return 'arcgis-vector-tile-server';
|
|
124
|
+
if (text.includes('mapserver')) return 'arcgis-map-server';
|
|
125
|
+
if (text.includes('wmts')) return 'wmts';
|
|
126
|
+
if (text.includes('wms')) return 'wms';
|
|
127
|
+
if (text.includes('wfs')) return 'wfs';
|
|
128
|
+
if (text.includes('csw')) return 'csw';
|
|
129
|
+
return 'unknown';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Computes a preference score for one service endpoint. */
|
|
133
|
+
function scoreEndpoint(endpoint: ServiceEndpoint, preferences: ServiceEndpointPreferences): number {
|
|
134
|
+
const capabilities = endpoint.capabilities;
|
|
135
|
+
let score = endpoint.type === 'unknown' ? 0 : 1;
|
|
136
|
+
if (preferences.types?.includes(endpoint.type)) score += 100;
|
|
137
|
+
score += matches(preferences.formats, capabilities?.formats) * 20;
|
|
138
|
+
score += matches(preferences.crs, capabilities?.crs) * 20;
|
|
139
|
+
if (endpoint.latency !== undefined) score += Math.max(0, 10 - endpoint.latency / 100);
|
|
140
|
+
return score;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Counts exact case-insensitive matches between preferred and advertised values. */
|
|
144
|
+
function matches(
|
|
145
|
+
preferred: readonly string[] | undefined,
|
|
146
|
+
advertised: readonly string[] | undefined
|
|
147
|
+
): number {
|
|
148
|
+
if (!preferred?.length || !advertised?.length) return 0;
|
|
149
|
+
return preferred.filter(value =>
|
|
150
|
+
advertised.some(candidate => candidate.toLowerCase() === value.toLowerCase())
|
|
151
|
+
).length;
|
|
152
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {CRSIdentifier} from '@math.gl/geospatial/crs';
|
|
6
|
+
|
|
7
|
+
/** A CRS identifier accepted by OGC and ArcGIS services. */
|
|
8
|
+
export type ServiceCRS = CRSIdentifier | number;
|
|
9
|
+
|
|
10
|
+
/** Normalizes common OGC and ArcGIS CRS spellings to a stable identifier. */
|
|
11
|
+
export function normalizeServiceCRS(crs: ServiceCRS | undefined): string | undefined {
|
|
12
|
+
if (crs === undefined || crs === null) return undefined;
|
|
13
|
+
if (typeof crs === 'number') return `EPSG:${crs}`;
|
|
14
|
+
const value = crs.trim();
|
|
15
|
+
if (!value) return undefined;
|
|
16
|
+
const upperValue = value.toUpperCase();
|
|
17
|
+
if (upperValue === 'CRS:84' || upperValue.endsWith('/CRS84')) return 'CRS:84';
|
|
18
|
+
const epsgMatch = /(?:EPSG[:/]|::)(?:\d+\/)?(\d+)$/i.exec(value);
|
|
19
|
+
return epsgMatch ? `EPSG:${epsgMatch[1]}` : upperValue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Returns whether two CRS identifiers refer to the same service coordinate system. */
|
|
23
|
+
export function areServiceCRSEquivalent(
|
|
24
|
+
firstCRS: ServiceCRS | undefined,
|
|
25
|
+
secondCRS: ServiceCRS | undefined
|
|
26
|
+
): boolean {
|
|
27
|
+
const first = normalizeServiceCRS(firstCRS);
|
|
28
|
+
const second = normalizeServiceCRS(secondCRS);
|
|
29
|
+
if (!first || !second) return false;
|
|
30
|
+
if (first === second) return true;
|
|
31
|
+
const webMercatorCRS = new Set(['EPSG:3857', 'EPSG:900913', 'EPSG:102100', 'EPSG:102113']);
|
|
32
|
+
return webMercatorCRS.has(first) && webMercatorCRS.has(second);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Selects the first supported CRS compatible with a requested CRS. */
|
|
36
|
+
export function selectServiceCRS(
|
|
37
|
+
requestedCRS: ServiceCRS | undefined,
|
|
38
|
+
supportedCRS: readonly ServiceCRS[]
|
|
39
|
+
): string | undefined {
|
|
40
|
+
if (!supportedCRS.length) return normalizeServiceCRS(requestedCRS);
|
|
41
|
+
return (
|
|
42
|
+
supportedCRS.find(crs => areServiceCRSEquivalent(requestedCRS, crs)) || supportedCRS[0]
|
|
43
|
+
).toString();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the conventional axis order used on the service wire.
|
|
48
|
+
*
|
|
49
|
+
* Application bounding boxes and decoded geometry remain canonical `xy` (x/easting or longitude
|
|
50
|
+
* first); callers use this result only when constructing protocol-specific request coordinates.
|
|
51
|
+
* The rule intentionally covers the common WFS 1.1/2.0 EPSG:4326 case without claiming to be a
|
|
52
|
+
* complete authority-axis registry.
|
|
53
|
+
*/
|
|
54
|
+
export function getServiceCRSAxisOrder(crs: ServiceCRS | undefined): 'xy' | 'yx' {
|
|
55
|
+
return normalizeServiceCRS(crs) === 'EPSG:4326' ? 'yx' : 'xy';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the built-in length of one CRS unit in meters: EPSG:4326 and CRS:84 degrees use the OGC
|
|
60
|
+
* equatorial convention, Web Mercator uses meters. Other CRSs return undefined.
|
|
61
|
+
*/
|
|
62
|
+
export function getServiceCRSMetersPerUnit(crs: ServiceCRS | undefined): number | undefined {
|
|
63
|
+
const normalizedCRS = normalizeServiceCRS(crs);
|
|
64
|
+
if (normalizedCRS === 'EPSG:4326' || normalizedCRS === 'CRS:84')
|
|
65
|
+
return (2 * Math.PI * 6378137) / 360;
|
|
66
|
+
return areServiceCRSEquivalent(normalizedCRS, 'EPSG:3857') ? 1 : undefined;
|
|
67
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
7
|
+
import type {CSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';
|
|
8
|
+
import {parseCSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';
|
|
9
|
+
import {CSWCapabilitiesLoader as CSWCapabilitiesLoaderMetadata} from './csw-capabilities-loader';
|
|
10
|
+
|
|
11
|
+
const {preload: _CSWCapabilitiesLoaderPreload, ...CSWCapabilitiesLoaderMetadataWithoutPreload} =
|
|
12
|
+
CSWCapabilitiesLoaderMetadata;
|
|
13
|
+
|
|
14
|
+
// parsed data type
|
|
15
|
+
export type {CSWCapabilities};
|
|
16
|
+
|
|
17
|
+
/** CSW loader options */
|
|
18
|
+
export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
19
|
+
csw?: {};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Loader for the response to the CSW GetCapability request
|
|
24
|
+
*/
|
|
25
|
+
export const CSWCapabilitiesLoaderWithParser = {
|
|
26
|
+
...CSWCapabilitiesLoaderMetadataWithoutPreload,
|
|
27
|
+
parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>
|
|
28
|
+
parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),
|
|
29
|
+
parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWCapabilities(text, options)
|
|
30
|
+
} as const satisfies LoaderWithParser<CSWCapabilities, never, CSWLoaderOptions>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
7
|
+
import type {CSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';
|
|
8
|
+
|
|
9
|
+
import {CSWCapabilitiesFormat} from './wms-format';
|
|
10
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
11
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
12
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
13
|
+
|
|
14
|
+
// parsed data type
|
|
15
|
+
export type {CSWCapabilities};
|
|
16
|
+
|
|
17
|
+
/** CSW loader options */
|
|
18
|
+
export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
19
|
+
csw?: {};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Preloads the parser-bearing CSW capabilities loader implementation. */
|
|
23
|
+
async function preload() {
|
|
24
|
+
const {CSWCapabilitiesLoaderWithParser} = await import('./csw-capabilities-loader-with-parser');
|
|
25
|
+
return CSWCapabilitiesLoaderWithParser;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Metadata-only loader for the response to the CSW GetCapability request. */
|
|
29
|
+
export const CSWCapabilitiesLoader = {
|
|
30
|
+
...CSWCapabilitiesFormat,
|
|
31
|
+
dataType: null as unknown as CSWCapabilities,
|
|
32
|
+
batchType: null as never,
|
|
33
|
+
|
|
34
|
+
id: 'csw-capabilities',
|
|
35
|
+
name: 'CSW Capabilities',
|
|
36
|
+
module: 'ogc',
|
|
37
|
+
version: VERSION,
|
|
38
|
+
worker: false,
|
|
39
|
+
encoding: 'xml',
|
|
40
|
+
format: 'csw-capabilities',
|
|
41
|
+
text: true,
|
|
42
|
+
extensions: ['xml'],
|
|
43
|
+
mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],
|
|
44
|
+
testText: testXMLFile,
|
|
45
|
+
options: {
|
|
46
|
+
csw: {}
|
|
47
|
+
},
|
|
48
|
+
preload
|
|
49
|
+
} as const satisfies Loader<CSWCapabilities, never, CSWLoaderOptions>;
|
|
50
|
+
|
|
51
|
+
function testXMLFile(text: string): boolean {
|
|
52
|
+
// TODO - There could be space first.
|
|
53
|
+
return text.startsWith('<?xml');
|
|
54
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
7
|
+
import type {CSWDomain} from './lib/parsers/csw/parse-csw-domain';
|
|
8
|
+
import {parseCSWDomain} from './lib/parsers/csw/parse-csw-domain';
|
|
9
|
+
import {CSWDomainLoader as CSWDomainLoaderMetadata} from './csw-domain-loader';
|
|
10
|
+
|
|
11
|
+
const {preload: _CSWDomainLoaderPreload, ...CSWDomainLoaderMetadataWithoutPreload} =
|
|
12
|
+
CSWDomainLoaderMetadata;
|
|
13
|
+
|
|
14
|
+
export type {CSWDomain};
|
|
15
|
+
|
|
16
|
+
export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
17
|
+
csw?: {};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Loader for the response to the CSW GetCapability request
|
|
22
|
+
*/
|
|
23
|
+
export const CSWDomainLoaderWithParser = {
|
|
24
|
+
...CSWDomainLoaderMetadataWithoutPreload,
|
|
25
|
+
parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>
|
|
26
|
+
parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),
|
|
27
|
+
parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWDomain(text, options)
|
|
28
|
+
} as const satisfies LoaderWithParser<CSWDomain, never, CSWLoaderOptions>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
7
|
+
import type {CSWDomain} from './lib/parsers/csw/parse-csw-domain';
|
|
8
|
+
|
|
9
|
+
import {CSWDomainFormat} from './wms-format';
|
|
10
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
11
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
12
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
13
|
+
|
|
14
|
+
export type {CSWDomain};
|
|
15
|
+
|
|
16
|
+
export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
17
|
+
csw?: {};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Preloads the parser-bearing CSW domain loader implementation. */
|
|
21
|
+
async function preload() {
|
|
22
|
+
const {CSWDomainLoaderWithParser} = await import('./csw-domain-loader-with-parser');
|
|
23
|
+
return CSWDomainLoaderWithParser;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Metadata-only loader for the response to the CSW GetDomain request. */
|
|
27
|
+
export const CSWDomainLoader = {
|
|
28
|
+
...CSWDomainFormat,
|
|
29
|
+
dataType: null as unknown as CSWDomain,
|
|
30
|
+
batchType: null as never,
|
|
31
|
+
|
|
32
|
+
id: 'csw-domain',
|
|
33
|
+
name: 'CSW Domain',
|
|
34
|
+
|
|
35
|
+
module: 'ogc',
|
|
36
|
+
version: VERSION,
|
|
37
|
+
worker: false,
|
|
38
|
+
encoding: 'xml',
|
|
39
|
+
format: 'csw-domain',
|
|
40
|
+
text: true,
|
|
41
|
+
extensions: ['xml'],
|
|
42
|
+
mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],
|
|
43
|
+
testText: testXMLFile,
|
|
44
|
+
options: {
|
|
45
|
+
csw: {}
|
|
46
|
+
},
|
|
47
|
+
preload
|
|
48
|
+
} as const satisfies Loader<CSWDomain, never, CSWLoaderOptions>;
|
|
49
|
+
|
|
50
|
+
function testXMLFile(text: string): boolean {
|
|
51
|
+
// TODO - There could be space first.
|
|
52
|
+
return text.startsWith('<?xml');
|
|
53
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
7
|
+
import type {CSWRecords} from './lib/parsers/csw/parse-csw-records';
|
|
8
|
+
import {parseCSWRecords} from './lib/parsers/csw/parse-csw-records';
|
|
9
|
+
import {CSWRecordsLoader as CSWRecordsLoaderMetadata} from './csw-records-loader';
|
|
10
|
+
|
|
11
|
+
const {preload: _CSWRecordsLoaderPreload, ...CSWRecordsLoaderMetadataWithoutPreload} =
|
|
12
|
+
CSWRecordsLoaderMetadata;
|
|
13
|
+
|
|
14
|
+
export {CSWRecords};
|
|
15
|
+
|
|
16
|
+
export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
17
|
+
csw?: {};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Loader for the response to the CSW GetCapability request
|
|
22
|
+
*/
|
|
23
|
+
export const CSWRecordsLoaderWithParser = {
|
|
24
|
+
...CSWRecordsLoaderMetadataWithoutPreload,
|
|
25
|
+
parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>
|
|
26
|
+
parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),
|
|
27
|
+
parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWRecords(text, options)
|
|
28
|
+
} as const satisfies LoaderWithParser<CSWRecords, never, CSWLoaderOptions>;
|