VAPOR3 3.9.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VAPoR::GeoTile Class Referenceabstract

#include <GeoTile.h>

Inheritance diagram for VAPoR::GeoTile:
VAPoR::GeoTileEquirectangular VAPoR::GeoTileMercator

Public Member Functions

 GeoTile (size_t tile_width, size_t tile_height, size_t pixelsize, double min_lon, double min_lat, double max_lon, double max_lat)
 
virtual ~GeoTile ()
 
int Insert (std::string quadkey, const unsigned char *image)
 
virtual void LatLongToPixelXY (double lon, double lat, int lod, size_t &pixelX, size_t &pixelY) const =0
 
virtual void PixelXYToLatLon (size_t pixelX, size_t pixelY, int lod, double &lon, double &lat) const =0
 
void PixelXYToTileXY (size_t pixelX, size_t pixelY, size_t &tileX, size_t &tileY, size_t &tilePixelX, size_t &tilePixelY) const
 
void TileXYToPixelXY (size_t tileX, size_t tileY, size_t &pixelX, size_t &pixelY) const
 
const unsigned char * GetTile (std::string quadkey) const
 
const unsigned char * GetTile (size_t tileX, size_t tileY, int lod) const
 
int GetMap (size_t pixelX0, size_t pixelY0, size_t pixelX1, size_t pixelY1, int lod, unsigned char *map_image) const
 
void MapSize (int lod, size_t &nx, size_t &ny) const
 
int MapSize (size_t pixelX0, size_t pixelY0, size_t pixelX1, size_t pixelY1, int lod, size_t &nx, size_t &ny) const
 
void GetLatLonExtents (double &minlon, double &minlat, double &maxlon, double &maxlat) const
 
void GetTileSize (size_t &w, size_t &h) const
 
void LatLongRectToPixelRect (const double geoSW[2], const double geoNE[2], int lod, size_t pixelSW[2], size_t pixelNE[2]) const
 

Static Public Member Functions

static std::string TileXYToQuadKey (size_t tileX, size_t tileY, int lod)
 
static int QuadKeyToTileXY (std::string quadKey, size_t &tileX, size_t &tileY, int &lod)
 

Protected Member Functions

double _Clip (double n, double minValue, double maxValue) const
 

Protected Attributes

size_t _tile_width
 
size_t _tile_height
 
double _MinLatitude
 
double _MaxLatitude
 
double _MinLongitude
 
double _MaxLongitude
 

Detailed Description

Definition at line 47 of file GeoTile.h.

Constructor & Destructor Documentation

◆ GeoTile()

VAPoR::GeoTile::GeoTile ( size_t  tile_width,
size_t  tile_height,
size_t  pixelsize,
double  min_lon,
double  min_lat,
double  max_lon,
double  max_lat 
)

Create a GeoTile object

Parameters
[in]tile_widthThe width of a tile in pixels
[in]tile_heightThe height of a tile in pixels
[in]pixelsizeThe size of a pixel in bytes
[in]min_lonThe minimum valid longitude for the map projection
[in]min_latThe minimum valid lattitude for the map projection
[in]max_lonThe maximum valid longitude for the map projection
[in]max_latThe maximum valid lattitude for the map projection

◆ ~GeoTile()

virtual VAPoR::GeoTile::~GeoTile ( )
virtual

Member Function Documentation

◆ _Clip()

double VAPoR::GeoTile::_Clip ( double  n,
double  minValue,
double  maxValue 
) const
protected

◆ GetLatLonExtents()

void VAPoR::GeoTile::GetLatLonExtents ( double &  minlon,
double &  minlat,
double &  maxlon,
double &  maxlat 
) const
inline

Definition at line 244 of file GeoTile.h.

◆ GetMap()

int VAPoR::GeoTile::GetMap ( size_t  pixelX0,
size_t  pixelY0,
size_t  pixelX1,
size_t  pixelY1,
int  lod,
unsigned char *  map_image 
) const

This method contructs a continuous (non-tiled) map from the tiles contained within the class.

Given a rectangular boundary described to two points (the north-west and south-east corner) in pixel coordinates, and a level of detail, this method constructs and returns a continuous map.

Parameters
[in]pixelX0X coordinate of north-west corner in pixel coordinates
[in]pixelY0Y coordinate of north-west corner in pixel coordinates
[in]pixelX0X coordinate of south-east corner in pixel coordinates
[in]pixelY0Y coordinate of south-east corner in pixel coordinates
[in]lodLevel of detail
[out]map_imageThe constructed map is copied to the location pointed to by map_image. The memory referenced by map_image must of sufficient size to accommodate the map.
Return values
statusA zero is returned on success. If the coordinates are invalid, or if all of the tiles needed are not present, a negative value is returned.
See also
MapSize(), Insert(), LatLongToPixelXY().

