Class: Image

Mapspace.street. Image

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


new Image(options)

Parameters:
Name Type Description
options Mapspace.street.ImageOptions

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

Source:
mapspace-street/streetimage.js

Extends

  • ol.Object

Methods


fromLocalCoordToLonLat(coordinates)

Transforms coordinates from local coordinates refered to capture point of the image to WGS84 LonLat.

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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates in local coordinates.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates as [longitude, latitude, elevation].

Type
Mapspace.Coordinate | Array.<Mapspace.Coordinate>

fromLocalCoordToProjectedCoord(coordinates)

Transforms coordinates from a local coordinate refered to capture point of the image to a projected coordinate XYZ in the projection defined for the image.

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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates in local coordinates.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates as XYZ in the projection defined for the image.

Type
Mapspace.Coordinate | Array.<Mapspace.Coordinate>

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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates in local coordinates.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates as a yaw, pitch and distance.

Type
Mapspace.Coordinate | Array.<Mapspace.Coordinate>

fromLonLatToLocalCoord(coordinates)

Transforms coordinates from WGS84 LonLat to local coordinates refered to capture point of the image.

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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as [longitude, latitude, elevation].

Source:
mapspace-street/streetimage.js
Returns:

Coordinates in local coordinates.

Type
Mapspace.Coordinate | Array.<Mapspace.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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as pixels in theta, phi, distance.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates as XYZ in the projection defined for the image.

Type
Mapspace.Coordinate | Array.<Mapspace.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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as pixels.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates transformed to yaw and pitch.

Type
Mapspace.Coordinate | Array.<Mapspace.Coordinate>

fromProjectedCoordToLocalCoord(coordinates)

Transforms coordinates from a projected coordinate XYZ to a local coordinate refered to capture point of the image.

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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as XYZ in the projection defined for the image.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates in local coordinates.

Type
Mapspace.Coordinate | Array.<Mapspace.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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as XYZ in the projection defined for the image.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates transformed to pixels in theta, phi, distance.

Type
Mapspace.Coordinate | Array.<Mapspace.Coordinate>

fromWorldSourceToLocalSource(source, opt_source)

Returns a reflected promise that creates a new Mapspace.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 Mapspace.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:
mapspace-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 Mapspace.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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as a yaw, pitch and distance.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates in local coordinates.

Type
Mapspace.Coordinate | Array.<Mapspace.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 Mapspace.Coordinate | Array.<Mapspace.Coordinate>

Coordinates as yaw and pitch.

Source:
mapspace-street/streetimage.js
Returns:

Coordinates transformed to pixels.

Type
Mapspace.Coordinate | Array.<Mapspace.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:
mapspace-street/streetimage.js
Returns:
Type
Mapspace.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:
mapspace-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:
mapspace-street/streetimage.js
Returns:
Type
number

getMetadata()

Returns the metadata of the street image.

Source:
mapspace-street/streetimage.js
Returns:
Type
Mapspace.PanoramaMetadata

getRotationForFacing(yawPitch)

Returns the rotation in vertical +Y axis to apply to a plane geometry object to make it facing the camera position (the shot point of the image). This is useful to position popups with text facing in the direction of view.

Parameters:
Name Type Description
yawPitch Mapspace.Coordinate

Any 2D or 3D coordinate where first value is yaw, second is pitch and optionally third is distance. 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.
Source:
mapspace-street/streetimage.js
Returns:
Type
number

getWidth()

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

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

hasDepthMap()

Returns if the image has a metadata indicating that depth map data is available for this image. Depth map data y a 3D data of depth that allows to position a pixel in the 3D space.

Source:
mapspace-street/streetimage.js
Returns:
Type
boolean

requestTransformationFunction()

Returns a promise that requests the transformation function that transforms between Mercator Spherical coordinates and the local projection of the image and the inverse.

Source:
mapspace-street/streetimage.js
Returns:

A promise that returns this image for the resolve function and null for the reject function. Any error happened is stored in transformError and inverseTransformError.

Type
Promise