Class: Image

bu.street. Image

The object that represents a single street image from Blom server. The object has an object with the metadata and do transformations for coordinates.


new Image(options)

Parameters:
Name Type Description
options bu.street.ImageOptions

Oblique image options. Take care that this options are not optional and must be present.

Source:
bu-street/streetimage.js

Extends

  • ol.Object

Methods


addHotspots(hotspots)

Adds hotspots to the list. A hotspot is just the bu.PanoramaMetadata of a street image that is near current image.

Parameters:
Name Type Description
hotspots bu.PanoramaMetadata | Array.<bu.PanoramaMetadata>

The hotspots to add.

Source:
bu-street/streetimage.js

fromLocalCoordToYawPitchCoord(coordinates)

Transforms coordinates from a local coordinate refered to capture point of the image to a yaw, pitch, distance coordinate.

Yaw is the angle in the ground plane (plane XZ in WebGL) starting at the direction represented by the central point of the image and increasing in a clockwise rotation using the +Y axis of WebGL. Angles are radians and values range from 0 to 2 * PI.

Pitch is the angle in the vertical plane (plane XY in WebGL) starting with zero at the ground level, increasing above zero when rotating upwards and decreasing below zero when downwards. Angles are radians and values range from

  • PI / 2 to + PI / 2.

Local coord means relative to real orientation of the camera when the image was taken, so it takes account of the angle rotations of the camera. It also means relative to a XYZ planes where -Z is looking north, +X is looking east and +Y is looking cenit. This are the axis commonly used in WebGL.

Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as a yaw, pitch and distance.

Source:
bu-street/streetimage.js
Returns:

Coordinates in local coordinates.

Type
bu.Coordinate | Array.<bu.Coordinate>

fromPixelCoordToProjectedCoord(coordinates)

Transforms coordinates from pixel + distance ([theta, phi, distance]) to a projected coordinate XYZ in the projection defined for this image. The projection is defined in getMetadata().srid.

Theta is the column pixel inside the image with values starting at upper left corner and increasing to the right. Values ranges from 0 to this.getWidth().

Phi is the row pixel inside the image with values starting at upper left corner and increasing to the bottom. Values ranges from 0 to this.getHeight().

Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as pixels in theta, phi, distance.

Source:
bu-street/streetimage.js
Returns:

Coordinates as XYZ in the projection defined for the image.

Type
bu.Coordinate | Array.<bu.Coordinates>

fromPixelCoordToYawPitchCoord(coordinates)

Transforms coordinates from pixel coords(theta, phi and an optional distance) to yaw, pitch (and an optional distance) inside this image. Distances are not modified and can be included here to easily concatenate others transformations.

Theta is the column pixel inside the image with values starting at upper left corner and increasing to the right. Values ranges from 0 to this.getWidth().

Phi is the row pixel inside the image with values starting at upper left corner and increasing to the bottom. Values ranges from 0 to this.getHeight().

Yaw is the angle in the ground plane (plane XZ in WebGL) starting at the direction represented by the central point of the image and increasing in a clockwise rotation using the +Y axis of WebGL. Angles are radians and values range from 0 to 2 * PI.

Pitch is the angle in the vertical plane (plane XY in WebGL) starting with zero at the ground level, increasing above zero when rotating upwards and decreasing below zero when downwards. Angles are radians and values range from

  • PI / 2 to + PI / 2.
Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as pixels.

Source:
bu-street/streetimage.js
Returns:

Coordinates transformed to yaw and pitch.

Type
bu.Coordinate | Array.<bu.Coordinate>

fromProjectedCoordToPixelCoord(coordinates)

Transforms coordinates from a projected coordinate XYZ to a pixel + distance coordinate ([theta, phi, distance]) inside this image. The projection is defined in getMetadata().srid.

Theta is the column pixel inside the image with values starting at upper left corner and increasing to the right. Values ranges from 0 to this.getWidth().

Phi is the row pixel inside the image with values starting at upper left corner and increasing to the bottom. Values ranges from 0 to this.getHeight().

Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as XYZ in the projection defined for the image.

Source:
bu-street/streetimage.js
Returns:

Coordinates transformed to pixels in theta, phi, distance.

Type
bu.Coordinate | Array.<bu.Coordinate>

fromWorldSourceToLocalSource(source, opt_source)

Returns a reflected promise that creates a new bu.source.Vector with the geometries transformed from world coordinates in 'EPSG:4326' lonlat (with or without Z values) to local XYZ coordinates. If input coordinates has no Z values or Z values are zeros (that usually is a default value for non Z values), then a default Z value is added at the ground level (that in local coords equals -cameraHeight).