◆ GetTile() [1/2]

const unsigned char * VAPoR::GeoTile::GetTile ( size_t  tileX,
size_t  tileY,
int  lod 
) const
inline

Return a pointer to an image tile

This method returns a pointer to the image tile associated with a tile index and level of detail. If no image tile has been added to the class for combination of tile index and lod, a null pointer is returned.

Parameters
[in]tileXX coordinate of tile
[in]tileYX coordinate of tile
[in]lodlevel of detail of tile
Return values
tileIf the tile associated with tileX, tileY, and lod, a pointer to it is returned. If the tile does not exist (or if quadkey is not a valid key), the NULL pointer is returned
See also
Insert()

Definition at line 164 of file GeoTile.h.

◆ GetTile() [2/2]

const unsigned char * VAPoR::GeoTile::GetTile ( std::string  quadkey) const

Return a pointer to the image tile associated with a quadkey

This method returns a pointer to the image tile associated with the Quad Key quadkey. If no image tile has been added to the class for quadkey, a null pointer is returned.

Parameters
[in]quadkeyA Quad Key
Return values
tileIf the tile associated with quadkey exists, a pointer to it is returned. If the tile does not exist (or if quadkey is not a valid key), the NULL pointer is returned
See also
Insert()

◆ GetTileSize()

void VAPoR::GeoTile::GetTileSize ( size_t &  w,
size_t &  h 
) const
inline

Definition at line 252 of file GeoTile.h.

◆ Insert()

int VAPoR::GeoTile::Insert ( std::string  quadkey,
const unsigned char *  image 
)

Insert an image tile into the class object

This method is used to add geo-referenced image tiles to the class.

Parameters
[in]quadkeyA string encoding the location (index) and level of detail of image
[in]imageA pointer to the image tile to be copied into the object class. The size of the image tile must be tile_width * tile_height * pixelsize
See also
GeoTile()

◆ LatLongRectToPixelRect()

void VAPoR::GeoTile::LatLongRectToPixelRect ( const double  geoSW[2],
const double  geoNE[2],
int  lod,
size_t  pixelSW[2],
size_t  pixelNE[2] 
) const

Map a rectanular region described by lat-lon coordinates to pixel coordinates

Parameters
[in]geoSWA two-element array containing the longitude, and latitude coordinate, respectively, of the south-west corner of the region
[in]geoNEA two-element array containing the longitude, and latitude coordinate, respectively, of the north-east corner of the region
[in]lodThe level of detail
[out]pixelSWReturns a two-element array containing the X, and Y pixel coordinates, respectively, of the south-west corner of the region
[out]pixelNEReturns a two-element array containing the X, and Y pixel coordinates, respectively, of the north-east corner of the region

◆ LatLongToPixelXY()

virtual void VAPoR::GeoTile::LatLongToPixelXY ( double  lon,
double  lat,
int  lod,
size_t &  pixelX,
size_t &  pixelY 
) const
pure virtual

Converts a point from latitude/longitude WGS-84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail.

Parameters
[in]lonLongitude of the point, in degrees.
[in]latLatitude of the point, in degrees.
[in]lodLevel of detail, from 0 (lowest detail) to 23 (highest detail).
[out]pixelXOutput parameter receiving the X coordinate in pixels.
[out]pixelYOutput parameter receiving the Y coordinate in pixels.
See also
PixelXYToLatLong()

Implemented in VAPoR::GeoTileEquirectangular, and VAPoR::GeoTileMercator.

◆ MapSize() [1/2]

void VAPoR::GeoTile::MapSize ( int  lod,
size_t &  nx,
size_t &  ny 
) const

Compute the size of the global map in pixels at a specified lod

This method calculates the width and height, in pixels, of the global map at a specified level of detail

Parameters
[in]lodThe level of detail
[out]nxWidth of the map in pixels
[out]nyHeight of the map in pixels

◆ MapSize() [2/2]

int VAPoR::GeoTile::MapSize ( size_t  pixelX0,
size_t  pixelY0,
size_t  pixelX1,
size_t  pixelY1,
int  lod,
size_t &  nx,
size_t &  ny 
) const

Compute the size of a map in pixels at a specified lod and coordinates

Given a rectangular boundary described by two points (the north-west and south-east corner) in pixel coordinates, and a level of detail, this method computes the size of the map (width and height) in pixels.

