Table of Contents

Class MapUtil

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll
public static class MapUtil
Inheritance
MapUtil
Inherited Members

Fields

InchesPerDecimalDegree

public const double InchesPerDecimalDegree = 4374754

Field Value

double

InchesPerFeet

public const double InchesPerFeet = 12

Field Value

double

InchesPerMeter

public const double InchesPerMeter = 39.3701

Field Value

double

InchesPerMile

public const double InchesPerMile = 63360

Field Value

double

InchesPerNauticalMile

public const double InchesPerNauticalMile = 72913.4252

Field Value

double

InchesPerYard

public const double InchesPerYard = 36

Field Value

double

PointsPerInch

public const float PointsPerInch = 72

Field Value

float

StandardDpi

public const float StandardDpi = 96

Field Value

float

Methods

AdjustExtentByRestrictions(RectangleShape, double, double, RectangleShape, double, double, GeographyUnit)

public static RectangleShape AdjustExtentByRestrictions(RectangleShape targetExtent, double width, double height, RectangleShape restrictExtent, double maximumScale, double minimumScale, GeographyUnit mapUnit)

Parameters

targetExtent RectangleShape
width double
height double
restrictExtent RectangleShape
maximumScale double
minimumScale double
mapUnit GeographyUnit

Returns

RectangleShape

ApplyDrawingMarginToExtent(RectangleShape, float, float, float)

