new Image(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
bu.oblique.ImageOptions | Oblique image options. Take care that this options are not optional and must be present. |
- Source:
- bu-oblique/obliqueimage.js
Fires:
Extends
- ol.Object
Methods
-
computeShotDate()
-
Computes the shot date in the format YYYY-MM-dd.
- Source:
- bu-oblique/obliqueimage.js
-
fromLocalCoordToPixelCoord(coordinates)
-
Transforms coordinates from a local spherical mercator XY coordinate to pixel XY coordinates inside an oblique image. The oblique viewer uses internally a fake spherical mercator projection in which oblique images are rendered as if they where full earth images. This function translates that fake coordinates to pixel coordinates. Pixel coordinates have origin at left top corner. X increases to the right and Y increases to the bottom. Both always positive values. Local coordinates are as spherical mercator. Origin is at the center of the image and axis are cartesian.
Parameters:
Name Type Description coordinates
bu.Coordinate | Array.<bu.Coordinate> Coordinates as XY in Spherical Mercator.
- Source:
- bu-oblique/obliqueimage.js
Returns:
Coordinates transformed as x, y in pixels.
- Type
- bu.Coordinate | Array.<bu.Coordinate>
-
fromLocalResolution(localResolution)
-
Converts from local fake resolution to real one.
Parameters:
Name Type Description localResolution
number The local resolution in meters per pixel.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The real resolution.
- Type
- number
-
fromPixelCoordToLocalCoord(coordinates)
-
Transforms coordinates from pixel XY coordinate inside an oblique image to a local spherical mercator XY coordinates. The oblique viewer uses internally a fake spherical mercator projection in which oblique images are rendered as if they where full earth images. This function translates pixel coordinates to that fake coordinates. Pixel coordinates have origin at left top corner. X increases to the right and Y increases to the bottom. Both always positive values. Local coordinates are as spherical mercator. Origin is at the center of the image and axis are cartesian.
Parameters:
Name Type Description coordinates
bu.Coordinate | Array.<bu.Coordinate> Coordinates as XY in image pixels.
- Source:
- bu-oblique/obliqueimage.js
Returns:
Coordinates transformed as x, y in Spherical Mercator.
- Type
- bu.Coordinate | Array.<bu.Coordinate>
-
fromPixelCoordToWorldCoord(coordinates, dtm, local)
-
Transform XY pixel coordinates to world coordinates in lon-lat 'EPSG:4326' projection. Pixel coordinates XY are the coordinates used internally in oblique imagery. Pixel coordinates have origin at left top corner. X increases to the right and Y increases to the bottom. Both always positive values.
Parameters:
Name Type Description coordinates
bu.Coordinate | Array.<bu.Coordinate> Coordinates in pixels.
dtm
boolean Indicates if service must use dtm in the transformation.
local
boolean Boolean param to indicate if transformation must be done locally.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The transformed coordinates as longitude and latitude or a Promise that returns transformed coordinates.
- Type
- bu.Coordinate | Array.<bu.Coordinate> | Promise
-
fromRealResolution(realResolution)
-
Converts from real resolution to local fake one.
Parameters:
Name Type Description realResolution
number The real resolution in meters per pixel.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The local fake resolution.
- Type
- number
-
fromRealZoomLevel(zoom)
-
Converts from real zoom level to local fake resolution.
Parameters:
Name Type Description zoom
number The real zoom level. Notice that numbers do not need to be integers.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The local fake resolution.
- Type
- number
-
fromWorldCoordToPixelCoord(coordinates, dtm, local)
-
Transform world coordinates in lon-lat 'EPSG:4326' projection to XY pixel coordinates. Pixel coordinates XY are the coordinates used internally in oblique imagery. Pixel coordinates have origin at left top corner. X increases to the right and Y increases to the bottom. Both always positive values.
Parameters:
Name Type Description coordinates
bu.Coordinate | Array.<bu.Coordinates> Coordinates as longitude and latitude.
dtm
boolean Indicates if service must use dtm in the transformation.
local
boolean Boolean param to indicate if transformation must be done locally.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The transformed coordinates in pixels or a Promise that returns XY transformed coordinates.
- Type
- bu.Coordinate | Array.<bu.Coordinate> | Promise
-
fromWorldCoordToPixelCoordUsingGrid(coordinates)
-
Transform world coordinates in lon-lat 'EPSG:4326' projection to XY pixel coordinates using a transformation grid through a bilinear interpolation.
Input coordinates must be enforced to be inside the extent.
Parameters:
Name Type Description coordinates
bu.Coordinate | Array.<bu.Coordinate> Coordinates as longitude and latitude.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The transformed coordinates in pixels.
- Type
- bu.Coordinate
-
fromWorldSourceToLocalSource(source, opt_source)
-
Returns a new
bu.source.Vector
with the geometries transformed from world coordinates in 'EPSG:4326' lonlat to local spherical mercator XY coordinates. The oblique viewer uses internally a fake spherical mercator projection in which oblique images are rendered as if they where full earth images. This function translates pixel coordinates to that fake coordinates.All features are cloned and input features are not changed.
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-oblique/obliqueimage.js
Returns:
The output source.
- Type
- bu.source.Vector | ol.source.Vector
-
getBestResolution(resolution)
-
Returns the best resolution for a given resolution value. The resolution is ensured to be inside the resolutions of this image. The returned result is a pair of values, the first is the real resolution in meters per pixel. The second is the fake resolution for the internal oblique viewer.
Parameters:
Name Type Description resolution
number The resolution in meters per pixel.
- Source:
- bu-oblique/obliqueimage.js
Returns:
[realRes, fakeRes].
- Type
- Array.<number>
-
getExtent()
-
Returns the extent of the oblique image in 'EPSG:4326' lonlat.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- bu.Extent
-
getExtraZoomLevels()
-
Returns the number of extra zoom levels of the oblique image or zoom levels to add to default zoom levels. In the new zoom levels the tiles will be rescaled.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- number
-
getGrid()
-
Returns the grid to do interpolations as it is returned in the resolve function by
bu.promises.oblique#getTransformationGrid
. To load a grid first check if isLoadingGrid is false, then create a listener for the GRIDLOADED event, then call loadGrid, and then check in the listener if getGridError was null or not.- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- Array.<Array.<bu.Coordinate>> | null
-
getGridError()
-
Returns the error requesting grid to do interpolations as it is returned in the reject function by
bu.promises.oblique#getTransformationGrid
. To load a grid first check if isLoadingGrid is false, then create a listener for the GRIDLOADED event, then call loadGrid, and then check in the listener if getGridError was null or not.- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- Error | null
-
getHeight()
-
Returns the height in pixels of this image.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- number
-
getMetadata()
-
Returns the metadata of the oblique image.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- bu.ObliqueMetadata
-
getObliqueResolutions()
-
Returns an array with pair of resolutions in meters per pixel for each zoom level inside the oblique in descending value order. The first resolution in each pair is the real mean resolution for the oblique. The second resolution in each pair is the fake resolution that the ol.Map object uses to draw the oblique.
- Source:
- bu-oblique/obliqueimage.js
Returns:
An array of pairs of numbers. [[realRes0, fakeRes0], ..., [realResN, fakeResN]]
- Type
- Array.<Array.<number>>
-
getResolutions()
-
Returns the resolutions of the oblique image. An array with pair of resolutions in meters per pixel for each zoom level inside the oblique in descending value order. The first resolution in each pair is the real mean resolution for the oblique. The second resolution in each pair is the fake resolution that the ol.Map object uses to draw the oblique. [[realRes0, fakeRes0], ..., [realResN, fakeResN]]
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- Array.<Array.<number>>
-
getShotDate()
-
Returns the shot date in the format YYYY-MM-dd.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- string
-
getWidth()
-
Returns the width in pixels of this image.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- number
-
getZoomLevel(localRes)
-
Returns the zoom level of a given fake resolution.
Parameters:
Name Type Description localRes
number The local resolution in meters per pixel.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The zoom level or null if wasn't found.
- Type
- number
-
isLoadingGrid()
-
Returns if the image is loading a grid or not.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- boolean
-
isPixelInside(pixel)
-
Returns true if the pixel coordinates are inside the valid portion of the oblique image. We are in the valid portion when we are inside a buffer of apercentage of the border defined in bu.OBLIQUE_BORDER_RATIO constant.
Parameters:
Name Type Description pixel
bu.Coordinate Pixel coordinates XY. Coordinates here can be negative values. If that happens then the function returns false. X values inside a oblique are always positive, X increasing rightward and Y downward from origin that is at top-left corner.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- boolean
-
isPointInsideExtent(point)
-
Returns true if the point coordinates are inside the extent of the oblique image. The extent is the minimum rectangle bounding the oblique image. This function do not ensure the point is inside the oblique.
Parameters:
Name Type Description point
bu.Coordinate World lonlat coordinates.
- Source:
- bu-oblique/obliqueimage.js
Returns:
- Type
- boolean
-
loadGrid()
-
Requests a transformation grid for this image and loads it. When the new grid is lodaded the image notifies it with a GRIDLOADED event.
- Source:
- bu-oblique/obliqueimage.js
-
toRealZoomLevel(localResolution)
-
Converts from local fake resolution to real zoom level.
Parameters:
Name Type Description localResolution
number The local resolution in meters per pixel.
- Source:
- bu-oblique/obliqueimage.js
Returns:
The real zoom level. Notice that numbers do not need to be integers.
- Type
- number