From 0500f51febc245e351906632e7d92300dff94484 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 5 Aug 2020 10:27:53 +0200 Subject: [PATCH] HARP-8067: Rename @here/harp-omv-datasource to @here/harp-vectortile-datasource This change renames the module `@here/harp-omv-datasource` to `@here/harp-vectortile-datasource` and it adds a compat module `@here/harp-omv-datasource` to keep backward source compatibility. Signed-off-by: Roberto Raggi --- .prettierignore | 2 +- .../lib/GeoJsonDataProvider.ts | 2 +- .../lib/GeoJsonDataSource.ts | 2 +- .../lib/GeoJsonTileDecoderService.ts | 6 +- @here/harp-geojson-datasource/package.json | 2 +- @here/harp-omv-datasource/index-worker.ts | 4 +- @here/harp-omv-datasource/index.ts | 8 +- @here/harp-omv-datasource/package.json | 18 +- @here/harp-vectortile-datasource/.gitignore | 11 + @here/harp-vectortile-datasource/.npmignore | 10 + @here/harp-vectortile-datasource/.yarnrc | 2 + @here/harp-vectortile-datasource/LICENSE | 201 ++++++++++++++++++ @here/harp-vectortile-datasource/README.md | 53 +++++ .../index-worker.ts | 9 + @here/harp-vectortile-datasource/index.ts | 21 ++ .../lib/DecodeInfo.ts | 0 .../lib/GeoJsonDataProvider.ts | 0 .../lib/IGeometryProcessor.ts | 0 .../lib/OmvData.ts | 0 .../lib/OmvDataFilter.ts | 0 .../lib/OmvDataSource.ts | 0 .../lib/OmvDebugLabelsTile.ts | 0 .../lib/OmvDecodedTileEmitter.ts | 0 .../lib/OmvDecoder.ts | 0 .../lib/OmvDecoderDefs.ts | 0 .../lib/OmvPoliticalViewFeatureModifier.ts | 0 .../lib/OmvRestClient.ts | 0 .../lib/OmvTile.ts | 0 .../lib/OmvTiler.ts | 0 .../lib/OmvTomTomFeatureModifier.ts | 0 .../lib/OmvUtils.ts | 0 .../lib/Ring.ts | 0 .../lib/StyleSetDataFilter.ts | 0 .../lib/TiledGeoJsonAdapter.ts | 0 .../lib/VTJsonDataAdapter.ts | 0 .../lib/proto/vector_tile.d.ts | 0 .../lib/proto/vector_tile.js | 0 .../lib/proto/vector_tile.proto | 0 @here/harp-vectortile-datasource/package.json | 69 ++++++ .../test/MapViewPickingTest.ts | 0 .../test/OmvDataSourceTest.ts | 0 .../test/OmvDecodedTileEmitterTest.ts | 0 .../test/OmvRestClientTest.ts | 0 .../test/OmvTest.ts | 0 .../test/OmvTomTomFeatureModifierTest.ts | 0 .../test/RingTest.ts | 0 .../test/resources/geoJsonData.ts | 0 .../harp-vectortile-datasource/tsconfig.json | 45 ++++ scripts/test-npm-packages.sh | 1 + test/performance/OmvDecoderPerformanceTest.ts | 12 +- test/performance/package.json | 1 + test/rendering/GeoJsonDataRendering.ts | 4 +- test/rendering/StylingTest.ts | 2 +- test/rendering/package.json | 2 +- 54 files changed, 444 insertions(+), 43 deletions(-) create mode 100644 @here/harp-vectortile-datasource/.gitignore create mode 100644 @here/harp-vectortile-datasource/.npmignore create mode 100644 @here/harp-vectortile-datasource/.yarnrc create mode 100644 @here/harp-vectortile-datasource/LICENSE create mode 100644 @here/harp-vectortile-datasource/README.md create mode 100644 @here/harp-vectortile-datasource/index-worker.ts create mode 100644 @here/harp-vectortile-datasource/index.ts rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/DecodeInfo.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/GeoJsonDataProvider.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/IGeometryProcessor.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvData.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDataFilter.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDataSource.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDebugLabelsTile.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDecodedTileEmitter.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDecoder.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvDecoderDefs.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvPoliticalViewFeatureModifier.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvRestClient.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvTile.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvTiler.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvTomTomFeatureModifier.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/OmvUtils.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/Ring.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/StyleSetDataFilter.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/TiledGeoJsonAdapter.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/VTJsonDataAdapter.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/proto/vector_tile.d.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/proto/vector_tile.js (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/lib/proto/vector_tile.proto (100%) create mode 100644 @here/harp-vectortile-datasource/package.json rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/MapViewPickingTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/OmvDataSourceTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/OmvDecodedTileEmitterTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/OmvRestClientTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/OmvTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/OmvTomTomFeatureModifierTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/RingTest.ts (100%) rename @here/{harp-omv-datasource => harp-vectortile-datasource}/test/resources/geoJsonData.ts (100%) create mode 100644 @here/harp-vectortile-datasource/tsconfig.json diff --git a/.prettierignore b/.prettierignore index d81628bcba..0b68aa8091 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ -@here/harp-omv-datasource/lib/proto/vector_tile.d.ts +@here/harp-vectortile-datasource/lib/proto/vector_tile.d.ts @here/harp-datasource-protocol/theme.schema.json @here/harp-map-theme/resources/fonts/ @here/harp-text-canvas/resources/fonts/ diff --git a/@here/harp-geojson-datasource/lib/GeoJsonDataProvider.ts b/@here/harp-geojson-datasource/lib/GeoJsonDataProvider.ts index 71c9547d8a..adb182f5f3 100644 --- a/@here/harp-geojson-datasource/lib/GeoJsonDataProvider.ts +++ b/@here/harp-geojson-datasource/lib/GeoJsonDataProvider.ts @@ -4,4 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -export { GeoJsonDataProvider, GeoJsonDataProviderOptions } from "@here/harp-omv-datasource"; +export { GeoJsonDataProvider, GeoJsonDataProviderOptions } from "@here/harp-vectortile-datasource"; diff --git a/@here/harp-geojson-datasource/lib/GeoJsonDataSource.ts b/@here/harp-geojson-datasource/lib/GeoJsonDataSource.ts index 1e396aa532..3d2aecb836 100644 --- a/@here/harp-geojson-datasource/lib/GeoJsonDataSource.ts +++ b/@here/harp-geojson-datasource/lib/GeoJsonDataSource.ts @@ -8,7 +8,7 @@ import { OmvDataSource, OmvWithCustomDataProvider, OmvWithRestClientParams -} from "@here/harp-omv-datasource"; +} from "@here/harp-vectortile-datasource"; /** * `GeoJsonDataSource` is used for the visualization of geometric objects provided in the GeoJSON diff --git a/@here/harp-geojson-datasource/lib/GeoJsonTileDecoderService.ts b/@here/harp-geojson-datasource/lib/GeoJsonTileDecoderService.ts index 4493b7464c..ed4c855c3f 100644 --- a/@here/harp-geojson-datasource/lib/GeoJsonTileDecoderService.ts +++ b/@here/harp-geojson-datasource/lib/GeoJsonTileDecoderService.ts @@ -9,13 +9,13 @@ import { LoggerManager } from "@here/harp-utils"; const logger = LoggerManager.instance.create("WorkerService", { enabled: false }); /** - * @deprecated GeoJsonTileDecoderService Use {@link @here/harp-omv-datasource#OmvTileDecoderService} - * instead. + * @deprecated GeoJsonTileDecoderService Use + * {@link @here/harp-vectortile-datasource#OmvTileDecoderService} instead. */ export class GeoJsonTileDecoderService { /** * @deprecated GeoJsonTileDecoderService Use - * {@link @here/harp-omv-datasource#OmvTileDecoderService} instead. + * {@link @here/harp-vectortile-datasource#OmvTileDecoderService} instead. */ start() { logger.warn( diff --git a/@here/harp-geojson-datasource/package.json b/@here/harp-geojson-datasource/package.json index 97dd94059d..312b99fa19 100644 --- a/@here/harp-geojson-datasource/package.json +++ b/@here/harp-geojson-datasource/package.json @@ -24,7 +24,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@here/harp-omv-datasource": "^0.18.0", + "@here/harp-vectortile-datasource": "^0.18.0", "@here/harp-utils": "^0.18.0" }, "devDependencies": { diff --git a/@here/harp-omv-datasource/index-worker.ts b/@here/harp-omv-datasource/index-worker.ts index f90e602903..0d19a3c27c 100644 --- a/@here/harp-omv-datasource/index-worker.ts +++ b/@here/harp-omv-datasource/index-worker.ts @@ -4,6 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -export * from "./lib/OmvDecoder"; -export * from "./lib/OmvTiler"; -export * from "./lib/OmvDecoderDefs"; +export * from "@here/harp-vectortile-datasource/index-worker"; diff --git a/@here/harp-omv-datasource/index.ts b/@here/harp-omv-datasource/index.ts index 4261c6548f..d503a05467 100644 --- a/@here/harp-omv-datasource/index.ts +++ b/@here/harp-omv-datasource/index.ts @@ -12,10 +12,4 @@ * @packageDocumentation */ -export * from "./lib/OmvDataFilter"; -export * from "./lib/OmvDataSource"; -export * from "./lib/OmvDecoderDefs"; -export * from "./lib/OmvTile"; -export * from "./lib/OmvDebugLabelsTile"; -export * from "./lib/OmvRestClient"; -export * from "./lib/GeoJsonDataProvider"; +export * from "@here/harp-vectortile-datasource"; diff --git a/@here/harp-omv-datasource/package.json b/@here/harp-omv-datasource/package.json index 1575511242..14b62b9b51 100644 --- a/@here/harp-omv-datasource/package.json +++ b/@here/harp-omv-datasource/package.json @@ -13,8 +13,7 @@ }, "scripts": { "build": "tsc --build $EXTRA_TSC_ARGS", - "test": "cross-env mocha --require source-map-support/register $EXTRA_MOCHA_ARGS ./test/OmvTest.js", - "gen-decoder": "pbjs -t static-module -w commonjs --no-encode --no-verify --no-create lib/proto/vector_tile.proto -o lib/proto/vector_tile.js && pbts lib/proto/vector_tile.js -o lib/proto/vector_tile.d.ts", + "test": "cross-env mocha --require source-map-support/register $EXTRA_MOCHA_ARGS ./test/*.js", "prepare": "cross-env tsc --build $EXTRA_TSC_ARGS" }, "repository": { @@ -28,20 +27,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@here/harp-datasource-protocol": "^0.18.0", - "@here/harp-geometry": "^0.18.0", - "@here/harp-geoutils": "^0.18.0", - "@here/harp-lines": "^0.18.0", - "@here/harp-lrucache": "^0.18.0", - "@here/harp-mapview": "^0.18.0", - "@here/harp-mapview-decoder": "^0.18.0", - "@here/harp-materials": "^0.18.0", - "@here/harp-text-canvas": "^0.18.0", - "@here/harp-transfer-manager": "^0.18.0", - "@here/harp-utils": "^0.18.0", - "earcut": "^2.2.2", - "long": "^4.0.0", - "protobufjs": "^6.9.0" + "@here/harp-vectortile-datasource": "^0.18.0" }, "devDependencies": { "@here/harp-fetch": "^0.18.0", diff --git a/@here/harp-vectortile-datasource/.gitignore b/@here/harp-vectortile-datasource/.gitignore new file mode 100644 index 0000000000..2728efda5d --- /dev/null +++ b/@here/harp-vectortile-datasource/.gitignore @@ -0,0 +1,11 @@ +.vscode +.idea +node_modules +dist +*.d.ts +*.js +*.js.map +!./lib/typings/earcut.d.ts +!./lib/proto/vector_tile.js +!./lib/proto/vector_tile.d.ts +*.tgz diff --git a/@here/harp-vectortile-datasource/.npmignore b/@here/harp-vectortile-datasource/.npmignore new file mode 100644 index 0000000000..de7c45b475 --- /dev/null +++ b/@here/harp-vectortile-datasource/.npmignore @@ -0,0 +1,10 @@ +*.ts +!*.d.ts +test/ +tsconfig.json +.gitignore +.gitreview +*.proto +*.tgz +*.map +*.tsbuildinfo diff --git a/@here/harp-vectortile-datasource/.yarnrc b/@here/harp-vectortile-datasource/.yarnrc new file mode 100644 index 0000000000..89181f464d --- /dev/null +++ b/@here/harp-vectortile-datasource/.yarnrc @@ -0,0 +1,2 @@ +version-git-message "@here/harp-vectortile-datasource %s" +version-tag-prefix "@here/harp-vectortile-datasource@" diff --git a/@here/harp-vectortile-datasource/LICENSE b/@here/harp-vectortile-datasource/LICENSE new file mode 100644 index 0000000000..66b0c46095 --- /dev/null +++ b/@here/harp-vectortile-datasource/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/@here/harp-vectortile-datasource/README.md b/@here/harp-vectortile-datasource/README.md new file mode 100644 index 0000000000..96ee7ae01d --- /dev/null +++ b/@here/harp-vectortile-datasource/README.md @@ -0,0 +1,53 @@ +# @here/harp-vectortile-datasource + +## Overview + +This module provides the implementation of [HERE](https://www.here.com)'s +Optimized Map for Visualization (OMV) Datasource. + +This format follows the [Vector Tile Specification](https://github.com/mapbox/vector-tile-spec/). +This JSON format contains geometries, such as points and lines that define polygons, labels, +such as road names or city names, and other kinds of data that are typically passed to a renderer to draw a map. + +Each tile is encoded using [Protobuf](https://github.com/google/protobuf). + +## REST Clients + +### HERE Vector Tiles + +REST service implemented with `APIFormat.HereV1` in `OmvRestClient.ts` if you want to use `AuthenticationTypeBearer` by default, if you want to use `APIKey` you can use `APIFormat.XYZOMV`. + +You can find more about the different access methods [here](https://developer.here.com/documentation/authentication/dev_guide/index.html). + +The HERE Vector Tile Service allows you to request tiles containing vector data +using content from the [HERE Open Location Platform](https://openlocation.here.com/). + +HERE provides global coverage and updates the data continuously. +For more information about our map content, see the [HERE Map Content Guidelines](https://repo.platform.here.com/artifactory/open-location-platform-docs/Data_Specifications/HERE_Map_Content/). + +### HERE XYZ + +REST services implemented with `APIFormat.XYZMVT`, `APIFormat.XYZJson` and `APIFormat.XYZOMV` in `OmvRestClient.ts`. + +The HERE XYZ Services offer three variants: + +* MVT: offer [Open Street Map Data](https://www.openstreetmap.org) tiles in MVT Format. +* JSON: offer [Open Street Map Data](https://www.openstreetmap.org) tiles in JSON Format. +* OMV: offer HERE Data tiles in OMV Format. The data source is the same as in the [HERE Vector Tiles](#here-vector-tiles). + +You can find more about the HERE XYZ Services [here](https://www.here.xyz/). + +### Mapbox Vector Tiles + +REST service implemented with `APIFormat.MapboxV7` in `OmvRestClient.ts`. + +You can find more information [here](https://docs.mapbox.com/vector-tiles/reference/). + +## Tom Tom Vector Tiles + +You can find more information [here](https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile). + +## Usage of REST APIs and authentication + +It is not within the scope of `harp.gl` to provide credentials to all of the services implemented above, but following the links you can do it by yourself. +On our [Getting Started Guide](../../docs/GettingStartedGuide.md) there is more information about getting credentials for HERE Services. diff --git a/@here/harp-vectortile-datasource/index-worker.ts b/@here/harp-vectortile-datasource/index-worker.ts new file mode 100644 index 0000000000..f90e602903 --- /dev/null +++ b/@here/harp-vectortile-datasource/index-worker.ts @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2017-2020 HERE Europe B.V. + * Licensed under Apache 2.0, see full license in LICENSE + * SPDX-License-Identifier: Apache-2.0 + */ + +export * from "./lib/OmvDecoder"; +export * from "./lib/OmvTiler"; +export * from "./lib/OmvDecoderDefs"; diff --git a/@here/harp-vectortile-datasource/index.ts b/@here/harp-vectortile-datasource/index.ts new file mode 100644 index 0000000000..4261c6548f --- /dev/null +++ b/@here/harp-vectortile-datasource/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017-2020 HERE Europe B.V. + * Licensed under Apache 2.0, see full license in LICENSE + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * HERE OMV Data source. + * + * @remarks + * + * @packageDocumentation + */ + +export * from "./lib/OmvDataFilter"; +export * from "./lib/OmvDataSource"; +export * from "./lib/OmvDecoderDefs"; +export * from "./lib/OmvTile"; +export * from "./lib/OmvDebugLabelsTile"; +export * from "./lib/OmvRestClient"; +export * from "./lib/GeoJsonDataProvider"; diff --git a/@here/harp-omv-datasource/lib/DecodeInfo.ts b/@here/harp-vectortile-datasource/lib/DecodeInfo.ts similarity index 100% rename from @here/harp-omv-datasource/lib/DecodeInfo.ts rename to @here/harp-vectortile-datasource/lib/DecodeInfo.ts diff --git a/@here/harp-omv-datasource/lib/GeoJsonDataProvider.ts b/@here/harp-vectortile-datasource/lib/GeoJsonDataProvider.ts similarity index 100% rename from @here/harp-omv-datasource/lib/GeoJsonDataProvider.ts rename to @here/harp-vectortile-datasource/lib/GeoJsonDataProvider.ts diff --git a/@here/harp-omv-datasource/lib/IGeometryProcessor.ts b/@here/harp-vectortile-datasource/lib/IGeometryProcessor.ts similarity index 100% rename from @here/harp-omv-datasource/lib/IGeometryProcessor.ts rename to @here/harp-vectortile-datasource/lib/IGeometryProcessor.ts diff --git a/@here/harp-omv-datasource/lib/OmvData.ts b/@here/harp-vectortile-datasource/lib/OmvData.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvData.ts rename to @here/harp-vectortile-datasource/lib/OmvData.ts diff --git a/@here/harp-omv-datasource/lib/OmvDataFilter.ts b/@here/harp-vectortile-datasource/lib/OmvDataFilter.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDataFilter.ts rename to @here/harp-vectortile-datasource/lib/OmvDataFilter.ts diff --git a/@here/harp-omv-datasource/lib/OmvDataSource.ts b/@here/harp-vectortile-datasource/lib/OmvDataSource.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDataSource.ts rename to @here/harp-vectortile-datasource/lib/OmvDataSource.ts diff --git a/@here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts b/@here/harp-vectortile-datasource/lib/OmvDebugLabelsTile.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts rename to @here/harp-vectortile-datasource/lib/OmvDebugLabelsTile.ts diff --git a/@here/harp-omv-datasource/lib/OmvDecodedTileEmitter.ts b/@here/harp-vectortile-datasource/lib/OmvDecodedTileEmitter.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDecodedTileEmitter.ts rename to @here/harp-vectortile-datasource/lib/OmvDecodedTileEmitter.ts diff --git a/@here/harp-omv-datasource/lib/OmvDecoder.ts b/@here/harp-vectortile-datasource/lib/OmvDecoder.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDecoder.ts rename to @here/harp-vectortile-datasource/lib/OmvDecoder.ts diff --git a/@here/harp-omv-datasource/lib/OmvDecoderDefs.ts b/@here/harp-vectortile-datasource/lib/OmvDecoderDefs.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvDecoderDefs.ts rename to @here/harp-vectortile-datasource/lib/OmvDecoderDefs.ts diff --git a/@here/harp-omv-datasource/lib/OmvPoliticalViewFeatureModifier.ts b/@here/harp-vectortile-datasource/lib/OmvPoliticalViewFeatureModifier.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvPoliticalViewFeatureModifier.ts rename to @here/harp-vectortile-datasource/lib/OmvPoliticalViewFeatureModifier.ts diff --git a/@here/harp-omv-datasource/lib/OmvRestClient.ts b/@here/harp-vectortile-datasource/lib/OmvRestClient.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvRestClient.ts rename to @here/harp-vectortile-datasource/lib/OmvRestClient.ts diff --git a/@here/harp-omv-datasource/lib/OmvTile.ts b/@here/harp-vectortile-datasource/lib/OmvTile.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvTile.ts rename to @here/harp-vectortile-datasource/lib/OmvTile.ts diff --git a/@here/harp-omv-datasource/lib/OmvTiler.ts b/@here/harp-vectortile-datasource/lib/OmvTiler.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvTiler.ts rename to @here/harp-vectortile-datasource/lib/OmvTiler.ts diff --git a/@here/harp-omv-datasource/lib/OmvTomTomFeatureModifier.ts b/@here/harp-vectortile-datasource/lib/OmvTomTomFeatureModifier.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvTomTomFeatureModifier.ts rename to @here/harp-vectortile-datasource/lib/OmvTomTomFeatureModifier.ts diff --git a/@here/harp-omv-datasource/lib/OmvUtils.ts b/@here/harp-vectortile-datasource/lib/OmvUtils.ts similarity index 100% rename from @here/harp-omv-datasource/lib/OmvUtils.ts rename to @here/harp-vectortile-datasource/lib/OmvUtils.ts diff --git a/@here/harp-omv-datasource/lib/Ring.ts b/@here/harp-vectortile-datasource/lib/Ring.ts similarity index 100% rename from @here/harp-omv-datasource/lib/Ring.ts rename to @here/harp-vectortile-datasource/lib/Ring.ts diff --git a/@here/harp-omv-datasource/lib/StyleSetDataFilter.ts b/@here/harp-vectortile-datasource/lib/StyleSetDataFilter.ts similarity index 100% rename from @here/harp-omv-datasource/lib/StyleSetDataFilter.ts rename to @here/harp-vectortile-datasource/lib/StyleSetDataFilter.ts diff --git a/@here/harp-omv-datasource/lib/TiledGeoJsonAdapter.ts b/@here/harp-vectortile-datasource/lib/TiledGeoJsonAdapter.ts similarity index 100% rename from @here/harp-omv-datasource/lib/TiledGeoJsonAdapter.ts rename to @here/harp-vectortile-datasource/lib/TiledGeoJsonAdapter.ts diff --git a/@here/harp-omv-datasource/lib/VTJsonDataAdapter.ts b/@here/harp-vectortile-datasource/lib/VTJsonDataAdapter.ts similarity index 100% rename from @here/harp-omv-datasource/lib/VTJsonDataAdapter.ts rename to @here/harp-vectortile-datasource/lib/VTJsonDataAdapter.ts diff --git a/@here/harp-omv-datasource/lib/proto/vector_tile.d.ts b/@here/harp-vectortile-datasource/lib/proto/vector_tile.d.ts similarity index 100% rename from @here/harp-omv-datasource/lib/proto/vector_tile.d.ts rename to @here/harp-vectortile-datasource/lib/proto/vector_tile.d.ts diff --git a/@here/harp-omv-datasource/lib/proto/vector_tile.js b/@here/harp-vectortile-datasource/lib/proto/vector_tile.js similarity index 100% rename from @here/harp-omv-datasource/lib/proto/vector_tile.js rename to @here/harp-vectortile-datasource/lib/proto/vector_tile.js diff --git a/@here/harp-omv-datasource/lib/proto/vector_tile.proto b/@here/harp-vectortile-datasource/lib/proto/vector_tile.proto similarity index 100% rename from @here/harp-omv-datasource/lib/proto/vector_tile.proto rename to @here/harp-vectortile-datasource/lib/proto/vector_tile.proto diff --git a/@here/harp-vectortile-datasource/package.json b/@here/harp-vectortile-datasource/package.json new file mode 100644 index 0000000000..99bf896b52 --- /dev/null +++ b/@here/harp-vectortile-datasource/package.json @@ -0,0 +1,69 @@ +{ + "name": "@here/harp-vectortile-datasource", + "version": "0.18.0", + "description": "HERE Vector Tile Data Source", + "main": "index.js", + "typings": "index", + "worker": { + "name": "@here/harp-vectortile-datasource-worker", + "main": "index-worker.js" + }, + "directories": { + "test": "test" + }, + "scripts": { + "build": "tsc --build $EXTRA_TSC_ARGS", + "test": "cross-env mocha --require source-map-support/register $EXTRA_MOCHA_ARGS ./test/OmvTest.js", + "gen-decoder": "pbjs -t static-module -w commonjs --no-encode --no-verify --no-create lib/proto/vector_tile.proto -o lib/proto/vector_tile.js && pbts lib/proto/vector_tile.js -o lib/proto/vector_tile.d.ts", + "prepare": "cross-env tsc --build $EXTRA_TSC_ARGS" + }, + "repository": { + "type": "git", + "url": "https://github.com/heremaps/harp.gl.git", + "directory": "@here/harp-vectortile-datasource" + }, + "author": { + "name": "HERE Europe B.V.", + "url": "https://here.com" + }, + "license": "Apache-2.0", + "dependencies": { + "@here/harp-datasource-protocol": "^0.18.0", + "@here/harp-geometry": "^0.18.0", + "@here/harp-geoutils": "^0.18.0", + "@here/harp-lines": "^0.18.0", + "@here/harp-lrucache": "^0.18.0", + "@here/harp-mapview": "^0.18.0", + "@here/harp-mapview-decoder": "^0.18.0", + "@here/harp-materials": "^0.18.0", + "@here/harp-text-canvas": "^0.18.0", + "@here/harp-transfer-manager": "^0.18.0", + "@here/harp-utils": "^0.18.0", + "earcut": "^2.2.2", + "long": "^4.0.0", + "protobufjs": "^6.9.0" + }, + "devDependencies": { + "@here/harp-fetch": "^0.18.0", + "@here/harp-test-utils": "^0.18.0", + "@types/chai": "^4.2.11", + "@types/earcut": "^2.1.1", + "@types/long": "^4.0.1", + "@types/mocha": "^7.0.2", + "@types/node": "^14.0.5", + "@types/sinon": "^9.0.4", + "chai": "^4.0.2", + "copyfiles": "^2.2.0", + "cross-env": "^7.0.2", + "mocha": "^7.2.0", + "sinon": "^9.0.2", + "source-map-support": "^0.5.19", + "typescript": "^3.9.3" + }, + "peerDependencies": { + "three": "^0.119.0" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/@here/harp-omv-datasource/test/MapViewPickingTest.ts b/@here/harp-vectortile-datasource/test/MapViewPickingTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/MapViewPickingTest.ts rename to @here/harp-vectortile-datasource/test/MapViewPickingTest.ts diff --git a/@here/harp-omv-datasource/test/OmvDataSourceTest.ts b/@here/harp-vectortile-datasource/test/OmvDataSourceTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/OmvDataSourceTest.ts rename to @here/harp-vectortile-datasource/test/OmvDataSourceTest.ts diff --git a/@here/harp-omv-datasource/test/OmvDecodedTileEmitterTest.ts b/@here/harp-vectortile-datasource/test/OmvDecodedTileEmitterTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/OmvDecodedTileEmitterTest.ts rename to @here/harp-vectortile-datasource/test/OmvDecodedTileEmitterTest.ts diff --git a/@here/harp-omv-datasource/test/OmvRestClientTest.ts b/@here/harp-vectortile-datasource/test/OmvRestClientTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/OmvRestClientTest.ts rename to @here/harp-vectortile-datasource/test/OmvRestClientTest.ts diff --git a/@here/harp-omv-datasource/test/OmvTest.ts b/@here/harp-vectortile-datasource/test/OmvTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/OmvTest.ts rename to @here/harp-vectortile-datasource/test/OmvTest.ts diff --git a/@here/harp-omv-datasource/test/OmvTomTomFeatureModifierTest.ts b/@here/harp-vectortile-datasource/test/OmvTomTomFeatureModifierTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/OmvTomTomFeatureModifierTest.ts rename to @here/harp-vectortile-datasource/test/OmvTomTomFeatureModifierTest.ts diff --git a/@here/harp-omv-datasource/test/RingTest.ts b/@here/harp-vectortile-datasource/test/RingTest.ts similarity index 100% rename from @here/harp-omv-datasource/test/RingTest.ts rename to @here/harp-vectortile-datasource/test/RingTest.ts diff --git a/@here/harp-omv-datasource/test/resources/geoJsonData.ts b/@here/harp-vectortile-datasource/test/resources/geoJsonData.ts similarity index 100% rename from @here/harp-omv-datasource/test/resources/geoJsonData.ts rename to @here/harp-vectortile-datasource/test/resources/geoJsonData.ts diff --git a/@here/harp-vectortile-datasource/tsconfig.json b/@here/harp-vectortile-datasource/tsconfig.json new file mode 100644 index 0000000000..d05aee4f56 --- /dev/null +++ b/@here/harp-vectortile-datasource/tsconfig.json @@ -0,0 +1,45 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "sourceMap": true, + "composite": true, + "incremental": true, + "declarationMap": true + }, + "exclude": ["dist/**", "test/**", "node_modules"], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lines" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-mapview-decoder" + }, + { + "path": "../harp-materials" + }, + { + "path": "../harp-text-canvas" + }, + { + "path": "../harp-transfer-manager" + }, + { + "path": "../harp-utils" + } + ] +} diff --git a/scripts/test-npm-packages.sh b/scripts/test-npm-packages.sh index a11d71000a..71b764b1ea 100755 --- a/scripts/test-npm-packages.sh +++ b/scripts/test-npm-packages.sh @@ -21,6 +21,7 @@ packages="\ @here/harp-mapview \ @here/harp-mapview-decoder \ @here/harp-materials \ + @here/harp-vectortile-datasource \ @here/harp-omv-datasource \ @here/harp-text-canvas \ @here/harp-transfer-manager \ diff --git a/test/performance/OmvDecoderPerformanceTest.ts b/test/performance/OmvDecoderPerformanceTest.ts index db687ef723..536f9e8fa4 100644 --- a/test/performance/OmvDecoderPerformanceTest.ts +++ b/test/performance/OmvDecoderPerformanceTest.ts @@ -24,16 +24,16 @@ import { OmvRestClient, OmvRestClientParameters } from "@here/harp-omv-datasource"; -import { DecodeInfo } from "@here/harp-omv-datasource/lib/DecodeInfo"; +import { getTestResourceUrl } from "@here/harp-test-utils"; +import { measurePerformanceSync } from "@here/harp-test-utils/lib/ProfileHelper"; +import { DecodeInfo } from "@here/harp-vectortile-datasource/lib/DecodeInfo"; import { IGeometryProcessor, ILineGeometry, IPolygonGeometry -} from "@here/harp-omv-datasource/lib/IGeometryProcessor"; -import { OmvProtobufDataAdapter } from "@here/harp-omv-datasource/lib/OmvData"; -import { OmvDecoder } from "@here/harp-omv-datasource/lib/OmvDecoder"; -import { getTestResourceUrl } from "@here/harp-test-utils"; -import { measurePerformanceSync } from "@here/harp-test-utils/lib/ProfileHelper"; +} from "@here/harp-vectortile-datasource/lib/IGeometryProcessor"; +import { OmvProtobufDataAdapter } from "@here/harp-vectortile-datasource/lib/OmvData"; +import { OmvDecoder } from "@here/harp-vectortile-datasource/lib/OmvDecoder"; export interface OMVDecoderPerformanceTestOptions { /** diff --git a/test/performance/package.json b/test/performance/package.json index e6921c6c5b..629f78eb5a 100644 --- a/test/performance/package.json +++ b/test/performance/package.json @@ -13,6 +13,7 @@ "@here/harp-lines": "^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-test-utils": "^0.18.0", "@types/chai": "^4.2.11", "chai": "^4.2.0", diff --git a/test/rendering/GeoJsonDataRendering.ts b/test/rendering/GeoJsonDataRendering.ts index bc639b288c..ed73713ac7 100644 --- a/test/rendering/GeoJsonDataRendering.ts +++ b/test/rendering/GeoJsonDataRendering.ts @@ -11,9 +11,9 @@ import { FeatureCollection, GeoJson, Light, StyleSet, Theme } from "@here/harp-d import { GeoCoordinates, webMercatorTilingScheme } from "@here/harp-geoutils"; import { LookAtParams, MapView, MapViewEventNames } from "@here/harp-mapview"; import { GeoJsonTiler } from "@here/harp-mapview-decoder/index-worker"; -import { GeoJsonDataProvider, OmvDataSource } from "@here/harp-omv-datasource"; -import { OmvTileDecoder } from "@here/harp-omv-datasource/lib/OmvDecoder"; import { RenderingTestHelper, waitForEvent } from "@here/harp-test-utils"; +import { GeoJsonDataProvider, OmvDataSource } from "@here/harp-vectortile-datasource"; +import { OmvTileDecoder } from "@here/harp-vectortile-datasource/lib/OmvDecoder"; describe("MapView + OmvDataSource + GeoJsonDataProvider rendering test", function() { let mapView: MapView; diff --git a/test/rendering/StylingTest.ts b/test/rendering/StylingTest.ts index d318088ee0..a224310a0f 100644 --- a/test/rendering/StylingTest.ts +++ b/test/rendering/StylingTest.ts @@ -29,10 +29,10 @@ import { FeaturesDataSource } from "@here/harp-features-datasource"; import { GeoBox, OrientedBox3, ProjectionType } from "@here/harp-geoutils"; import { LookAtParams, MapAnchor, MapView, MapViewEventNames } from "@here/harp-mapview"; import { GeoJsonTiler } from "@here/harp-mapview-decoder/index-worker"; -import { OmvTileDecoder } from "@here/harp-omv-datasource/index-worker"; import { getPlatform, RenderingTestHelper, TestOptions, waitForEvent } from "@here/harp-test-utils"; import { getReferenceImageUrl } from "@here/harp-test-utils/lib/rendering/ReferenceImageLocator"; import { getOptionValue, mergeWithOptions } from "@here/harp-utils"; +import { OmvTileDecoder } from "@here/harp-vectortile-datasource/index-worker"; interface RenderingTestOptions extends TestOptions { /** diff --git a/test/rendering/package.json b/test/rendering/package.json index 41fb528a20..11b39a5f9f 100644 --- a/test/rendering/package.json +++ b/test/rendering/package.json @@ -14,7 +14,7 @@ "@here/harp-geoutils": "^0.18.0", "@here/harp-mapview": "^0.18.0", "@here/harp-mapview-decoder": "^0.18.0", - "@here/harp-omv-datasource": "^0.18.0", + "@here/harp-vectortile-datasource": "^0.18.0", "@here/harp-test-utils": "^0.18.0", "@here/harp-utils": "^0.18.0", "@types/chai": "^4.2.11",