Raster

Description

[ShutdownSurvive]
sealed class Tinman.Terrain.Georef.Raster

Derived from

GeoObject abstract

Defines a mapping from raster space to map space.

The definition of raster coordinates is taken from the aggregated IRasterTransform object (see Transform). The definition of map coordinates is taken from the aggregated CoordinateSystem object (see Coordinates). A Raster object needs to be combined with a MapInfo value, in order to create a full geo-reference, usually by implementing the IGeorefInfo interface.

Use the Projection method to obtain a factory for creating IMapProjection object, which can be used to transform coordinates between geo-references.

Public / Constants

Geographic​Cube


public static readonly attribute GeographicCube → (Raster)

A cubemap raster using the CoordinateSystem.WGS84 coordinate system with a cubemap edge length of MappingUtil.MaxSize.

Geographic​Moon


public static readonly attribute GeographicMoon → (Raster)

A cubemap raster using the CoordinateSystem.Moon coordinate system with a cubemap edge length of MappingUtil.MaxSize.

Geographic​Rect


public static readonly attribute GeographicRect → (Raster)

A rectangular raster using the CoordinateSystem.WGS84 coordinate system with a raster width of MappingUtil.MaxSize and a raster height that is half of the width, which maps geographic coordinates similarly to MapProjectionFactory.PlateCaree.

Popular​Mercator


public static readonly attribute PopularMercator → (Raster)

A rectangular raster using the CoordinateSystem.PopularMercator coordinate system with an edge length of MappingUtil.MaxSize.

Public / Constructors

Adjust​Map


public static method AdjustMap → (2)

raster in : Raster

The raster to adjust according to map in or null.

map in : MapInfo

The map raster specification to use for adjusting raster in.

returns → Raster

The resulting raster or null if raster in is null or if RasterType and MapInfo.Type of map in are different.

Adjusts the given raster for the specified map.

If the given map in is a cubemap (see MapType.Cube), the raster transform (see Transform) of the given raster in will be resized to the cubemap size (see MapInfo.Size) of map in, using IRasterTransform.RasterSize.

Local


public static method Local → (3)

center in : Vec2D

Raster coordinates that will be mapped to the map coordinates (0,0).

scale in : float64

Scale factor from raster coordinates to map coordinates.

unit opt : UnitOfMeasure = null

The map coordinate unit. If null, UnitOfMeasure.Metre will be used.

returns → Raster

The resulting raster.

Creates a new instance of Raster for a local coordinate system.

Raster


public constructor Raster → (3)

coordinates in : CoordinateSystem

The coordinate system for map space. If null, CoordinateSystem.WGS84 will be used.

transform opt : IRasterTransform = null

The transform that maps raster coordinates (rectangular or cubemap, see IRasterTransform.Size) to projected map coordinates (see CoordinateSystem.IsProjection), to geographic coordinates (see CoordinateSystem.IsGeographic) or to local coordinates (see CoordinateSystem.IsLocal). If null, RasterTransform.Cube will be used (with default arguments).

name opt : string = null

Human-readable name of the raster. If empty or null, GeoObject.UserDefined will be used instead.

Creates a new instance of Raster.

If the given raster transform opt uses a cubemap (see IRasterTransform.Size), the given coordinate system will be converted to a geographic one via CoordinateSystem.ToGeographic. If the given coordinate system is local (see CoordinateSystem.IsLocal), it will be ignored and CoordinateSystem.WGS84 will be used instead. This ensures that the resulting raster specification is always consistent.

Public / Methods

Adjust​Cube


public method AdjustCube → ()

returns → Raster

The resulting raster. Will be this iff RasterType returns MapType.Cube.

Converts this raster to a geographic cubemap raster.

This method uses CoordinateSystem.ToGeographic to obtain the geographic coordinate system and RasterTransform.Cube to obtain the raster transform.

Adjust​Face


public method AdjustFace → (1)

face in : CubemapFace

The cubemap face.

returns → Raster

The resulting raster, which may be this.

Converts this cubemap raster to a rectangular raster.

This method uses to IRasterTransform.RasterFace to convert Transform and then returns an updated Raster.

Adjust​Offset


public method AdjustOffset → (2)

offsetX in : float64

The offset along the raster X-axis.

offsetY in : float64

The offset along the raster Y-axis.

returns → Raster

The resulting raster, which may be this.

Offsets the rectangular raster transform by the given amounts.

This method uses to IRasterTransform.RasterOffset to offset Transform and then returns an updated Raster.

Adjust​Scale

2 overloads


public method AdjustScale1 → (1)

scale in : float64

The scale factor along the raster X- and Y-axes.

