Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-8067: Rename OmvDataSource to VectorTileDataSource
Browse files Browse the repository at this point in the history
Also, removed unneeded symbols like OmvTile.

Signed-off-by: Roberto Raggi <roberto.raggi@here.com>
  • Loading branch information
robertoraggi committed Aug 6, 2020
1 parent 0500f51 commit ee1f3e3
Show file tree
Hide file tree
Showing 31 changed files with 311 additions and 205 deletions.
12 changes: 6 additions & 6 deletions @here/harp-features-datasource/lib/FeaturesDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
} from "@here/harp-datasource-protocol";
import { GeoBox, GeoCoordinates } from "@here/harp-geoutils";
import { MapView } from "@here/harp-mapview";
import { LoggerManager } from "@here/harp-utils";
import {
GeoJsonDataProvider,
GeoJsonDataProviderOptions,
OmvDataSource,
OmvDataSourceParameters
} from "@here/harp-omv-datasource";
import { LoggerManager } from "@here/harp-utils";
VectorTileDataSource,
VectorTileDataSourceParameters
} from "@here/harp-vectortile-datasource";
import { MapViewFeature } from "./Features";

const logger = LoggerManager.instance.create("FeaturesDataSource");
Expand All @@ -33,7 +33,7 @@ const DEFAULT_GEOJSON: FeatureCollection = {
* Options for [[FeaturesDataSource]].
*/
export interface FeatureDataSourceOptions
extends OmvDataSourceParameters,
extends VectorTileDataSourceParameters,
GeoJsonDataProviderOptions {
/**
* Initial set of features for new instance of [[FeaturesDataSource]].
Expand All @@ -53,7 +53,7 @@ export interface FeatureDataSourceOptions
/**
* [[DataSource]] implementation to use for the addition of custom features.
*/
export class FeaturesDataSource extends OmvDataSource {
export class FeaturesDataSource extends VectorTileDataSource {
private m_isAttached = false;
private m_featureCollection: FeatureCollection = this.emptyGeojson();

Expand Down
2 changes: 1 addition & 1 deletion @here/harp-features-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@here/harp-datasource-protocol": "^0.18.0",
"@here/harp-geoutils": "^0.18.0",
"@here/harp-mapview": "^0.18.0",
"@here/harp-omv-datasource": "^0.18.0",
"@here/harp-vectortile-datasource": "^0.18.0",
"@here/harp-utils": "^0.18.0"
},
"devDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions @here/harp-geojson-datasource/lib/GeoJsonDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
*/

import {
OmvDataSource,
OmvWithCustomDataProvider,
OmvWithRestClientParams
OmvWithRestClientParams,
VectorTileDataSource
} from "@here/harp-vectortile-datasource";

/**
* `GeoJsonDataSource` is used for the visualization of geometric objects provided in the GeoJSON
* format. To be able to render GeoJSON data, a `GeoJsonDataSource` instance must be added to the
* [[MapView]] instance.
* {@link @here/harp-mapview#MapView} instance.
*
* @example
* ```typescript
* const geoJsonDataProvider = new GeoJsonDataProvider(
* "italy",
Expand All @@ -27,7 +28,7 @@ import {
* mapView.addDataSource(geoJsonDataSource);
* ```
*/
export class GeoJsonDataSource extends OmvDataSource {
export class GeoJsonDataSource extends VectorTileDataSource {
/**
* Default constructor.
*
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-mapview-decoder/lib/TileDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class TileFactory<TileType extends Tile> {
* tile content asynchronously. The decoder can be passed in as an option, or a default
* asynchronous one is generated.
*/
export class TileDataSource<TileType extends Tile> extends DataSource {
export class TileDataSource<TileType extends Tile = Tile> extends DataSource {
protected readonly logger: ILogger = LoggerManager.instance.create("TileDataSource");
protected readonly m_decoder: ITileDecoder;
private m_isReady: boolean = false;
Expand Down
16 changes: 15 additions & 1 deletion @here/harp-omv-datasource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { VectorTileDataSourceParameters } from "@here/harp-vectortile-datasource";

export {
APIFormat,
AuthenticationMethod,
GeoJsonDataProvider
} from "@here/harp-vectortile-datasource";

/**
* HERE OMV Data source.
*
Expand All @@ -12,4 +20,10 @@
* @packageDocumentation
*/

export * from "@here/harp-vectortile-datasource";
/**
* @deprecated Use {@link @here/harp-vectortile-datasource#VectorTileDataSourceParameters}
* instad.
*/
export type OmvDataSourceParameters = VectorTileDataSourceParameters;

export * from "./lib/OmvDataSource";
22 changes: 22 additions & 0 deletions @here/harp-omv-datasource/lib/OmvDataSource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2017-2020 HERE Europe B.V.
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/

import { VectorTileDataSource } from "@here/harp-vectortile-datasource";

/**
* `OmvDataSource` is used for the visualization of vector tiles
* provided in the OMV format.
*
* @example
* ```typescript
* const dataSource = new OmvDataSource({
* baseUrl: "https://vector.hereapi.com/v2/vectortiles/base/mc",
* authenticationCode: apikey
* });
* mapView.addDataSource(dataSource);
* ```
*/
export class OmvDataSource extends VectorTileDataSource {}
6 changes: 3 additions & 3 deletions @here/harp-test-utils/lib/TestDataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const testResourcesRoot =
*
* Calculates URL of test resource in same way as [[loadTestResource]].
*
* @param moduleName -: module name, `@here/<module_name>` (e.g. @here/harp-omv-datasource)
* @param moduleName -: module name, `@here/<module_name>` (e.g. @here/harp-vectortile-datasource)
* @param fileName -: file relative to module path (e.g. `test/resources/berlin.bin)`
*/
export function getTestResourceUrl(module: string, fileName: string) {
Expand Down Expand Up @@ -67,9 +67,9 @@ export function getTestResourceUrl(module: string, fileName: string) {
* * `fs` module when run in a node.js environment
* * `fetch` module when run in a browser environment
*
* @param module -: module name, @here/<module_name> (e.g. @here/harp-omv-datasource)
* @param module -: module name, @here/<module_name> (e.g. @here/harp-vectortile-datasource)
* @param fileName -: the requested resource,
* (e.g. @here/harp-omv-datasource/test/resources/berlin.bin)
* (e.g. @here/harp-vectortile-datasource/test/resources/berlin.bin)
*/
export const loadTestResource = loadTestResourceNode;

Expand Down
6 changes: 3 additions & 3 deletions @here/harp-test-utils/lib/TestDataUtils.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const testResourcesRoot =
*
* Calculates URL of test resource in same way as [[loadTestResource]].
*
* @param moduleName -: module name, `@here/<module_name>` (e.g. @here/harp-omv-datasource)
* @param moduleName -: module name, `@here/<module_name>` (e.g. @here/harp-vectortile-datasource)
* @param fileName -: file relative to module path (e.g. `test/resources/berlin.bin)`
*/
export function getTestResourceUrl(module: string, fileName: string) {
Expand Down Expand Up @@ -55,9 +55,9 @@ export function getTestResourceUrl(module: string, fileName: string) {
* * `fs` module when run in a node.js environment
* * `fetch` module when run in a browser environment
*
* @param module -: module name, @here/<module_name> (e.g. @here/harp-omv-datasource)
* @param module -: module name, @here/<module_name> (e.g. @here/harp-vectortile-datasource)
* @param fileName -: the requested resource
* (e.g. @here/harp-omv-datasource/test/resources/berlin.bin)
* (e.g. @here/harp-vectortile-datasource/test/resources/berlin.bin)
*/
export const loadTestResource = loadTestResourceWeb;

Expand Down
3 changes: 1 addition & 2 deletions @here/harp-vectortile-datasource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
*/

export * from "./lib/OmvDataFilter";
export * from "./lib/OmvDataSource";
export * from "./lib/VectorTileDataSource";
export * from "./lib/OmvDecoderDefs";
export * from "./lib/OmvTile";
export * from "./lib/OmvDebugLabelsTile";
export * from "./lib/OmvRestClient";
export * from "./lib/GeoJsonDataProvider";
16 changes: 12 additions & 4 deletions @here/harp-vectortile-datasource/lib/OmvDataFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {

/**
* The `OmvFeatureFilter` is designed to work in an `OmvVisitor`/`visitOmv` combination (for
* example, `OmvDecoder`). Returning `false` from any of the calls terminates processing of that
* example, `OmvDecoder`).
*
* @remarks
* Returning `false` from any of the calls terminates processing of that
* layer or feature.
*
* The `OmvFeatureFilter` is an "early-opt-out" filter, which cannot filter individual features,
Expand Down Expand Up @@ -74,7 +77,10 @@ export interface OmvFeatureFilter {
}

/**
* The `OmvFeatureModifier` can be used to filter individual features. It gets passed in the [[Env]]
* The `OmvFeatureModifier` can be used to filter individual features.
*
* @remarks
* It gets passed in the `Env`
* of the feature, which contains all the values that can be searched for in a style. If a filter
* function returns false, the feature is ignored, and no geometry is being created.
*
Expand Down Expand Up @@ -543,7 +549,7 @@ export namespace OmvFeatureFilterDescriptionBuilder {
* `OmvFeatureFilter` implementation that uses a `OmvFeatureFilterDescription` to filter `TileData`
* features before they are completely decoded.
*
* @hidden
* @internal
*/
export class OmvGenericFeatureFilter implements OmvFeatureFilter {
private static matchLayer(
Expand Down Expand Up @@ -685,6 +691,8 @@ export class OmvGenericFeatureFilter implements OmvFeatureFilter {
/**
* An [[OmvFeatureFilter]] implementation that delegates all filter decision
* returning `true` for any predicate if all delegates return `true`.
*
* @internal
*/
export class ComposedDataFilter implements OmvFeatureFilter {
constructor(readonly filters: OmvFeatureFilter[]) {}
Expand Down Expand Up @@ -731,7 +739,7 @@ export class ComposedDataFilter implements OmvFeatureFilter {
* `OmvFeatureModifier` implementation that uses a `OmvFeatureFilterDescription` to filter
* `TileData` features before they are completely decoded.
*
* @hidden
* @internal
*/
export class OmvGenericFeatureModifier implements OmvFeatureModifier {
static matchItems(
Expand Down
5 changes: 2 additions & 3 deletions @here/harp-vectortile-datasource/lib/OmvDebugLabelsTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import { getPropertyValue, isTextTechnique } from "@here/harp-datasource-protocol";
import { TileKey } from "@here/harp-geoutils/lib/tiling/TileKey";
import { DataSource, TextElement } from "@here/harp-mapview";
import { DataSource, TextElement, Tile } from "@here/harp-mapview";
import { debugContext } from "@here/harp-mapview/lib/DebugContext";
import {
ContextualArabicConverter,
Expand All @@ -16,7 +16,6 @@ import {
import * as THREE from "three";

import { TileGeometryCreator } from "@here/harp-mapview/lib/geometry/TileGeometryCreator";
import { OmvTile } from "./OmvTile";

const debugMaterial = new THREE.LineBasicMaterial({
color: 0x000000,
Expand Down Expand Up @@ -74,7 +73,7 @@ textRenderStyle.color = new THREE.Color(0.8, 0.2, 0.2);
// Set maximum priority.
const PRIORITY_ALWAYS = Number.MAX_SAFE_INTEGER;

export class OmvDebugLabelsTile extends OmvTile {
export class OmvDebugLabelsTile extends Tile {
constructor(dataSource: DataSource, tileKey: TileKey) {
super(dataSource, tileKey);
}
Expand Down
17 changes: 16 additions & 1 deletion @here/harp-vectortile-datasource/lib/OmvDecodedTileEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import {
} from "@here/harp-geoutils";

import { ILineGeometry, IPolygonGeometry } from "./IGeometryProcessor";
import { LinesGeometry } from "./OmvDataSource";
import { IOmvEmitter } from "./OmvDecoder";
import {
tile2world,
Expand Down Expand Up @@ -158,6 +157,22 @@ function createIndexBufferAttribute(
};
}

interface LinesGeometry {
type: GeometryType;
lines: LineGroup;
technique: number;

/**
* Optional array of objects. It can be used to pass user data from the geometry to the mesh.
*/
objInfos?: AttributeMap[];

/**
* Optional list of feature start indices. The indices point into the index attribute.
*/
featureStarts?: number[];
}

// for tilezen by default extrude all buildings even those without height data
class MeshBuffers implements IMeshBuffers {
readonly positions: number[] = [];
Expand Down
2 changes: 2 additions & 0 deletions @here/harp-vectortile-datasource/lib/OmvDecoderDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export namespace OmvFilterString {
* @param str - The string to check against a filter.
* @param filterString - The filter containing the match condition.
* @returns `true` if the match condition is satisfied.
*
* @internal
*/
export function matchString(str: string, filterString: OmvFilterString): boolean {
switch (filterString.match) {
Expand Down
Loading

0 comments on commit ee1f3e3

Please sign in to comment.