C# Class Mapstache.TileSystemHelper

Mostrar archivo Open project: awcoats/mapstache Class Usage Examples

Public Methods

Method Description
GroundResolution ( double latitude, int levelOfDetail ) : double

Determines the ground resolution (in meters per pixel) at a specified latitude and level of detail.

LatLongToPixelXY ( PointF lonlat, int levelOfDetail ) : Point
LatLongToPixelXY ( double latitude, double longitude, int levelOfDetail, int &pixelX, int &pixelY ) : void

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

MapScale ( double latitude, int levelOfDetail, int screenDpi ) : double

Determines the map scale at a specified latitude, level of detail, and screen resolution.

MapSize ( int levelOfDetail ) : uint

Determines the map width and height (in pixels) at a specified level of detail.

PixelXYToLatLong ( Point pixel, int levelOfDetail ) : PointF
PixelXYToLatLong ( int pixelX, int pixelY, int levelOfDetail, double &latitude, double &longitude ) : void

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

QuadKeyToTileXY ( string quadKey, int &tileX, int &tileY, int &levelOfDetail ) : void

Converts a QuadKey into tile XY coordinates.

QuadKeyToTmsTileXY ( string quadKey, int &tileX, int &tileY, int &levelOfDetail ) : void
TileBounds ( int tileX, int tileY, int levelOfDetail ) : Rectangle
TileXYToPixelXY ( Point tile ) : Point
TileXYToPixelXY ( int tileX, int tileY, int &pixelX, int &pixelY ) : void

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

TileXYToQuadKey ( int tileX, int tileY, int levelOfDetail ) : string

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

Private Methods

Method Description
Clip ( double n, double minValue, double maxValue ) : double

Clips a number to the specified minimum and maximum values.

Method Details

GroundResolution() public static method

Determines the ground resolution (in meters per pixel) at a specified latitude and level of detail.
public static GroundResolution ( double latitude, int levelOfDetail ) : double
latitude double Latitude (in degrees) at which to measure the /// ground resolution.
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
return double

LatLongToPixelXY() public static method

public static LatLongToPixelXY ( PointF lonlat, int levelOfDetail ) : Point
lonlat System.Drawing.PointF
levelOfDetail int
return Point

LatLongToPixelXY() public static method

Converts a point from latitude/longitude WGS-84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail.
public static LatLongToPixelXY ( double latitude, double longitude, int levelOfDetail, int &pixelX, int &pixelY ) : void
latitude double Latitude of the point, in degrees.
longitude double Longitude of the point, in degrees.
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
pixelX int Output parameter receiving the X coordinate in pixels.
pixelY int Output parameter receiving the Y coordinate in pixels.
return void

MapScale() public static method

Determines the map scale at a specified latitude, level of detail, and screen resolution.
public static MapScale ( double latitude, int levelOfDetail, int screenDpi ) : double
latitude double Latitude (in degrees) at which to measure the /// map scale.
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
screenDpi int Resolution of the screen, in dots per inch.
return double

MapSize() public static method

Determines the map width and height (in pixels) at a specified level of detail.
public static MapSize ( int levelOfDetail ) : uint
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
return uint

PixelXYToLatLong() public static method

public static PixelXYToLatLong ( Point pixel, int levelOfDetail ) : PointF
pixel Point
levelOfDetail int
return System.Drawing.PointF

PixelXYToLatLong() public static method

Converts a pixel from pixel XY coordinates at a specified level of detail into latitude/longitude WGS-84 coordinates (in degrees).
public static PixelXYToLatLong ( int pixelX, int pixelY, int levelOfDetail, double &latitude, double &longitude ) : void
pixelX int X coordinate of the point, in pixels.
pixelY int Y coordinates of the point, in pixels.
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
latitude double Output parameter receiving the latitude in degrees.
longitude double Output parameter receiving the longitude in degrees.
return void

QuadKeyToTileXY() public static method

Converts a QuadKey into tile XY coordinates.
public static QuadKeyToTileXY ( string quadKey, int &tileX, int &tileY, int &levelOfDetail ) : void
quadKey string QuadKey of the tile.
tileX int Output parameter receiving the tile X coordinate.
tileY int Output parameter receiving the tile Y coordinate.
levelOfDetail int Output parameter receiving the level of detail.
return void

QuadKeyToTmsTileXY() public static method

public static QuadKeyToTmsTileXY ( string quadKey, int &tileX, int &tileY, int &levelOfDetail ) : void
quadKey string
tileX int
tileY int
levelOfDetail int
return void

TileBounds() public static method

public static TileBounds ( int tileX, int tileY, int levelOfDetail ) : Rectangle
tileX int
tileY int
levelOfDetail int
return System.Drawing.Rectangle

TileXYToPixelXY() public static method

public static TileXYToPixelXY ( Point tile ) : Point
tile Point
return Point

TileXYToPixelXY() public static method

Converts tile XY coordinates into pixel XY coordinates of the upper-left pixel of the specified tile.
public static TileXYToPixelXY ( int tileX, int tileY, int &pixelX, int &pixelY ) : void
tileX int Tile X coordinate.
tileY int Tile Y coordinate.
pixelX int Output parameter receiving the pixel X coordinate.
pixelY int Output parameter receiving the pixel Y coordinate.
return void

TileXYToQuadKey() public static method

Converts tile XY coordinates into a QuadKey at a specified level of detail.
public static TileXYToQuadKey ( int tileX, int tileY, int levelOfDetail ) : string
tileX int Tile X coordinate.
tileY int Tile Y coordinate.
levelOfDetail int Level of detail, from 1 (lowest detail) /// to 23 (highest detail).
return string