A reflected promise is a promise that never rejects. If always return an object in the resolve function and never calls the reject function. The returned object has a value property if the promise was resolved or a error property if was rejected. This way this promise can be easily use in a Promise.all an return all the errors at once at the end.

Local coord means relative to real orientation of the camera when the image was taken, so it takes account of the angle rotations of the camera. It also means relative to a XYZ planes where -Z is looking north, +X is looking east and +Y is looking cenit. This are the axis commonly used in WebGL.

Parameters:
Name Type Description
source bu.source.Vector

Input source with geometries in 'EPSG:3426' lonlat projection.

opt_source ol.source.Vector

Optional destination source. If no undefined then the transformed features will be added to this source instead of creating a new one, and the function return this source.

Source:
bu-street/streetimage.js
Returns:

A promise that always returns an object in the resolve function and never rejects. The object has a type defintion as {value: Object} if the promise was resolved, where Object is either a bu.source.Vector or a ol.source.Vector, and a type definition as {error: Error} if the promise was rejected.

Type
Promise

fromYawPitchCoordToLocalCoord(coordinates)

Transforms coordinates from a yaw, pitch, distance coordinate to a local coordinate refered to capture point of the image.

Yaw is the angle in the ground plane (plane XZ in WebGL) starting at the direction represented by the central point of the image and increasing in a clockwise rotation using the +Y axis of WebGL. Angles are radians and values range from 0 to 2 * PI.

Pitch is the angle in the vertical plane (plane XY in WebGL) starting with zero at the ground level, increasing above zero when rotating upwards and decreasing below zero when downwards. Angles are radians and values range from

  • PI / 2 to + PI / 2.

Local coord means relative to real orientation of the camera when the image was taken, so it takes account of the angle rotations of the camera. It also means relative to a XYZ planes where -Z is looking north, +X is looking east and +Y is looking cenit. This are the axis commonly used in WebGL.

Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as a yaw, pitch and distance.

Source:
bu-street/streetimage.js
Returns:

Coordinates in local coordinates.

Type
bu.Coordinate | Array.<bu.Coordinate>

fromYawPitchCoordToPixelCoord(coordinates)

Transforms coordinates from yaw, pitch (and an optional distance) to pixel coords(theta, phi and an optional distance) inside this image. Distances are not modified and can be included here to easily concatenate others transformations.

Yaw is the angle in the ground plane (plane XZ in WebGL) starting at the direction represented by the central point of the image and increasing in a clockwise rotation using the +Y axis of WebGL. Angles are radians and values range from 0 to 2 * PI.

Pitch is the angle in the vertical plane (plane XY in WebGL) starting with zero at the ground level, increasing above zero when rotating upwards and decreasing below zero when downwards. Angles are radians and values range from

  • PI / 2 to + PI / 2.

Theta is the column pixel inside the image with values starting at upper left corner and increasing to the right. Values ranges from 0 to this.getWidth().

Phi is the row pixel inside the image with values starting at upper left corner and increasing to the bottom. Values ranges from 0 to this.getHeight().

Parameters:
Name Type Description
coordinates bu.Coordinate | Array.<bu.Coordinate>

Coordinates as yaw and pitch.

Source:
bu-street/streetimage.js
Returns:

Coordinates transformed to pixels.

Type
bu.Coordinate | Array.<bu.Coordinate>

getExtent(distance)

Returns the extent from the center of this street image to a given distance. Distance are meters and the extent returned is in 'EPSG:4326' lonlat.

Parameters:
Name Type Description
distance number

Distance in meters from the center of the image.

Source:
bu-street/streetimage.js
Returns:
Type
bu.Extent

getExtraZoomLevels()

Returns the number of extra zoom levels of the street image or zoom levels to add to default zoom levels. In the new zoom levels the tiles will be rescaled.

Source:
bu-street/streetimage.js
Returns:
Type
number

getHeight()

Returns the height in pixels of this image, the height of the original equirectangular image this is based on. Height is always half the width.

Source:
bu-street/streetimage.js
Returns:
Type
number

getHotspots()

Returns the array of hotspots. A hotspot is just the bu.PanoramaMetadata of a street image that is near current image.

Source:
bu-street/streetimage.js
Returns:
Type
Array.<bu.PanoramaMetadata>

getMetadata()

Returns the metadata of the street image.

Source:
bu-street/streetimage.js
Returns:
Type
bu.PanoramaMetadata

getWidth()

Returns the width in pixels of this image, the width of the original equirectangular image this is based on.

Source:
bu-street/streetimage.js
Returns:
Type
number