public static RectangleShape ApplyDrawingMarginToExtent(RectangleShape worldExtent, float marginInPixel, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape
marginInPixel float
screenWidth float
screenHeight float

Returns

RectangleShape

BuildFourColorColumn(string, Collection<Feature>)

This method returns all features in the FeatureSource, the features contain the "Color" column. The column has a range of 1, 2, 3, 4, and each value represents a color.

public static Collection<Feature> BuildFourColorColumn(string columnName, Collection<Feature> features)

Parameters

columnName string
features Collection<Feature>

Returns

Collection<Feature>

This method returns four color features in the FeatureSource.

CalculateExtent(PointShape, double, GeographyUnit, double, double)

public static RectangleShape CalculateExtent(PointShape worldCenter, double scale, GeographyUnit mapUnit, double mapWidth, double mapHeight)

Parameters

worldCenter PointShape
scale double
mapUnit GeographyUnit
mapWidth double
mapHeight double

Returns

RectangleShape

CenterAt(RectangleShape, float, float, float, float)

This method returns an adjusted extent centered on a point.

public static RectangleShape CenterAt(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the current extent you want to center.

screenX float

This parameter is the X coordinate on the screen to center on.

screenY float

This parameter is the Y coordinate on the screen to center on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an adjusted extent centered on a point.

Remarks

None

CenterAt(RectangleShape, Feature, float, float)

This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.

public static RectangleShape CenterAt(RectangleShape worldExtent, Feature centerFeature, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the current extent you want to center.

centerFeature Feature

This parameter is the world point you want to center on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an adjusted extent centered on a point.

Remarks

None

CenterAt(RectangleShape, PointShape, float, float)

This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.

public static RectangleShape CenterAt(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the current extent you want to center.

worldPoint PointShape

This parameter is the world point you want to center on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an adjusted extent centered on a point.

Remarks

None

GetAreaUnitFromDistanceUnit(DistanceUnit)

public static AreaUnit GetAreaUnitFromDistanceUnit(DistanceUnit distanceUnit)

Parameters

distanceUnit DistanceUnit

Returns

AreaUnit

GetBoundingBoxOfItems(IEnumerable<BaseShape>)

This API gets the BoundingBox of a group of BaseShapes.

public static RectangleShape GetBoundingBoxOfItems(IEnumerable<BaseShape> shapes)

Parameters

shapes IEnumerable<BaseShape>

The target group of BaseShapes to get the BoundingBox for.

Returns

RectangleShape

The BoundingBox that contains all of the shapes you passed in.

GetBoundingBoxOfItems(IEnumerable<Feature>)

This API gets the BoundingBox of a group of Features.

public static RectangleShape GetBoundingBoxOfItems(IEnumerable<Feature> features)

Parameters

features IEnumerable<Feature>

The target group of Features to get the BoundingBox for.

Returns

RectangleShape

The BoundingBox that contains all the features you passed in.

GetClosestZoomLevelIndex(double, Collection<double>)

public static int GetClosestZoomLevelIndex(double scale, Collection<double> zoomLevelScales)

Parameters

scale double
zoomLevelScales Collection<double>

Returns

int

GetClosestZoomLevelIndex(double, ZoomLevelSet)

public static int GetClosestZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

int

GetDegreeFromPanDirection(PanDirection)

public static double GetDegreeFromPanDirection(PanDirection panDirection)

Parameters

panDirection PanDirection

Returns

double

GetDistance(PointShape, PointShape)

public static double GetDistance(PointShape fromPoint, PointShape toPoint)

Parameters

fromPoint PointShape
toPoint PointShape

Returns

double

GetDrawingExtent(RectangleShape, double, double)

This method returns an adjusted extent based on the ratio of the screen width and height.

public static RectangleShape GetDrawingExtent(RectangleShape worldExtent, double screenWidth, double screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to adjust for drawing.

screenWidth double

This parameter is the width of the screen.

screenHeight double

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an adjusted extent based on the ratio of the screen width and height.

Remarks

This function is used because the extent to draw must be the rame ratio as the screen width and height. If they are not, then the image drawn will be stretched or compressed. We always adjust the extent upwards to ensure that no matter how we adjust it, the original extent will fit within the new extent. This ensures that everything you wanted to see in the first extent is visible and maybe a bit more.

GetExtentFromCenterPoint(PointShape, double, double, double, GeographyUnit)

public static RectangleShape GetExtentFromCenterPoint(PointShape centerPoint, double canvasWidth, double canvasHeight, double scale, GeographyUnit mapUnit)

Parameters

centerPoint PointShape
canvasWidth double
canvasHeight double
scale double
mapUnit GeographyUnit

Returns

RectangleShape

GetFloorCeilingScales(double, ZoomLevelSet)

public static (double, double) GetFloorCeilingScales(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

(double, double)

GetFloorCeilingZoomLevelIndex(double, Collection<double>)

public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, Collection<double> zoomLevelScales)

Parameters

scale double
zoomLevelScales Collection<double>

Returns

(int, int)

GetFloorCeilingZoomLevelIndex(double, ZoomLevelSet)

public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

(int, int)

GetFloorZoomLevelIndex(double, Collection<double>)

Get the floor zoomlevel index based on the current scale. For example if the current scale is around zoomlevel 3.9, this method returns 3 instead of 4. We need this feature in some cases for example when we want to get a zoomlevel to totally contains a given extent, we don't want it just snap to the closest one. To get the closest zoomlevelIndex, use GetSnappedZoomLevelIndex.

public static int GetFloorZoomLevelIndex(double scale, Collection<double> zoomLevelScales)

Parameters

scale double
zoomLevelScales Collection<double>

Returns

int

The floor zoomlevel index

GetFloorZoomLevelIndex(double, ZoomLevelSet)

Get the floor zoomlevel index based on the current scale. For example if the current scale is around zoomlevel 3.9, this method returns 3 instead of 4. We need this feature in some cases for example when we want to get a zoomlevel to totally contains a given extent, we don't want it just snap to the closest one. To get the closest zoomlevelIndex, use GetSnappedZoomLevelIndex.

public static int GetFloorZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

int

The floor zoomlevel index

GetInchesPerDistanceUnit(DistanceUnit)

public static double GetInchesPerDistanceUnit(DistanceUnit targetUnit)

Parameters

targetUnit DistanceUnit

Returns

double

GetInchesPerGeographyUnit(GeographyUnit)

public static double GetInchesPerGeographyUnit(GeographyUnit targetUnit)

Parameters

targetUnit GeographyUnit

Returns

double

GetResolution(RectangleShape, double, double)

public static double GetResolution(RectangleShape boundingBox, double widthInPixel, double heightInPixel)

Parameters

boundingBox RectangleShape
widthInPixel double
heightInPixel double

Returns

double

GetResolutionFromScale(double, GeographyUnit, float)

public static double GetResolutionFromScale(double scale, GeographyUnit unit, float dpi = 96)

Parameters

scale double
unit GeographyUnit
dpi float

Returns

double

GetResolutionOfRotatedExtent(RectangleShape, double, double, double)

Get the resolution if displaying a rotated extent within a canvas

public static double GetResolutionOfRotatedExtent(RectangleShape extent, double rotationAngle, double canvasWidth, double canvasHeight)

Parameters

extent RectangleShape

the extent to display on the canvas

rotationAngle double

the rotation angle of the extent

canvasWidth double

canvas width in pixel

canvasHeight double

canvas height in pixel

Returns

double

GetRotatedCanvasRadius(double, double, double, double)

public static double GetRotatedCanvasRadius(double pivotX, double pivotY, double canvasWidth, double canvasHeight)

Parameters

pivotX double
pivotY double
canvasWidth double
canvasHeight double

Returns

double

GetRotatedExtent(RectangleShape, double, PointShape)

public static RectangleShape GetRotatedExtent(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)

Parameters

extent RectangleShape
rotatedAngle double
pivotPoint PointShape

Returns

RectangleShape

GetRotatedPoint(double, double, double, PointShape)

public static PointShape GetRotatedPoint(double x, double y, double rotatedAngle, PointShape pivotPoint)

Parameters

x double
y double
rotatedAngle double
pivotPoint PointShape

Returns

PointShape

GetRotatedPolygon(RectangleShape, double, PointShape)

public static AreaBaseShape GetRotatedPolygon(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)

Parameters

extent RectangleShape
rotatedAngle double
pivotPoint PointShape

Returns

AreaBaseShape

GetRotatedScreenPoint(double, double, double, ScreenPointD)

public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointD pivotPoint)

Parameters

x double
y double
rotatedAngle double
pivotPoint ScreenPointD

Returns

ScreenPointF

GetRotatedScreenPoint(double, double, double, ScreenPointF)

public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointF pivotPoint)

Parameters

x double
y double
rotatedAngle double
pivotPoint ScreenPointF

Returns

ScreenPointF

GetScale(GeographyUnit, RectangleShape, double, double, float)

public static double GetScale(GeographyUnit mapUnit, RectangleShape boundingBox, double widthInPixel, double heightInPixel, float dpi = 96)

Parameters

mapUnit GeographyUnit
boundingBox RectangleShape
widthInPixel double
heightInPixel double
dpi float

Returns

double

GetScale(RectangleShape, double, GeographyUnit, float)

public static double GetScale(RectangleShape worldExtent, double screenWidth, GeographyUnit worldExtentUnit, float dpi = 96)

Parameters

worldExtent RectangleShape
screenWidth double
worldExtentUnit GeographyUnit
dpi float

Returns

double

GetScaleFromResolution(double, GeographyUnit, float)

public static double GetScaleFromResolution(double resolution, GeographyUnit unit, float dpi = 96)

Parameters

resolution double
unit GeographyUnit
dpi float

Returns

double

GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, Feature, Feature, float, float)

This method returns the number of pixels between two features.

public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, Feature worldPointFeature1, Feature worldPointFeature2, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

worldPointFeature1 Feature

This parameter is the first feature -- the one you want to measure from.

worldPointFeature2 Feature

This parameter is the second feature -- the one you want to measure to.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

float

This method returns the number of pixels between two features.

Remarks

None

GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, PointShape, PointShape, float, float)

This method returns the number of pixels between two world points.

public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, PointShape worldPoint1, PointShape worldPoint2, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

worldPoint1 PointShape

This parameter is the first point -- the one you want to measure from.

worldPoint2 PointShape

This parameter is the second point -- the one you want to measure to.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

float

This method returns the number of pixels between two world points.

Remarks

None

GetShortUnitString(DistanceUnit, Dictionary<string, string>)

public static string GetShortUnitString(DistanceUnit targetUnit, Dictionary<string, string> preferredDisplayUnitString = null)

Parameters

targetUnit DistanceUnit
preferredDisplayUnitString Dictionary<string, string>

Returns

string

GetSnappedExtent(RectangleShape, GeographyUnit, float, float, ZoomLevelSet)

public static RectangleShape GetSnappedExtent(RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ZoomLevelSet zoomLevelSet)

Parameters

worldExtent RectangleShape
worldExtentUnit GeographyUnit
screenWidth float
screenHeight float
zoomLevelSet ZoomLevelSet

Returns

RectangleShape

GetSnappedScale(double, ZoomLevelSet)

public static double GetSnappedScale(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

double

GetSnappedScale(RectangleShape, float, GeographyUnit, ZoomLevelSet)

public static double GetSnappedScale(RectangleShape worldExtent, float screenWidth, GeographyUnit worldExtentUnit, ZoomLevelSet zoomLevelSet)

Parameters

worldExtent RectangleShape
screenWidth float
worldExtentUnit GeographyUnit
zoomLevelSet ZoomLevelSet

Returns

double

GetSnappedZoomLevelIndex(double, IEnumerable<double>, double, double)

This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale greater than the given one, use GetFloorZoomLevelIndex method instead.

public static int GetSnappedZoomLevelIndex(double scale, IEnumerable<double> zoomLevelScales, double minimumScale, double maximumScale)

Parameters

scale double
zoomLevelScales IEnumerable<double>
minimumScale double
maximumScale double

Returns

int

The closest zoomlevel index

GetSnappedZoomLevelIndex(double, ZoomLevelSet)

This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale greater than the given one, use GetFloorZoomLevelIndex method instead.

public static int GetSnappedZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)

Parameters

scale double
zoomLevelSet ZoomLevelSet

Returns

int

The closest zoomlevel index

GetSnappedZoomLevelIndex(RectangleShape, GeographyUnit, Collection<double>, double, double)

This method returns the closest zoomlevel index. If you want to return the zoomlevel index with a scale contains the given extent, use GetFloorZoomLevelIndex method instead.

public static int GetSnappedZoomLevelIndex(RectangleShape extent, GeographyUnit mapUnit, Collection<double> zoomLevelScales, double actualWidth, double actualHeight)

Parameters

extent RectangleShape
mapUnit GeographyUnit
zoomLevelScales Collection<double>
actualWidth double
actualHeight double

Returns

int

The closest zoomlevel index

GetVersion()

Get the current ThinkGeo.Core.dll file version.

public static string GetVersion()

Returns

string

A string representing the file version of MapSuiteCore.dll.

GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, float, float, float, float, float, float, GeographyUnit, DistanceUnit)