returns → Raster

The resulting raster, which may be this.

Scales the rectangular raster transform by the given factor.

This method uses to IRasterTransform.RasterScale to scale Transform and then returns an updated Raster.


public method AdjustScale2 → (2)

scaleX in : float64

The scale factor along the raster X-axis.

scaleY in : float64

The scale factor along the raster Y-axis.

returns → Raster

The resulting raster, which may be this.

Scales the rectangular raster transform by the given factors.

This method uses to IRasterTransform.RasterScale to scale Transform and then returns an updated Raster.

Adjust​Size


public method AdjustSize → (1)

size opt : int32 = MappingUtil.MaxSize

[pow2]
The desired cubemap raster size.

returns → Raster

The resulting raster, which may be this.

Resizes the cubemap raster transform to the given size opt.

This method uses to IRasterTransform.RasterSize to resize the cubemap of Transform and then returns an updated Raster.

Adjust​Vertical


public method AdjustVertical → (2)

unit opt : UnitOfMeasure = null

The vertical unit. If null, UnitOfMeasure.Metre will be used.

datum opt : VerticalDatum = null

The vertical datum (see CoordinateSystem.Vertical).

returns → Raster

The resulting raster.

Updates the vertical components of this raster.

Create​Ground​Sample​Distance


public method CreateGroundSampleDistance → ()

returns → GroundSampleDistance

The CreateGroundSampleDistance helper object.

Computes the ground sample distance of this raster.

Depending on the coordinate system type, the ground sample distance is computed as follows:

If the geo-reference parameters are incomplete or invalid, Vec4D.Undefined is returned.

Projection


public method Projection → (2)

target opt : Raster = null

The target raster.

transform opt : IDatumTransform = null

Datum transform to use.

returns → IMapProjectionFactory

The map projection factory.

Returns a factory for map projections that transform raster coordinates from this raster (source) to the given one (target).

When no target raster is specified (i.e. the target opt parameter is null), the map projection will transform raster coordinates to 3D geographic coordinates (latitude, longitude, ellipsoid height), based on the geodetic datum of this coordinate system (see Coordinates). If a datum transform is given (i.e. the transform opt parameter is not null), it will be applied to the 3D geographic coordinates. The method assumes that the calling code has chosen a datum transform that is consistent with this coordinate system.

If a target raster is given (i.e the target opt parameter is not null, the map projection will transform source raster coordinates to target raster coordinates. If the source and target raster use different datums (geodetic and/or vertical), one or more additional datum transforms may be necessary. When the transform opt parameter is null, the method tries to find a suitable composite datum transform in the current geo registry (see GeoRegistry). If no transform is found, the method silently assumes that no datum transformation is necessary. This behaviour can be overridden by providing a non-null value to the transform opt parameter, which will then be used instead (skipping the lookup).

The map types (i.e. MapType.Rect and MapType.Cube) of the source and target rasters are derived from the RasterType property value.

GeorefException

If the geo-reference parameters are incomplete or invalid.

Whole​Equator


[Pure]
public method WholeEquator → (2)

width in : int32

[>0]
The raster width of the map (edge length, not sample count).

height in : int32

[>0]
The raster height of the map (edge length, not sample count).

returns → bool

true if the raster covers the entire equator, false if not.

Does this raster span the entire equator?

Public / Attributes

Coordinates


public attribute Coordinates → (get)

value : CoordinateSystem

[not-null]
The coordinate system.

The coordinate system of map space.

If Transform is a cubemap raster transform (see RasterType), Coordinates will always be geographic (see CoordinateSystem.IsGeographic).

Face​Bounds


public attribute FaceBounds → (get)

value : Box2D

The map bounds.

Returns the map bounds of CoordinateOperationMethod.Face for this raster.

Raster​Type


public attribute RasterType → (get)

value : MapType

The MapType value.

Returns the MapType value of this raster, according to IRasterTransform.Size of Transform.

Transform


public attribute Transform → (get)

value : IRasterTransform

[not-null]
The raster transform.

The transform that maps raster coordinates (rectangular or cubemap, see IRasterTransform.Size) to projected map coordinates (see CoordinateSystem.IsProjection), to geographic coordinates (see CoordinateSystem.IsGeographic) or to local coordinates (see CoordinateSystem.IsLocal).

If Transform is a cubemap raster transform (see IRasterTransform.Size), Coordinates will always be geographic (see CoordinateSystem.IsGeographic).

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<Raster>

[not-null]
The configurator object.

The configurator object for this type.

Serialization

Serial​Id


public static readonly attribute SerialId → (ISerialTypeInfo)

Serialization information about this type.