How to use the @here/harp-geoutils.OrientedBox3 function in @here/harp-geoutils

To help you get started, we’ve selected a few @here/harp-geoutils 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 / harp.gl / @here / harp-mapview / lib / FrustumIntersection.ts View on Github external
// lays directly on the ground surface.
                if (useElevationRangeSource) {
                    const range = elevationRangeSource!.getElevationRange(childTileKey);
                    geoBox.southWest.altitude = range.minElevation;
                    geoBox.northEast.altitude = range.maxElevation;
                    calculationFinal =
                        calculationFinal &&
                        range.calculationStatus === CalculationStatus.FinalPrecise;
                }

                let subTileArea = 0;

                const obbIntersections: boolean =
                    this.mapView.projection.type === ProjectionType.Spherical;
                if (obbIntersections) {
                    const obb = new OrientedBox3();
                    this.mapView.projection.projectBox(geoBox, obb);
                    subTileArea = this.computeSubTileArea(obb);
                } else {
                    this.mapView.projection.projectBox(geoBox, tileBounds);
                    subTileArea = this.computeSubTileArea(tileBounds);
                }

                if (subTileArea > 0) {
                    const subTileEntry = new TileKeyEntry(
                        childTileKey,
                        subTileArea,
                        offset,
                        geoBox.southWest.altitude, // minElevation
                        geoBox.northEast.altitude // maxElevation
                    );
                    this.m_tileKeyEntries.set(tileKeyAndOffset, subTileEntry);
github heremaps / harp.gl / @here / harp-geojson-datasource / lib / GeoJsonDecoder.ts View on Github external
private getTileCenter(tileKey: TileKey) {
        const geoBox = webMercatorTilingScheme.getGeoBox(tileKey);
        const tileBounds = this.m_projection.projectBox(geoBox, new OrientedBox3());
        return tileBounds.position;
    }