IdentityCRSTransformer#
- class IdentityCRSTransformer[source]#
Bases:
CRSTransformer
Transformer for when map coordinates are already in pixel coordinates.
This is useful for non-georeferenced imagery.
Methods
__init__
([transform, image_crs, map_crs])map_to_pixel
(inp[, bbox])Transform input from map to pixel coords.
pixel_to_map
(inp[, bbox])Transform input from pixel to map coords.
- map_to_pixel(inp, bbox: rastervision.core.box.Box | None = None)#
Transform input from map to pixel coords.
- Parameters:
inp – (x, y) tuple or Box or shapely geometry in map coordinates. If tuple, x and y can be single values or array-like.
bbox (rastervision.core.box.Box | None) – If the extent of the associated RasterSource is constrained via a bbox, it can be passed here to get an output that is in coordinates of the bbox rather than the full extent of the data source of the RasterSource. Defaults to None.
- Returns:
Coordinate-transformed input in the same format.
- pixel_to_map(inp, bbox: rastervision.core.box.Box | None = None)#
Transform input from pixel to map coords.
- Parameters:
inp – (x, y) tuple or Box or shapely geometry in pixel coordinates. If tuple, x and y can be single values or array-like.
bbox (rastervision.core.box.Box | None) – If the extent of the associated RasterSource is constrained via a bbox, it can be passed here so that the input is interpreted to be in coordinates of the bbox rather than the full extent of the data source of the RasterSource. Defaults to None.
- Returns:
Coordinate-transformed input in the same format.