This method returns the distance in world units between two screen points.

public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, float screenPoint1X, float screenPoint1Y, float screenPoint2X, float screenPoint2Y, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

screenPoint1X float

This parameter is the X of the point you want to measure from.

screenPoint1Y float

This parameter is the Y of the point you want to measure from.

screenPoint2X float

This parameter is the X of the point you want to measure to.

screenPoint2Y float

This parameter is the Y of the point you want to measure to.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

worldExtentUnit GeographyUnit

This is the geographic unit of the world extent you passed in.

distanceUnit DistanceUnit

This is the geographic unit you want the result to show in.

Returns

double

GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, ScreenPointF, ScreenPointF, float, float, GeographyUnit, DistanceUnit)

This method returns the distance in world units between two screen points.

public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, ScreenPointF screenPoint1, ScreenPointF screenPoint2, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

screenPoint1 ScreenPointF

This is the screen point you want to measure from.

screenPoint2 ScreenPointF

This is the screen point you want to measure to.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

worldExtentUnit GeographyUnit

This is the geographic unit of the world extent rectangle.

distanceUnit DistanceUnit

This is the geographic unit you want the result to show in.

Returns

double

This method returns the distance in world units between two screen points.

Remarks

None

GetWorldExtent(GeographyUnit)

public static RectangleShape GetWorldExtent(GeographyUnit unit)

Parameters

unit GeographyUnit

Returns

RectangleShape

IsSameDouble(double, double, double)

public static bool IsSameDouble(double double1, double double2, double epsilon = 1E-09)

Parameters

double1 double
double2 double
epsilon double

Returns

bool

IsSameExtent(RectangleShape, RectangleShape, double)

public static bool IsSameExtent(RectangleShape extent1, RectangleShape extent2, double epsilon = 1E-09)

Parameters

extent1 RectangleShape
extent2 RectangleShape
epsilon double

Returns

bool

IsSamePoint(PointShape, PointShape, double)

public static bool IsSamePoint(PointShape a, PointShape b, double epsilon = 1E-09)

Parameters

a PointShape
b PointShape
epsilon double

Returns

bool

IsSamePoint(Vertex, PointShape, double)

public static bool IsSamePoint(Vertex a, PointShape b, double epsilon = 1E-09)

Parameters

a Vertex
b PointShape
epsilon double

Returns

bool

IsSamePoint(Vertex, Vertex, double)

public static bool IsSamePoint(Vertex a, Vertex b, double epsilon = 1E-09)

Parameters

a Vertex
b Vertex
epsilon double

Returns

bool

OffsetPointWithScreenOffset(PointShape, double, double, double, double, GeographyUnit)