Parameters
[in]pixelX0X coordinate of north-west corner in pixel coordinates
[in]pixelY0Y coordinate of north-west corner in pixel coordinates
[in]pixelX0X coordinate of south-east corner in pixel coordinates
[in]pixelY0Y coordinate of south-east corner in pixel coordinates
[in]lodThe level of detail
[out]nxWidth of the map in pixels
[out]nyHeight of the map in pixels

◆ PixelXYToLatLon()

virtual void VAPoR::GeoTile::PixelXYToLatLon ( size_t  pixelX,
size_t  pixelY,
int  lod,
double &  lon,
double &  lat 
) const
pure virtual

Converts a pixel from pixel XY coordinates at a specified level of detail into latitude/longitude WGS-84 coordinates (in degrees).

Parameters
[in]pixelXX coordinate of the point, in pixels.
[in]pixelYY coordinates of the point, in pixels.
[in]lodLevel of detail, from 0 (lowest detail) to 23 (highest detail).
[out]latOutput parameter receiving the latitude in degrees.
[out]lonOutput parameter receiving the longitude in degrees
See also
LatLongToPixelXY()

Implemented in VAPoR::GeoTileEquirectangular, and VAPoR::GeoTileMercator.

◆ PixelXYToTileXY()

void VAPoR::GeoTile::PixelXYToTileXY ( size_t  pixelX,
size_t  pixelY,
size_t &  tileX,
size_t &  tileY,
size_t &  tilePixelX,
size_t &  tilePixelY 
) const

Converts pixel XY coordinates into tile XY coordinates of the tile containing the specified pixel.

Given a map coordinate in pixels, this method returns the index of of the tile containing the pixel, as well as the pixel's location within the tile coordinate system.

Parameters
[in]pixelXPixel X coordinate.
[in]pixelYPixel Y coordinate.
[in]tileXOutput parameter receiving the tile's X coordinate.
[in]tileYOutput parameter receiving the tile's Y coordinate.
[in]tilePixelXOutput parameter receiving the pixel's X in the tile's local coordinate system.
[in]tilePixelYOutput parameter receiving the pixel's Y in the tile's local coordinate system.

◆ QuadKeyToTileXY()

static int VAPoR::GeoTile::QuadKeyToTileXY ( std::string  quadKey,
size_t &  tileX,
size_t &  tileY,
int &  lod 
)
static

Converts a QuadKey into tile XY coordinates.

Parameters
[in]quadKeyQuadKey of the tile.
[out]tileXOutput parameter receiving the tile X coordinate.
[out]tileYOutput parameter receiving the tile Y coordinate.
[out]lodOutput parameter receiving the level of detail.
Return values
statusA zero is returned on success, otherwise a negative value is returned if the supplied inputs are invalid

◆ TileXYToPixelXY()

void VAPoR::GeoTile::TileXYToPixelXY ( size_t  tileX,
size_t  tileY,
size_t &  pixelX,
size_t &  pixelY 
) const

Converts tile XY coordinates into pixel XY coordinates of the upper-left pixel of the specified tile.

Parameters
[in]tileXTile X coordinate.
[in]tileYTile Y coordinate.
[out]pixelXOutput parameter receiving the pixel X coordinate.
[out]pixelYOutput parameter receiving the pixel Y coordinate.

◆ TileXYToQuadKey()

static std::string VAPoR::GeoTile::TileXYToQuadKey ( size_t  tileX,
size_t  tileY,
int  lod 
)
static

Converts tile XY coordinates into a QuadKey at a specified level of detail.

Parameters
[in]tileXTile X coordinate.
[in]tileYTile Y coordinate.
[in]lodLevel of detail, from 0 (lowest detail) to 23 (highest detail).
Return values
quadkeyA string containing the QuadKey.

Member Data Documentation

◆ _MaxLatitude

double VAPoR::GeoTile::_MaxLatitude
protected

Definition at line 285 of file GeoTile.h.

◆ _MaxLongitude

double VAPoR::GeoTile::_MaxLongitude
protected

Definition at line 287 of file GeoTile.h.

◆ _MinLatitude

double VAPoR::GeoTile::_MinLatitude
protected

Definition at line 284 of file GeoTile.h.

◆ _MinLongitude

double VAPoR::GeoTile::_MinLongitude
protected

Definition at line 286 of file GeoTile.h.

◆ _tile_height

size_t VAPoR::GeoTile::_tile_height
protected

Definition at line 282 of file GeoTile.h.

◆ _tile_width

size_t VAPoR::GeoTile::_tile_width
protected

Definition at line 281 of file GeoTile.h.


The documentation for this class was generated from the following file: