ogcopenapis 0.0.7 → 0.0.9
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/README.md +36 -24
- package/lib/OgcOpenApiFeatureStore.d.ts +0 -2
- package/lib/OgcOpenApiFeatureStore.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,58 +3,70 @@
|
|
|
3
3
|
## Description
|
|
4
4
|
The ogcopenapis package provides OGC API functionalities to LuciadRIA Application.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Open API Tiles will be implemented
|
|
11
|
-
* Open API Maps will be implemented
|
|
6
|
+
Implements
|
|
7
|
+
* __Open API Features__
|
|
8
|
+
* __Open API Tiles__
|
|
9
|
+
* __Open API Maps__
|
|
12
10
|
|
|
13
11
|
The Main Components are:
|
|
14
12
|
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* __OgcOpenApiFeatureStore__: a ready to use LuciadRIA Feature store capable to retrieve features from an OGC API Service
|
|
14
|
+
* __OgcOpenApiMapsModel__: a ready to use store capable to retrieve features from an OGC API Service
|
|
15
|
+
* __OgcOpenApiTilesModel__: a ready to use store capable to retrieve features from an OGC API Service
|
|
16
|
+
* __OgcOpenApiGetCapabilities__: a helper to retrieve the capabilities of a server such as available Collections and Formats
|
|
17
17
|
|
|
18
|
-
Additional components will be added in future versions for Maps and Tiles
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
## To build
|
|
22
|
-
This is the source code
|
|
21
|
+
This is the source code that produces a library delivered as a npm package.
|
|
22
|
+
To build the source code use the npm scripts:
|
|
23
23
|
```
|
|
24
24
|
npm install
|
|
25
25
|
npm run build
|
|
26
26
|
```
|
|
27
|
+
Then you can publish the package to npm or other repository
|
|
27
28
|
|
|
28
29
|
## To test
|
|
29
|
-
Some test have been added that
|
|
30
|
-
|
|
30
|
+
Some test have been added that runs using nodejs using Jest. No browser test is available at the moment.
|
|
31
|
+
The test uses isomorphic-fetch to provide fetch in node testing with jest.
|
|
31
32
|
```
|
|
32
33
|
npm run test
|
|
33
34
|
```
|
|
34
|
-
Test use the sever-side
|
|
35
|
-
The
|
|
35
|
+
Test use the sever-side implementations of OGC Open API from "https://demo.pygeoapi.io/master/" and "https://maps.gnosis.earth/ogcapi/"
|
|
36
|
+
The servers are reliable and stable, but take in t account that changes at the server may brake some tests of this client.
|
|
36
37
|
|
|
37
|
-
## To use
|
|
38
|
+
## To use in your project
|
|
38
39
|
|
|
39
|
-
Simply import the NPM package
|
|
40
|
+
Simply import the NPM package into your project
|
|
40
41
|
|
|
41
42
|
```
|
|
42
43
|
npm install ogcopenapis
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
If you require the GetCapabilities functionality then
|
|
46
|
+
If you require the GetCapabilities functionality then import:
|
|
47
|
+
```typescript
|
|
48
|
+
import {
|
|
49
|
+
CollectionLinkType, OgcOpenApiCapabilitiesCollection,
|
|
50
|
+
OgcOpenApiCapabilitiesCollectionServiceLinkType,
|
|
51
|
+
OgcOpenApiGetCapabilities
|
|
52
|
+
} from "ogcopenapis/lib/OgcOpenApiGetCapabilities";
|
|
46
53
|
```
|
|
54
|
+
For Open Api Feature you can use the OgcOpenApiFeatureStore, this implements a store that can be used with LuciadRIA FeatureModel and FeatureLayer
|
|
55
|
+
```typescript
|
|
47
56
|
import {
|
|
48
|
-
|
|
49
|
-
} from
|
|
57
|
+
OgcOpenApiFeatureStore
|
|
58
|
+
} from "ogcopenapis/lib/OgcOpenApiFeatureStore";
|
|
59
|
+
```
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} from
|
|
61
|
+
For Maps and Tiles use OgcOpenApiMapsModel and OgcOpenApiTilesModel:
|
|
62
|
+
```typescript
|
|
63
|
+
import {OgcOpenApiMapsModel} from "ogcopenapis/lib/OgcOpenApiMapsModel";
|
|
64
|
+
import {OgcOpenApiTilesModel} from "ogcopenapis/lib/OgcOpenApiTilesModel";
|
|
54
65
|
```
|
|
66
|
+
Both models extend from UrlTileSetModel so you can use them in combination with RasterTileSetLayer.
|
|
67
|
+
Look at the LuciadRIA documentation if you need further information on using RasterTileSetLayer.
|
|
55
68
|
|
|
56
|
-
At this moment you should be ready to use the functionality.
|
|
57
69
|
|
|
58
|
-
## Requirements
|
|
70
|
+
## Requirements
|
|
59
71
|
* LuciadRIA 2020.0 or higher (place it on a local npm repository for instance verdaccio )
|
|
60
72
|
* A ES6 or Typescript capable transpiler.
|
|
@@ -4,7 +4,6 @@ import { Feature } from '@luciad/ria/model/feature/Feature';
|
|
|
4
4
|
import { Evented, Handle } from '@luciad/ria/util/Evented';
|
|
5
5
|
import { Bounds } from '@luciad/ria/shape/Bounds';
|
|
6
6
|
import { Codec, CodecDecodeOptions } from '@luciad/ria/model/codec/Codec';
|
|
7
|
-
import { CoordinateReference } from '@luciad/ria/reference/CoordinateReference';
|
|
8
7
|
import { ProxifyFunction } from "./OgcOpenApiGetCapabilities";
|
|
9
8
|
export interface OgcOpenApiFeatureStoreConstructorOptions {
|
|
10
9
|
swapAxes?: string[];
|
|
@@ -22,7 +21,6 @@ export interface OgcOpenApiFeatureStoreConstructorOptions {
|
|
|
22
21
|
bbox: any[];
|
|
23
22
|
};
|
|
24
23
|
};
|
|
25
|
-
reference: CoordinateReference;
|
|
26
24
|
crs: string;
|
|
27
25
|
proxify?: ProxifyFunction;
|
|
28
26
|
}
|
|
@@ -21,7 +21,8 @@ export class OgcOpenApiFeatureStore {
|
|
|
21
21
|
this.codec = options.codec;
|
|
22
22
|
this.eventedSupport = new EventedSupport();
|
|
23
23
|
this.requestHeaders = options.requestHeaders ? options.requestHeaders : {};
|
|
24
|
-
|
|
24
|
+
const referenceName = OgcOpenApiCrsTools.getReferenceName(options.crs);
|
|
25
|
+
this.reference = getReference(referenceName);
|
|
25
26
|
this.proxy = options.proxify;
|
|
26
27
|
this.credentials = options.credentials;
|
|
27
28
|
this.serverOptions = OgcOpenApiFetchTools.createFetchOptions({ originalUrl: this.dataUrl, proxify: options.proxify });
|