public static PointShape OffsetPointWithScreenOffset(PointShape pointShape, double xScreenOffset, double yScreenOffset, double mapRotation, double mapScale, GeographyUnit mapUnit)

Parameters

pointShape PointShape
xScreenOffset double
yScreenOffset double
mapRotation double
mapScale double
mapUnit GeographyUnit

Returns

PointShape

Pan(RectangleShape, float, int)

This method returns a panned extent.

public static RectangleShape Pan(RectangleShape worldExtent, float degree, int percentage)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to pan.

degree float

This parameter is the degree you want to pan.

percentage int

This parameter is the percentage by which you want to pan.

Returns

RectangleShape

This method returns a panned extent.

Remarks

None

Pan(RectangleShape, PanDirection, int)

This method returns a panned extent.

public static RectangleShape Pan(RectangleShape worldExtent, PanDirection direction, int percentage)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to pan.

direction PanDirection

This parameter is the direction in which you want to pan.

percentage int

This parameter is the percentage by which you want to pan.

Returns

RectangleShape

This method returns a panned extent.

Remarks

None

Rotate(double, double, double, double, double)

this method rotates the vector source->target, and return the rotated vector based on source

public static (double, double) Rotate(double sourceX, double sourceY, double destinationX, double destinationY, double rotationAngle)

Parameters

sourceX double

the source x

sourceY double

the source y

destinationX double

the destination x before rotation

destinationY double

the destination y before rotation

rotationAngle double

the angle to rotate. positive means counter-clockwise

Returns

(double, double)

The rotated target based on source

RotatePoint(double, double, double, double, double)

public static (double, double) RotatePoint(double x, double y, double rotationAngle, double pivotX, double pivotY)

Parameters

x double
y double
rotationAngle double
pivotX double
pivotY double

Returns

(double, double)

RotatePolygonShape(PolygonShape, double, double, double)

public static PolygonShape RotatePolygonShape(PolygonShape polygonShape, double rotationAngle, double pivotX, double pivotY)

Parameters

polygonShape PolygonShape
rotationAngle double
pivotX double
pivotY double

Returns

PolygonShape

RotateRingShape(RingShape, double, double, double)

public static RingShape RotateRingShape(RingShape ringShape, double rotationAngle, double pivotX, double pivotY)

Parameters

ringShape RingShape
rotationAngle double
pivotX double
pivotY double

Returns

RingShape

ScaleExtent(double, double, double, double, double, double, double)

Scale the current extent base on the given center point

public static RectangleShape ScaleExtent(double mapWidth, double mapHeight, double resolution, double centerScreenX, double centerScreenY, double centerWorldX, double centerWorldY)

Parameters

mapWidth double

The width of the map canvas

mapHeight double

The height of the map canvas

resolution double

The current resolution, in WorldUnit/Pixel

centerScreenX double

The X of the new center screen point

centerScreenY double

The Y of the new center screen point

centerWorldX double

The X of the new center world point

centerWorldY double

The Y of the new center world point

Returns

RectangleShape

The scaled extent

ToScreenCoordinate(BaseShape, RectangleShape, float, float)

This method returns BaseShape in screen coordinates from BaseShape in world coordinates.

public static BaseShape ToScreenCoordinate(BaseShape shape, RectangleShape worldExtent, float screenWidth, float screenHeight)

Parameters

shape BaseShape

This parameter is the shape in world coordinate you want converted to a shape in screen coordinate.

worldExtent RectangleShape

This parameter is the world extent.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

BaseShape

This method returns BaseShape in screen coordinates from BaseShape in world coordinates.

Remarks

None

ToScreenCoordinate(RectangleShape, double, double, double, double)

This method returns screen coordinates from world coordinates.

public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, double worldX, double worldY, double screenWidth, double screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

