camptocamp / ogc-client Goto Github PK
View Code? Open in Web Editor NEWA TypeScript library for interacting with geospatial services
Home Page: https://camptocamp.github.io/ogc-client/
License: BSD 3-Clause "New" or "Revised" License
A TypeScript library for interacting with geospatial services
Home Page: https://camptocamp.github.io/ogc-client/
License: BSD 3-Clause "New" or "Revised" License
It seems that the bounding boxes of the layers are only fetched from the BoundingBox
element of the layer in the getCapabilities
.
eg.
<BoundingBox CRS="EPSG:2056" minx="2.1e+06" miny="105000" maxx="2.85e+06" maxy="1.4e+06"/>
Additionally, it could exist more elements about the layer extent.
EX_GeographicBoundingBox
ows:WGS84BoundingBox
Those elements are in EPSG:4326
which simplifies the process afterwards, as it's a standard CRS.
eg.
<ows:WGS84BoundingBox>
<ows:LowerCorner>5.140242 45.398181</ows:LowerCorner>
<ows:UpperCorner>11.47757 48.230651</ows:UpperCorner>
</ows:WGS84BoundingBox>
<EX_GeographicBoundingBox>
<westBoundLongitude>0.659866</westBoundLongitude>
<eastBoundLongitude>10.8359</eastBoundLongitude>
<southBoundLatitude>36.982</southBoundLatitude>
<northBoundLatitude>48.7511</northBoundLatitude>
</EX_GeographicBoundingBox>
OGC client internally uses the Browser Cache Storage abilities to cache the requests.
Issue
In some cases, for instance on Firefox in Privacy Mode, we are not allowed to read or write in the cache storage.
It results that the OGC client fails requesting the cache, but still does not perform the original request.
It triggers the following error
Uncaught (in promise) DOMException: **The operation is insecure**.
4505 https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:133
r https://www.datagrandest.fr/datahub/runtime.4381662fc90e13c0.js:1
<anonymous> https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:133
n https://www.datagrandest.fr/datahub/runtime.4381662fc90e13c0.js:1
<anonymous> https://www.datagrandest.fr/datahub/main.7acf17b8ce68852b.js:1
Todo
Handle the case where the Cache Storage is not accessible and performs original requests without caching
First of all, thanks for providing this library! So far it looks great, especially the caching is very useful.
Do you have plans for supporting Tiles and Styles? We would like to query styles, style metadata, tile collections and tileMatrixSets.
I noticed that there is already active development for tiles. But we're also willing to contribute if possible, e.g. for styles.
when I run the demo app with Node 18 it fails with this error:
> [email protected] serve
> vue-cli-service serve
INFO Starting development server...
10% building 2/5 modules 3 active ...ksch/Code/ogc-client/app/node_modules/babel-loader/lib/index.js!/mnt/c/Users/johndoe/Code/ogc-client/app/src/main.js n
ode:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/webpack/lib/NormalModule.js:471:10)
at /mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/webpack/lib/NormalModule.js:503:5
at /mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/webpack/lib/NormalModule.js:358:12
at /mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
at /mnt/c/Users/johndoe/Code/ogc-client/app/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.16.0
It works with Node 16 for me
Hi,
I looked for a license (LICENSE
file or license
when searching the documentation), but could not find any information.
Would it be possible to know more about how this code can be used?
Thanks a lot!
I cannot open the live demo https://camptocamp.github.io/ogc-client/ . I just get a white website.
For some OGC services I need to add a custom header for authorization. However, currently it does not seem possible with this library to add a custom header. I guess a change needs to be done here: https://github.com/camptocamp/ogc-client/blob/main/src/shared/http-utils.ts
I can try to provide a fix. If you have any hint or preference how to implement it, please let me know.
In a Vue3 application using Node 20 I get this error.
Do you a hint what the problem could be?
Uncaught ReferenceError: exports is not defined
at node_modules/@camptocamp/ogc-client/dist/worker/index.js (index.js:2:23)
at __init (chunk-GFT2G5UO.js?v=951b9568:15:56)
at node_modules/@camptocamp/ogc-client/dist/wfs/endpoint.js (endpoint.js:3:16)
at __require2 (chunk-GFT2G5UO.js?v=951b9568:18:50)
at node_modules/@camptocamp/ogc-client/dist/index.js (index.js:4:18)
at __require2 (chunk-GFT2G5UO.js?v=951b9568:18:50)
at index.js:16:1
or as screenshot of the browser console
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.