How to use @here/olp-sdk-dataservice-api - 10 common examples

To help you get started, we’ve selected a few @here/olp-sdk-dataservice-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async downloadPartition(
        dataHandle: string,
        abortSignal?: AbortSignal
    ): Promise {
        const builder = await this.getRequestBuilder("blob", abortSignal);
        return BlobApi.getBlob(builder, {
            dataHandle,
            layerId: this.layerId
        }).catch(this.errorHandler);
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async downloadTile(
        dataHandle: string,
        abortSignal?: AbortSignal
    ): Promise {
        const builder = await this.getRequestBuilder("blob", abortSignal);
        return BlobApi.getBlob(builder, {
            dataHandle,
            layerId: this.layerId
        }).catch(async error => Promise.reject(error));
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getDataHandleByPartitionId(
        partitionId: string,
        version?: number
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const latestVersion = version || (await this.getLatestVersion());
        const partitions = await QueryApi.getPartitionsById(
            queryRequestBilder,
            {
                version: `${latestVersion}`,
                layerId: this.layerId,
                partition: [partitionId]
            }
        );
        const partition = partitions.partitions.find(element => {
            return element.partition === partitionId;
        });

        return partition && partition.dataHandle
            ? partition.dataHandle
            : Promise.reject(
                  `No partition dataHandle for partition ${partitionId}. HRN: ${this.hrn}`
              );
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async downloadPartitionData(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const latestVersion = await this.getLatestVersion();
        return QueryApi.getPartitionsById(queryRequestBilder, {
            version: `${latestVersion}`,
            layerId: this.layerId,
            partition: [partitionId]
        });
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async downloadPartitionData(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        return QueryApi.getPartitionsById(queryRequestBilder, {
            layerId: this.layerId,
            partition: [partitionId]
        });
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async getDataHandleByPartitionId(
        partitionId: string
    ): Promise {
        const queryRequestBilder = await this.getRequestBuilder("query");
        const partitions = await QueryApi.getPartitionsById(
            queryRequestBilder,
            {
                layerId: this.layerId,
                partition: [partitionId]
            }
        );
        const partition = partitions.partitions.find(element => {
            return element.partition === partitionId;
        });

        return partition && partition.dataHandle
            ? partition.dataHandle
            : Promise.reject(
                  `No partition dataHandle for partition ${partitionId}. HRN: ${this.hrn}`
              );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / QueryClient.ts View on Github external
return Promise.reject("Please provide correct partitionIds list");
        }

        const requestBuilder = await RequestFactory.create(
            "query",
            this.apiVersion,
            this.settings,
            hrn,
            abortSignal
        ).catch(error =>
            Promise.reject(
                `Erorr creating request object for query service: ${error}`
            )
        );
        
        return QueryApi.getPartitionsById(
            requestBuilder,
            {
                layerId,
                partition: idsList,
                version: version ? `${version}` : undefined,
            }
        );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async downloadIndex(indexRootKey: QuadKey): Promise {
        let dsIndex: ConfigApi.Index;
        const queryRequestBuilder = await this.getRequestBuilder("query");

        dsIndex = await QueryApi.quadTreeIndexVolatile(queryRequestBuilder, {
            layerId: this.layerId,
            quadKey: utils.mortonCodeFromQuadKey(indexRootKey).toString(),
            depth: this.indexDepth
        });

        return this.parseIndex(indexRootKey, dsIndex);
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / CatalogClient.ts View on Github external
public async getLatestVersion(
        request: CatalogVersionRequest,
        abortSignal?: AbortSignal
    ): Promise {
        const startVersion = request.getStartVersion() || -1;
        const builder = await this.getRequestBuilder(
            "metadata",
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(error => Promise.reject(error));
        const latestVersion = await MetadataApi.latestVersion(builder, {
            startVersion,
            billingTag: request.getBillingTag()
        });
        return latestVersion.version;
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getLatestVersion(): Promise {
        const builder = await this.getRequestBuilder("metadata").catch(error =>
            Promise.reject(error)
        );
        const latestVersion = await MetadataApi.latestVersion(builder, {
            startVersion: -1
        }).catch(async (error: Response) =>
            Promise.reject(
                new Error(
                    `Metadata Service error: HTTP ${
                        error.status
                    }, ${error.statusText || ""}`
                )
            )
        );
        return latestVersion.version;
    }