worldX double

This parameter is the world X you want converted to screen points.

worldY double

This parameter is the world Y you want converted to screen points.

screenWidth double

This parameter is the width of the screen.

screenHeight double

This parameter is the height of the screen.

Returns

ScreenPointF

This method returns screen coordinates from world coordinates.

Remarks

None

ToScreenCoordinate(RectangleShape, Feature, float, float)

This method returns screen coordinates from world coordinates.

public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, Feature worldPointFeature, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

worldPointFeature Feature

This parameter is the feature you want converted to a screen point.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

ScreenPointF

This method returns screen coordinates from world coordinates.

Remarks

None

ToScreenCoordinate(RectangleShape, PointShape, float, float)

This method returns screen coordinates from world coordinates.

public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

worldPoint PointShape

This parameter is the world point you want converted to a screen point.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

ScreenPointF

This method returns screen coordinates from world coordinates.

Remarks

None

ToScreenCoordinate(RectangleShape, RectangleShape, float, float)

This method returns Rectangle in screen coordinates from RectangleShape in world coordinates.

public static DrawingRectangle ToScreenCoordinate(RectangleShape worldExtent, RectangleShape targetWorldExtent, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

targetWorldExtent RectangleShape

This parameter is the rectangle shape in world coordinate you want converted to a rectangle in screen coordinate.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

DrawingRectangle

This method returns Rectangle in screen coordinates from RectangleShape in world coordinates.

Remarks

None

ToWorldCoordinate(double, double, PointShape, double, double, double, GeographyUnit, double)

public static PointShape ToWorldCoordinate(double screenX, double screenY, PointShape centerPoint, double centerScreenX, double centerScreenY, double scale, GeographyUnit mapUnit, double mapRotation = 0)

Parameters

screenX double
screenY double
centerPoint PointShape
centerScreenX double
centerScreenY double
scale double
mapUnit GeographyUnit
mapRotation double

Returns

PointShape

ToWorldCoordinate(PolygonShape, RectangleShape, float, float)

public static Feature ToWorldCoordinate(PolygonShape simplyPolygon, RectangleShape currentWorldExtent, float canvasWidth, float canvasHeight)

Parameters

simplyPolygon PolygonShape
currentWorldExtent RectangleShape
canvasWidth float
canvasHeight float

Returns

Feature

ToWorldCoordinate(RectangleShape, double, double, double, double)

public static PointShape ToWorldCoordinate(RectangleShape currentExtent, double screenX, double screenY, double screenWidth, double screenHeight)

Parameters

currentExtent RectangleShape
screenX double
screenY double
screenWidth double
screenHeight double

Returns

PointShape

ToWorldCoordinate(RectangleShape, float, float, float, float)

This method returns world coordinates from screen coordinates.

public static PointShape ToWorldCoordinate(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

screenX float

This parameter is the X of the point you want converted to world coordinates.

screenY float

This parameter is the Y of the point you want converted to world coordinates.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

PointShape

This method returns world coordinates from screen coordinates.

Remarks

None

ToWorldCoordinate(RectangleShape, ScreenPointF, float, float)

This method returns world coordinates from screen coordinates.

public static PointShape ToWorldCoordinate(RectangleShape worldExtent, ScreenPointF screenPoint, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent.

screenPoint ScreenPointF

This parameter is the screen point you want converted to a world point.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

PointShape

This method returns world coordinates from screen coordinates.

Remarks

None

ZoomIn(RectangleShape, int)

This method returns a new extent that is zoomed in by the percentage provided.

public static RectangleShape ZoomIn(RectangleShape worldExtent, int percentage)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to zoom to.

percentage int

This parameter is the percentage by which you want to zoom in.

Returns

RectangleShape

This method returns a new extent that is zoomed in by the percentage provided.

Remarks

None

ZoomIntoCenter(RectangleShape, int, float, float, float, float)

This method returns an extent that is centered and zoomed in.

public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to center and zoom to.

percentage int

This parameter is the percentage by which you want to zoom in.

screenX float

This parameter is the screen X you want to center on.

screenY float

This parameter is the screen Y you want to center on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an extent that is centered and zoomed in.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.

ZoomIntoCenter(RectangleShape, int, Feature, float, float)

This method returns an extent that is centered and zoomed.

public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent that you want centered and zoomed to.

percentage int

This parameter is the percentage by which you want to zoom in.

centerFeature Feature

This parameter is the feature you want the extent to be centered on.

screenWidth float

This parameter is the width in screen coordinates.

screenHeight float

This parameter is the height in screen coordinates.

Returns

RectangleShape

This method returns an extent that is centered and zoomed in.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.

ZoomIntoCenter(RectangleShape, int, PointShape, float, float)

This method returns an extent that is centered and zoomed in.

public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent that you want centered and zoomed to.

percentage int

This parameter is the percentage by which you want to zoom in.

worldPoint PointShape

This parameter is the world point you want the extent to be centered on.

screenWidth float

This parameter is the width in screen coordinates.

screenHeight float

This parameter is the height in screen coordinates.

Returns

RectangleShape

This method returns an extent that is centered and zoomed in.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.

ZoomOut(RectangleShape, int)

This method returns a new extent that is zoomed out by the percentage provided.

public static RectangleShape ZoomOut(RectangleShape worldExtent, int percentage)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to zoom out to.

percentage int

This parameter is the percentage by which you want to zoom out.

Returns

RectangleShape

This method returns a new extent that is zoomed out by the percentage provided.

Remarks

None

ZoomOutToCenter(RectangleShape, int, float, float, float, float)

This method returns an extent that is centered and zoomed out.

public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to center and zoom out to.

percentage int

This parameter is the percentage by which you want to zoom out.

screenX float

This parameter is the screen X you want to center on.

screenY float

This parameter is the screen Y you want to center on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an extent that is centered and zoomed out.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterward.

ZoomOutToCenter(RectangleShape, int, Feature, float, float)

This method returns an extent that is centered and zoomed out.

public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to center and zoom out to.

percentage int

This parameter is the percentage by which you want to zoom out.

centerFeature Feature

This parameter is the feature you want the extent to be centered on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an extent that is centered and zoomed out.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.

ZoomOutToCenter(RectangleShape, int, PointShape, float, float)

This method returns an extent that is centered and zoomed out.

public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)

Parameters

worldExtent RectangleShape

This parameter is the world extent you want to center and zoom out to.

percentage int

This parameter is the percentage by which you want to zoom out.

worldPoint PointShape

This parameter is the world point you want the extent to be centered on.

screenWidth float

This parameter is the width of the screen.

screenHeight float

This parameter is the height of the screen.

Returns

RectangleShape

This method returns an extent that is centered and zoomed out.

Remarks

The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.

ZoomToScale(double, RectangleShape, GeographyUnit, double, double)

This method returns a extent that has been zoomed into a certain scale.

public static RectangleShape ZoomToScale(double targetScale, RectangleShape worldExtent, GeographyUnit worldExtentUnit, double screenWidth, double screenHeight)

Parameters

targetScale double

This parameter is the scale you want to zoom into.

worldExtent RectangleShape

This parameter is the world extent you want zoomed into the scale.

worldExtentUnit GeographyUnit

This parameter is the geographic unit of the world extent parameter.

screenWidth double

This parameter is the screen width.

screenHeight double

This parameter is the screen height.

Returns

RectangleShape

This method returns a extent that has been zoomed into a certain scale.

Remarks

None

ZoomToScale(double, RectangleShape, GeographyUnit, float, float, ScreenPointF)

This method returns a extent that has been zoomed into a certain scale.

public static RectangleShape ZoomToScale(double targetScale, RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ScreenPointF offsetScreenPoint)

Parameters

targetScale double

This parameter is the scale you want to zoom into.

worldExtent RectangleShape

This parameter is the world extent you want zoomed into the scale.

worldExtentUnit GeographyUnit

This parameter is the geographic unit of the world extent parameter.

screenWidth float

This parameter is the screen width.

screenHeight float

This parameter is the screen height.

offsetScreenPoint ScreenPointF

This parameter is the offsetScreenPoint.

Returns

RectangleShape

This method returns a extent that has been zoomed into a certain scale.

Remarks

None

isSameScale(double, double, double)

public static bool isSameScale(double scale1, double scale2, double epsilon = 1E-06)

Parameters

scale1 double
scale2 double
epsilon double

Returns

bool