Class MapUtil
public static class MapUtil
- Inheritance
-
MapUtil
- Inherited Members
Fields
InchesPerDecimalDegree
public const double InchesPerDecimalDegree = 4374754
Field Value
InchesPerFeet
public const double InchesPerFeet = 12
Field Value
InchesPerMeter
public const double InchesPerMeter = 39.3701
Field Value
InchesPerMile
public const double InchesPerMile = 63360
Field Value
InchesPerNauticalMile
public const double InchesPerNauticalMile = 72913.4252
Field Value
InchesPerYard
public const double InchesPerYard = 36
Field Value
PointsPerInch
public const float PointsPerInch = 72
Field Value
StandardDpi
public const float StandardDpi = 96
Field Value
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
RectangleShapewidth
doubleheight
doublerestrictExtent
RectangleShapemaximumScale
doubleminimumScale
doublemapUnit
GeographyUnit
Returns
ApplyDrawingMarginToExtent(RectangleShape, float, float, float)
public static RectangleShape ApplyDrawingMarginToExtent(RectangleShape worldExtent, float marginInPixel, float screenWidth, float screenHeight)
Parameters
worldExtent
RectangleShapemarginInPixel
floatscreenWidth
floatscreenHeight
float
Returns
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
stringfeatures
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
PointShapescale
doublemapUnit
GeographyUnitmapWidth
doublemapHeight
double
Returns
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
RectangleShapeThis parameter is the current extent you want to center.
screenX
floatThis parameter is the X coordinate on the screen to center on.
screenY
floatThis parameter is the Y coordinate on the screen to center on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the current extent you want to center.
centerFeature
FeatureThis parameter is the world point you want to center on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the current extent you want to center.
worldPoint
PointShapeThis parameter is the world point you want to center on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
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
doublezoomLevelScales
Collection<double>
Returns
GetClosestZoomLevelIndex(double, ZoomLevelSet)
public static int GetClosestZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scale
doublezoomLevelSet
ZoomLevelSet
Returns
GetDegreeFromPanDirection(PanDirection)
public static double GetDegreeFromPanDirection(PanDirection panDirection)
Parameters
panDirection
PanDirection
Returns
GetDistance(PointShape, PointShape)
public static double GetDistance(PointShape fromPoint, PointShape toPoint)
Parameters
fromPoint
PointShapetoPoint
PointShape
Returns
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
RectangleShapeThis parameter is the world extent you want to adjust for drawing.
screenWidth
doubleThis parameter is the width of the screen.
screenHeight
doubleThis 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
PointShapecanvasWidth
doublecanvasHeight
doublescale
doublemapUnit
GeographyUnit
Returns
GetFloorCeilingScales(double, ZoomLevelSet)
public static (double, double) GetFloorCeilingScales(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scale
doublezoomLevelSet
ZoomLevelSet
Returns
GetFloorCeilingZoomLevelIndex(double, Collection<double>)
public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, Collection<double> zoomLevelScales)
Parameters
scale
doublezoomLevelScales
Collection<double>
Returns
GetFloorCeilingZoomLevelIndex(double, ZoomLevelSet)
public static (int, int) GetFloorCeilingZoomLevelIndex(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scale
doublezoomLevelSet
ZoomLevelSet
Returns
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
doublezoomLevelScales
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
doublezoomLevelSet
ZoomLevelSet
Returns
- int
The floor zoomlevel index
GetInchesPerDistanceUnit(DistanceUnit)
public static double GetInchesPerDistanceUnit(DistanceUnit targetUnit)
Parameters
targetUnit
DistanceUnit
Returns
GetInchesPerGeographyUnit(GeographyUnit)
public static double GetInchesPerGeographyUnit(GeographyUnit targetUnit)
Parameters
targetUnit
GeographyUnit
Returns
GetResolution(RectangleShape, double, double)
public static double GetResolution(RectangleShape boundingBox, double widthInPixel, double heightInPixel)
Parameters
boundingBox
RectangleShapewidthInPixel
doubleheightInPixel
double
Returns
GetResolutionFromScale(double, GeographyUnit, float)
public static double GetResolutionFromScale(double scale, GeographyUnit unit, float dpi = 96)
Parameters
scale
doubleunit
GeographyUnitdpi
float
Returns
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
RectangleShapethe extent to display on the canvas
rotationAngle
doublethe rotation angle of the extent
canvasWidth
doublecanvas width in pixel
canvasHeight
doublecanvas height in pixel
Returns
GetRotatedCanvasRadius(double, double, double, double)
public static double GetRotatedCanvasRadius(double pivotX, double pivotY, double canvasWidth, double canvasHeight)
Parameters
Returns
GetRotatedExtent(RectangleShape, double, PointShape)
public static RectangleShape GetRotatedExtent(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)
Parameters
extent
RectangleShaperotatedAngle
doublepivotPoint
PointShape
Returns
GetRotatedPoint(double, double, double, PointShape)
public static PointShape GetRotatedPoint(double x, double y, double rotatedAngle, PointShape pivotPoint)
Parameters
x
doubley
doublerotatedAngle
doublepivotPoint
PointShape
Returns
GetRotatedPolygon(RectangleShape, double, PointShape)
public static AreaBaseShape GetRotatedPolygon(RectangleShape extent, double rotatedAngle, PointShape pivotPoint)
Parameters
extent
RectangleShaperotatedAngle
doublepivotPoint
PointShape
Returns
GetRotatedScreenPoint(double, double, double, ScreenPointD)
public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointD pivotPoint)
Parameters
x
doubley
doublerotatedAngle
doublepivotPoint
ScreenPointD
Returns
GetRotatedScreenPoint(double, double, double, ScreenPointF)
public static ScreenPointF GetRotatedScreenPoint(double x, double y, double rotatedAngle, ScreenPointF pivotPoint)
Parameters
x
doubley
doublerotatedAngle
doublepivotPoint
ScreenPointF
Returns
GetScale(GeographyUnit, RectangleShape, double, double, float)
public static double GetScale(GeographyUnit mapUnit, RectangleShape boundingBox, double widthInPixel, double heightInPixel, float dpi = 96)
Parameters
mapUnit
GeographyUnitboundingBox
RectangleShapewidthInPixel
doubleheightInPixel
doubledpi
float
Returns
GetScale(RectangleShape, double, GeographyUnit, float)
public static double GetScale(RectangleShape worldExtent, double screenWidth, GeographyUnit worldExtentUnit, float dpi = 96)
Parameters
worldExtent
RectangleShapescreenWidth
doubleworldExtentUnit
GeographyUnitdpi
float
Returns
GetScaleFromResolution(double, GeographyUnit, float)
public static double GetScaleFromResolution(double resolution, GeographyUnit unit, float dpi = 96)
Parameters
resolution
doubleunit
GeographyUnitdpi
float
Returns
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
RectangleShapeThis parameter is the world extent.
worldPointFeature1
FeatureThis parameter is the first feature -- the one you want to measure from.
worldPointFeature2
FeatureThis parameter is the second feature -- the one you want to measure to.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent.
worldPoint1
PointShapeThis parameter is the first point -- the one you want to measure from.
worldPoint2
PointShapeThis parameter is the second point -- the one you want to measure to.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
DistanceUnitpreferredDisplayUnitString
Dictionary<string, string>
Returns
GetSnappedExtent(RectangleShape, GeographyUnit, float, float, ZoomLevelSet)
public static RectangleShape GetSnappedExtent(RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ZoomLevelSet zoomLevelSet)
Parameters
worldExtent
RectangleShapeworldExtentUnit
GeographyUnitscreenWidth
floatscreenHeight
floatzoomLevelSet
ZoomLevelSet
Returns
GetSnappedScale(double, ZoomLevelSet)
public static double GetSnappedScale(double scale, ZoomLevelSet zoomLevelSet)
Parameters
scale
doublezoomLevelSet
ZoomLevelSet
Returns
GetSnappedScale(RectangleShape, float, GeographyUnit, ZoomLevelSet)
public static double GetSnappedScale(RectangleShape worldExtent, float screenWidth, GeographyUnit worldExtentUnit, ZoomLevelSet zoomLevelSet)
Parameters
worldExtent
RectangleShapescreenWidth
floatworldExtentUnit
GeographyUnitzoomLevelSet
ZoomLevelSet
Returns
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
doublezoomLevelScales
IEnumerable<double>minimumScale
doublemaximumScale
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
doublezoomLevelSet
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
RectangleShapemapUnit
GeographyUnitzoomLevelScales
Collection<double>actualWidth
doubleactualHeight
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
RectangleShapeThis parameter is the world extent.
screenPoint1X
floatThis parameter is the X of the point you want to measure from.
screenPoint1Y
floatThis parameter is the Y of the point you want to measure from.
screenPoint2X
floatThis parameter is the X of the point you want to measure to.
screenPoint2Y
floatThis parameter is the Y of the point you want to measure to.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis parameter is the height of the screen.
worldExtentUnit
GeographyUnitThis is the geographic unit of the world extent you passed in.
distanceUnit
DistanceUnitThis is the geographic unit you want the result to show in.
Returns
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
RectangleShapeThis parameter is the world extent.
screenPoint1
ScreenPointFThis is the screen point you want to measure from.
screenPoint2
ScreenPointFThis is the screen point you want to measure to.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis parameter is the height of the screen.
worldExtentUnit
GeographyUnitThis is the geographic unit of the world extent rectangle.
distanceUnit
DistanceUnitThis 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
IsSameDouble(double, double, double)
public static bool IsSameDouble(double double1, double double2, double epsilon = 1E-09)
Parameters
Returns
IsSameExtent(RectangleShape, RectangleShape, double)
public static bool IsSameExtent(RectangleShape extent1, RectangleShape extent2, double epsilon = 1E-09)
Parameters
extent1
RectangleShapeextent2
RectangleShapeepsilon
double
Returns
IsSamePoint(PointShape, PointShape, double)
public static bool IsSamePoint(PointShape a, PointShape b, double epsilon = 1E-09)
Parameters
a
PointShapeb
PointShapeepsilon
double
Returns
IsSamePoint(Vertex, PointShape, double)
public static bool IsSamePoint(Vertex a, PointShape b, double epsilon = 1E-09)
Parameters
a
Vertexb
PointShapeepsilon
double
Returns
IsSamePoint(Vertex, Vertex, double)
public static bool IsSamePoint(Vertex a, Vertex b, double epsilon = 1E-09)
Parameters
Returns
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
PointShapexScreenOffset
doubleyScreenOffset
doublemapRotation
doublemapScale
doublemapUnit
GeographyUnit
Returns
Pan(RectangleShape, float, int)
This method returns a panned extent.
public static RectangleShape Pan(RectangleShape worldExtent, float degree, int percentage)
Parameters
worldExtent
RectangleShapeThis parameter is the world extent you want to pan.
degree
floatThis parameter is the degree you want to pan.
percentage
intThis 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
RectangleShapeThis parameter is the world extent you want to pan.
direction
PanDirectionThis parameter is the direction in which you want to pan.
percentage
intThis 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
doublethe source x
sourceY
doublethe source y
destinationX
doublethe destination x before rotation
destinationY
doublethe destination y before rotation
rotationAngle
doublethe angle to rotate. positive means counter-clockwise
Returns
RotatePoint(double, double, double, double, double)
public static (double, double) RotatePoint(double x, double y, double rotationAngle, double pivotX, double pivotY)
Parameters
Returns
RotatePolygonShape(PolygonShape, double, double, double)
public static PolygonShape RotatePolygonShape(PolygonShape polygonShape, double rotationAngle, double pivotX, double pivotY)
Parameters
polygonShape
PolygonShaperotationAngle
doublepivotX
doublepivotY
double
Returns
RotateRingShape(RingShape, double, double, double)
public static RingShape RotateRingShape(RingShape ringShape, double rotationAngle, double pivotX, double pivotY)
Parameters
Returns
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
doubleThe width of the map canvas
mapHeight
doubleThe height of the map canvas
resolution
doubleThe current resolution, in WorldUnit/Pixel
centerScreenX
doubleThe X of the new center screen point
centerScreenY
doubleThe Y of the new center screen point
centerWorldX
doubleThe X of the new center world point
centerWorldY
doubleThe 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
BaseShapeThis parameter is the shape in world coordinate you want converted to a shape in screen coordinate.
worldExtent
RectangleShapeThis parameter is the world extent.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent.
worldX
doubleThis parameter is the world X you want converted to screen points.
worldY
doubleThis parameter is the world Y you want converted to screen points.
screenWidth
doubleThis parameter is the width of the screen.
screenHeight
doubleThis 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
RectangleShapeThis parameter is the world extent.
worldPointFeature
FeatureThis parameter is the feature you want converted to a screen point.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent.
worldPoint
PointShapeThis parameter is the world point you want converted to a screen point.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent.
targetWorldExtent
RectangleShapeThis parameter is the rectangle shape in world coordinate you want converted to a rectangle in screen coordinate.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
doublescreenY
doublecenterPoint
PointShapecenterScreenX
doublecenterScreenY
doublescale
doublemapUnit
GeographyUnitmapRotation
double
Returns
ToWorldCoordinate(PolygonShape, RectangleShape, float, float)
public static Feature ToWorldCoordinate(PolygonShape simplyPolygon, RectangleShape currentWorldExtent, float canvasWidth, float canvasHeight)
Parameters
simplyPolygon
PolygonShapecurrentWorldExtent
RectangleShapecanvasWidth
floatcanvasHeight
float
Returns
ToWorldCoordinate(RectangleShape, double, double, double, double)
public static PointShape ToWorldCoordinate(RectangleShape currentExtent, double screenX, double screenY, double screenWidth, double screenHeight)
Parameters
currentExtent
RectangleShapescreenX
doublescreenY
doublescreenWidth
doublescreenHeight
double
Returns
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
RectangleShapeThis parameter is the world extent.
screenX
floatThis parameter is the X of the point you want converted to world coordinates.
screenY
floatThis parameter is the Y of the point you want converted to world coordinates.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent.
screenPoint
ScreenPointFThis parameter is the screen point you want converted to a world point.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent you want to zoom to.
percentage
intThis 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
RectangleShapeThis parameter is the world extent you want to center and zoom to.
percentage
intThis parameter is the percentage by which you want to zoom in.
screenX
floatThis parameter is the screen X you want to center on.
screenY
floatThis parameter is the screen Y you want to center on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent that you want centered and zoomed to.
percentage
intThis parameter is the percentage by which you want to zoom in.
centerFeature
FeatureThis parameter is the feature you want the extent to be centered on.
screenWidth
floatThis parameter is the width in screen coordinates.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent that you want centered and zoomed to.
percentage
intThis parameter is the percentage by which you want to zoom in.
worldPoint
PointShapeThis parameter is the world point you want the extent to be centered on.
screenWidth
floatThis parameter is the width in screen coordinates.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent you want to zoom out to.
percentage
intThis 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
RectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentage
intThis parameter is the percentage by which you want to zoom out.
screenX
floatThis parameter is the screen X you want to center on.
screenY
floatThis parameter is the screen Y you want to center on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentage
intThis parameter is the percentage by which you want to zoom out.
centerFeature
FeatureThis parameter is the feature you want the extent to be centered on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
RectangleShapeThis parameter is the world extent you want to center and zoom out to.
percentage
intThis parameter is the percentage by which you want to zoom out.
worldPoint
PointShapeThis parameter is the world point you want the extent to be centered on.
screenWidth
floatThis parameter is the width of the screen.
screenHeight
floatThis 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
doubleThis parameter is the scale you want to zoom into.
worldExtent
RectangleShapeThis parameter is the world extent you want zoomed into the scale.
worldExtentUnit
GeographyUnitThis parameter is the geographic unit of the world extent parameter.
screenWidth
doubleThis parameter is the screen width.
screenHeight
doubleThis 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
doubleThis parameter is the scale you want to zoom into.
worldExtent
RectangleShapeThis parameter is the world extent you want zoomed into the scale.
worldExtentUnit
GeographyUnitThis parameter is the geographic unit of the world extent parameter.
screenWidth
floatThis parameter is the screen width.
screenHeight
floatThis parameter is the screen height.
offsetScreenPoint
ScreenPointFThis 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)