EllipseShape¶
Namespace: ThinkGeo.Core
This class represents an ellipse that is defined with a center point, a height and a width.
public class EllipseShape : AreaBaseShape
Inheritance Object → BaseShape → AreaBaseShape → EllipseShape
Remarks:
None
Properties¶
Width¶
This property returns the width of the EllipseShape in the unit of the shape.
public double Width { get; }
Property Value¶
This property returns the width of the EllipseShape in the unit of the
shape.
Remarks:
None
Height¶
This property returns the height of the EllipseShape in the unit of the shape.
public double Height { get; }
Property Value¶
This property returns the height of the EllipseShape in the unit of the
shape.
Remarks:
None
Center¶
This property allows you to get or set the center PointShape of the EllipseShape.
public PointShape Center { get; set; }
Property Value¶
This property allows you to get or set the center PointShape of the
EllipseShape.
Remarks:
None
Id¶
The id of the shape.
public string Id { get; set; }
Property Value¶
Tag¶
The tag of the shape.
public object Tag { get; set; }
Property Value¶
Constructors¶
EllipseShape()¶
This constructor creates the EllipseShape.
public EllipseShape()
Remarks:
None
EllipseShape(PointShape, Double)¶
This constructor creates the EllipseShape.
public EllipseShape(PointShape center, double radius)
Parameters¶
center
PointShape
This parameter is the center PointShape for the EllipseShape.
radius
Double
This parameter allows you to set the radius of the EllipseShape.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid radius which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
Using this overload will create a circle.
EllipseShape(Feature, Double)¶
This constructor creates the EllipseShape.
public EllipseShape(Feature centerPointFeature, double radius)
Parameters¶
centerPointFeature
Feature
This parameter is the center PointFeature for the EllipseShape.
radius
Double
This parameter allows you to set the radius of the EllipseShape.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid radius which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
Using this overload will create a circle.
EllipseShape(PointShape, Double, Double)¶
This constructor creates the EllipseShape.
public EllipseShape(PointShape center, double horizontalRadius, double verticalRadius)
Parameters¶
center
PointShape
This parameter is the center PointShape for the EllipseShape.
horizontalRadius
Double
This parameter allows you to set the horizontal radius of the EllipseShape in the
unit of the shape.
verticalRadius
Double
This parameter allows you to set the vertical radius of the EllipseShape in the
unit of the shape.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid horizonalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid verticalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
None
EllipseShape(Feature, Double, Double)¶
This constructor creates the EllipseShape.
public EllipseShape(Feature centerPointFeature, double horizontalRadius, double verticalRadius)
Parameters¶
centerPointFeature
Feature
This parameter is the center PointFeature for the EllipseShape.
horizontalRadius
Double
This parameter allows you to set the horizontal radius of the EllipseShape in the
unit of the shape.
verticalRadius
Double
This parameter allows you to set the vertical radius of the EllipseShape in the
unit of the shape.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid horizonalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid verticalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
None
EllipseShape(String)¶
This constructor creates the EllipseShape.
public EllipseShape(string wellKnownText)
Parameters¶
wellKnownText
String
This parameter is the well-known text used to create the shape.
Exceptions¶
ArgumentException
Passing invalid well-known text in the wellKnownText parameter will throw an ArgumentException.
ArgumentNullException
Passing a null as the wellKnownText parameter will throw an ArgumentNullException.
Remarks:
None
EllipseShape(Byte[])¶
This constructor creates the EllipseShape.
public EllipseShape(Byte[] wellKnownBinary)
Parameters¶
wellKnownBinary
Byte[]
This parameter is the well-known binary used to create the shape.
Exceptions¶
ArgumentException
Passing invalid well-known binary in the bytes parameter will throw an ArgumentException.
ArgumentNullException
Passing a null as the bytes parameter will throw an ArgumentNullException.
Remarks:
None
EllipseShape(PointShape, Double, GeographyUnit, DistanceUnit)¶
This constructor creates the EllipseShape.
public EllipseShape(PointShape center, double radius, GeographyUnit shapeUnit, DistanceUnit unitOfRadius)
Parameters¶
center
PointShape
This parameter is the center PointShape for the EllipseShape.
radius
Double
This parameter allows you to set the radius of the EllipseShape in the unit
specified by the unitOfRadius parameter.
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
unitOfRadius
DistanceUnit
This is the DistanceUnit you would like to use for the radius value. For example, if
you select miles as your unitOfRadius, then it will use miles.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid radius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfRadius that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
This overload will create a circle.
EllipseShape(Feature, Double, GeographyUnit, DistanceUnit)¶
This constructor creates the EllipseShape.
public EllipseShape(Feature centerPointFeature, double radius, GeographyUnit shapeUnit, DistanceUnit unitOfRadius)
Parameters¶
centerPointFeature
Feature
This parameter is the center Point Feature for the EllipseShape.
radius
Double
This parameter allows you to set the radius of the EllipseShape in the unit
specified by the unitOfRadius parameter.
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
unitOfRadius
DistanceUnit
This is the DistanceUnit you would like to use for the radius value. For example, if
you select miles as your unitOfRadius, then it will use miles.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid radius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfRadius that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
This overload will create a circle.
EllipseShape(PointShape, Double, Double, GeographyUnit, DistanceUnit)¶
This constructor creates the EllipseShape.
public EllipseShape(PointShape center, double horizontalRadius, double verticalRadius, GeographyUnit shapeUnit, DistanceUnit unitOfRadius)
Parameters¶
center
PointShape
This parameter is the center PointShape for the EllipseShape.
horizontalRadius
Double
This parameter allows you to set the horizontal radius of the EllipseShape in the
unit specified by the unitOfRadius parameter.
verticalRadius
Double
This parameter allows you to set the vertical radius of the EllipseShape in the
unit specified by the unitOfRadius parameter.
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
unitOfRadius
DistanceUnit
This is the DistanceUnit you would like to use for the radius value. For example, if
you select miles as your unitOfRadius, then it will use miles.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid horizonalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid verticalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfRadius that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
EllipseShape(Feature, Double, Double, GeographyUnit, DistanceUnit)¶
This constructor creates the EllipseShape.
public EllipseShape(Feature centerPointFeature, double horizontalRadius, double verticalRadius, GeographyUnit shapeUnit, DistanceUnit unitOfRadius)
Parameters¶
centerPointFeature
Feature
This parameter is the center Point Feature for the EllipseShape.
horizontalRadius
Double
This parameter allows you to set the horizontal radius of the EllipseShape in the
unit specified by the unitOfRadius parameter.
verticalRadius
Double
This parameter allows you to set the vertical radius of the EllipseShape in the
unit specified by the unitOfRadius parameter.
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
unitOfRadius
DistanceUnit
This is the DistanceUnit you would like to use for the radius value. For example, if
you select miles as your unitOfRadius, then it will use miles.
Exceptions¶
ArgumentNullException
If you pass a null as the center, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid horizonalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid verticalRadius which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfRadius that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
Methods¶
CloneDeepCore()¶
This method returns a complete copy of the shape without any references in common.
protected BaseShape CloneDeepCore()
Returns¶
This method returns a complete copy of the shape without any references in
common.
Remarks:
When you override this method, you need to ensure that there are no references in common between the original and copy.
GetWellKnownTypeCore()¶
This method returns the well-known type for the shape.
protected WellKnownType GetWellKnownTypeCore()
Returns¶
WellKnownType
This method returns the well-known type for the shape.
Remarks:
None
SetWidthByUnit(Double, GeographyUnit, DistanceUnit)¶
This method allows you to set the width of the EllipseShape in the unit specified in the unitOfWidth parameter.
public void SetWidthByUnit(double newWidth, GeographyUnit shapeUnit, DistanceUnit unitOfWidth)
Parameters¶
newWidth
Double
This parameter is the newWidth of the ellipse shape.
shapeUnit
GeographyUnit
This parameter is the unit of the current shape.
unitOfWidth
DistanceUnit
This is the unit you would like to use as the setting value. For example, if you
select miles as your unitOfWidth, then the distance will be set in
miles.
Exceptions¶
ArgumentOutOfRangeException
Passing an invalid width which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfWidth that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
GetWidthByUnit(GeographyUnit, DistanceUnit)¶
This method returns the width of the EllipseShape in the unit specified in the returningUnit parameter.
public double GetWidthByUnit(GeographyUnit shapeUnit, DistanceUnit returningUnit)
Parameters¶
shapeUnit
GeographyUnit
This parameter is the unit of the current shape.
returningUnit
DistanceUnit
This is the unit you would like to use for the return value. For example, if you
select miles as your returningUnit, then the distance will be returned in
miles.
Returns¶
This method returns the width of the EllipseShape in the unit specified in the
returningUnit parameter.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
SetHeightByUnit(Double, GeographyUnit, DistanceUnit)¶
This method allows you to set the height of the EllipseShape in the unit specified in the unitOfWidth.
public void SetHeightByUnit(double newHeight, GeographyUnit shapeUnit, DistanceUnit unitOfHeight)
Parameters¶
newHeight
Double
This parameter is the newHeight of the ellipse shape.
shapeUnit
GeographyUnit
This parameter is the unit of the current shape.
unitOfHeight
DistanceUnit
This is the unit you would like to use for the setting value. For example, if you
select miles as your unitOfHeight, then the distance will be set in
miles.
Exceptions¶
ArgumentOutOfRangeException
Passing an invalid height which is not greater than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a unitOfHeight that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
GetHeightByUnit(GeographyUnit, DistanceUnit)¶
This method returns the height of the EllipseShape in the unit specified in the returningUnit parameter.
public double GetHeightByUnit(GeographyUnit shapeUnit, DistanceUnit returningUnit)
Parameters¶
shapeUnit
GeographyUnit
This parameter is the unit of the current shape.
returningUnit
DistanceUnit
This is the unit you would like to use for the return value. For example, if you
select miles as your returningUnit, then the distance will be returned in
miles.
Returns¶
This method returns the height of the EllipseShape in the unit specified in the
returningUnit parameter.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
None
ToPolygon()¶
This method returns the current shape as a PolygonShape.
public PolygonShape ToPolygon()
Returns¶
PolygonShape
This method returns the current shape as a PolygonShape.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on this shape which has invalid upper left and lower right points, it will throw an InvalidOperationException.
Remarks:
This method is mainly used to convert this non GIS standard shape to a GIS standard shape.
ToPolygon(Int32)¶
This method returns the current shape as a PolygonShape.
public PolygonShape ToPolygon(int vertexCountInQuarter)
Parameters¶
vertexCountInQuarter
Int32
This parameter specifies how many points will make up each quarter of the ellipse.
Returns¶
PolygonShape
This method returns the current shape as a PolygonShape.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on this shape which has invalid upper left and lower right points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid vertexCountInQuarter which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
This method is mainly used to convert a GIS non-standard shape to a GIS standard shape.
GetTangents(EllipseShape)¶
This method returns the tangent points of the current ellipse in relation to the target ellipse you specify.
public Collection<PointShape> GetTangents(EllipseShape targetEllipse)
Parameters¶
targetEllipse
EllipseShape
This parameter represents the other ellipse you wish to find the tangent points
to.
Returns¶
This method returns the tangent points of the current ellipse in relation to the
target ellipse you specify.
Remarks:
This operation is useful for finding the corridor between two ellipses. It would be handy in a buffering type of scenario.
GetPerimeterCore(GeographyUnit, DistanceUnit)¶
This method returns the perimeter of the shape, which is defined as the sum of the lengths of all its sides.
protected double GetPerimeterCore(GeographyUnit shapeUnit, DistanceUnit returningUnit)
Parameters¶
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
returningUnit
DistanceUnit
This is the DistanceUnit you would like to use for the return value. For example, if
you select miles as your returningUnit, then the distance will be returned in
miles.
Returns¶
The return unit is based on the LengthUnit you specify in the returningUnit
parameter, regardless of the shape's GeographyUnit.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
You would use this method to find the distance around the area shape.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetAreaCore(GeographyUnit, AreaUnit)¶
This method returns the area of the shape, which is defined as the size of the region enclosed by the figure.
protected double GetAreaCore(GeographyUnit shapeUnit, AreaUnit returningUnit)
Parameters¶
shapeUnit
GeographyUnit
This is the GeographyUnit of the shape you are performing the operation
on.
returningUnit
AreaUnit
This is the AreaUnit you would like to use for the return value. For example, if
you select square miles as your returningUnit, then the distance will be returned in
square miles.
Returns¶
The return unit is based on the AreaUnit you specify in the returningUnit
parameter, regardless of the shape's GeographyUnit.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
You would use this method to find the area inside of a shape.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
ScaleUpCore(Double)¶
This method increases the size of the area shape by the percentage given in the percentage parameter.
protected void ScaleUpCore(double percentage)
Parameters¶
percentage
Double
This is the percentage by which to increase the shape's size.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid percentage which is less than 0 will throw an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to increase the size of the shape. Note that a larger percentage will scale the shape up faster, as you are applying the operation multiple times. There is also a ScaleDown method that will shrink the shape.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
ScaleDownCore(Double)¶
This method decreases the size of the area shape by the percentage given in the percentage parameter.
protected void ScaleDownCore(double percentage)
Parameters¶
percentage
Double
This is the percentage by which to decrease the shape's size.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid percentage which is less than 0 will throw an ArgumentOutOfRangeException.
Remarks:
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetBoundingBoxCore()¶
This method calculates the smallest RectangleShape that encompasses the entire geometry.
protected RectangleShape GetBoundingBoxCore()
Returns¶
The RectangleShape returned is the smallest RectangleShape that can encompass the
entire geometry.
Exceptions¶
InvalidOperationException
In the event you attempt to get the bounding box from a shape which has no points, it will throw an InvalidOperationException.
Remarks:
The GetBoundingBox method calculates the smallest RectangleShape that can encompass the entire geometry by examining each point in the geometry.
Depending on the number of PointShapes and complexity of the geometry, this operation can take a significant amount of time (the larger the objects, the more time the operation will take).
If the shape is a PointShape, then the bounding box's upper left and lower right points will be equal. This will create a RectangleShape with no area.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
RegisterCore(PointShape, PointShape, DistanceUnit, GeographyUnit)¶
This method returns a BaseShape which has been registered from its original coordinate system to another based on two anchor PointShapes.
protected BaseShape RegisterCore(PointShape fromPoint, PointShape toPoint, DistanceUnit fromUnit, GeographyUnit toUnit)
Parameters¶
fromPoint
PointShape
This parameter is the anchor PointShape in the coordinate of origin.
toPoint
PointShape
This parameter is the anchor PointShape in the coordinate of destination.
fromUnit
DistanceUnit
This parameter is the DistanceUnit of the coordinate of origin.
toUnit
GeographyUnit
This parameter is the GeographyUnit of the coordinate of destination.
Returns¶
BaseShape
This method returns a BaseShape which has been registered from its original coordinate system to another based on two anchor PointShapes.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a fromUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a toUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentNullException
Passing a null as the fromPoint parameter will throw an ArgumentNullException.
ArgumentNullException
Passing a null as the toPoint parameter will throw an ArgumentNullException.
Remarks:
Registering allows you to take a geometric shape generated in a planar system and attach it to the ground in a Geographic Unit.
A common scenario is integrating geometric shapes from external programs (such as CAD software or a modeling system) and placing them onto a map. You may have the schematics of a building in a CAD system and the relationship between all the points of the building are in feet. You want to then take the CAD image and attach it to where it really exists on a map. You would use the register method to do this.
Registering is also useful for scientific modeling, where software models things such as a plume of hazardous materials or the fallout from a volcano. The modeling software typically generates these models in a fictitious planar system. You would then use the register to take the abstract model and attach it to a map with real coordinates.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
TranslateByOffsetCore(Double, Double, GeographyUnit, DistanceUnit)¶
This method moves the base shape from one location to another based on an X and Y offset distance.
protected void TranslateByOffsetCore(double xOffsetDistance, double yOffsetDistance, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
Parameters¶
xOffsetDistance
Double
This is the number of horizontal units of movement in the DistanceUnit specified by
the distanceUnit parameter.
yOffsetDistance
Double
This is the number of horizontal units of movement in the DistanceUnit specified by
the distanceUnit parameter.
shapeUnit
GeographyUnit
This is the GeographicUnit of the shape you are performing the operation on.
distanceUnit
DistanceUnit
This is the DistanceUnit you would like to use as the measurement for the move. For example, if you select miles as your distanceUnit, then the xOffsetDistance and yOffsetDistance will be calculated in miles.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method from a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This method moves the base shape from one location to another based on an X and Y offset distance. It is important to note that with this overload the X and Y offset units are based on the distanceUnit parameter. For example, if your shape is in decimal degrees and you call this method with an X offset of one and a Y offset of one, you're going to move this shape one unit of the distanceUnit in the horizontal direction and one unit of the distanceUnit in the vertical direction. In this way, you can easily move a shape in decimal degrees five miles to on the X axis and 3 miles on the Y axis.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
TranslateByDegreeCore(Double, Double, GeographyUnit, DistanceUnit)¶
This method moves the base shape from one location to another based on a direction in degrees and distance.
protected void TranslateByDegreeCore(double distance, double angleInDegrees, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
Parameters¶
distance
Double
The distance is the number of units to move the shape using the angle specified.
The distance unit will be the DistanceUnit specified in the distanceUnit parameter. The
distance must be greater than or equal to 0.
angleInDegrees
Double
A number between 0 and 360 degrees that represents the direction you wish to move the shape with zero being up.
shapeUnit
GeographyUnit
This is the GeographicUnit of the shape you are performing the operation
on.
distanceUnit
DistanceUnit
This is the DistanceUnit you would like to use as the measurement for the move. For
example, if you select miles as your distanceUnit, then the distance will be calculated
in miles.
Exceptions¶
ArgumentOutOfRangeException
Passing an invalid angleInDegrees which is not between 0 and 360 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method from a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid distance which is not greater than or equal to 0 will throw an ArgumentOutOfRangeException.
Remarks:
This method moves the base shape from one location to another based on angleInDegrees and distance parameter. It is important to note that with this overload the distance units are based on the distanceUnit parameter. For example, if your shape is in decimal degrees and you call this method with a distanceUnit in miles, you're going to move this shape a number of miles based on the distance and the angleInDegrees. In this way, you can easily move a shape in decimal degrees five miles to the north.
If you pass a distance of 0, then the operation is ignored.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
RotateCore(PointShape, Double)¶
This method rotates the shape a number of degrees based on a pivot point.
protected void RotateCore(PointShape pivotPoint, double degreeAngle)
Parameters¶
pivotPoint
PointShape
The pivotPoint represents the center of rotation.
degreeAngle
Double
The number of degrees of rotation required from 0 to 360.
Exceptions¶
ArgumentNullException
If you pass a null as the pivotPoint, we will throw an ArgumentNullException.
ArgumentOutOfRangeException
Passing an invalid degreeAngle which is not between 0 and 360 will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which is not valid, it will throw an InvalidOperationException.
Remarks:
This method rotates the shape by a number of degrees based on a pivot point. By placing the pivot point in the center of the shape, you can acheive in-place rotation. By moving the pivot point outside of the center of the shape, you can translate the shape in a circular motion. Moving the pivot point further away from the center will make the circular area larger.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetClosestPointToCore(BaseShape, GeographyUnit)¶
This method returns the point of the current shape that is closest to the target shape.
protected PointShape GetClosestPointToCore(BaseShape targetShape, GeographyUnit shapeUnit)
Parameters¶
targetShape
BaseShape
The shape you are trying to find the closest point to.
shapeUnit
GeographyUnit
This is the GeographicUnit of the shape you are performing the operation on.
Returns¶
A PointShape representing the point of the current shape that is closest to the
targetShape.
Exceptions¶
ArgumentException
If you pass in a targetShape which does not have any points, we will throw an ArgumentException.
ArgumentNullException
If you pass a null as the targetShape, we will throw an ArgumentNullException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
This method returns point of the current shape that is closest to the target shape. It is often the case that the point returned is not a point of the object itself. An example would be a line with two points that are far apart from each other. If you set the targetShape to be a point midway between the points but a short distance away, the method would return a point that is on the line, but not one of the two points that make up the line.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetDistanceToCore(BaseShape, GeographyUnit, DistanceUnit)¶
This method computes the distance between the current shape and the targetShape.
protected double GetDistanceToCore(BaseShape targetShape, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
Parameters¶
targetShape
BaseShape
The shape you are trying to find the distance to.
shapeUnit
GeographyUnit
This is the GeographicUnit of the shape you are performing the operation on.
distanceUnit
DistanceUnit
This is the DistanceUnit you would like to use as the return value. For example,
if you select miles as your distanceUnit, then the distance will be returned in
miles.
Returns¶
The return type is the distance between this shape and the targetShape in the
GeographyUnit of the shape.
Exceptions¶
ArgumentException
If you pass in a targetShape which does not have any points, we will throw an ArgumentException.
ArgumentNullException
If you pass a null as the targetShape, we will throw an ArgumentNullException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
In this method, we compute the closest distance between two shapes. The returned unit will be in the unit of distance specified in the distanceUnit parameter.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetWellKnownTextCore(Int32)¶
This method returns the well-known text representation of this shape.
protected string GetWellKnownTextCore(int vertexCountInQuarter)
Parameters¶
vertexCountInQuarter
Int32
This parameter specifies how many points will make up each quarter of the
ellipse.
Returns¶
String
This method returns a stringthat represents the shape in well-known text.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on this shape which has invalid upper left and lower right points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid vertexCountInQuarter which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
This method returns a string that represents the shape in well-known text. Well-known text allows you to describe geometries as a string of text. Well-known text is useful when you want to save a geometry in a format such as a text file, or when you simply want to cut and paste the text between other applications. An alternative to well-known text is well-known binary, which is a binary representation of a geometry object. We also have methods that work with well-known binary. Below are some samples of what well-known text might look like for various kinds of geometries.
POINT(5 17)
LINESTRING(4 5,10 50,25 80)
POLYGON((2 2,6 2,6 6,2 6,2 2),(3 3,4 3,4 4,3 4,3 3))
MULTIPOINT(3.7 9.7,4.9 11.6)
MULTILINESTRING((4 5,11 51,21 26),(-4 -7,-9 -7,-14 -3))
MULTIPOLYGON(((2 2,6 2,6 6,2 6,2 2),(3 3,4 3,4 4,3 4,3 3)),((4 4,7 3,7 5,4 4)))
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetWellKnownTextCore(RingOrder)¶
This method returns the well-known text representation of this shape.
protected string GetWellKnownTextCore(RingOrder outerRingOrder)
Parameters¶
outerRingOrder
RingOrder
Returns¶
String
This method returns a string that represents the shape in well-known text.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This method returns a string that represents the shape in well-known text. Well-known text allows you to describe geometries as a string of text. Well-known text is useful when you want to save a geometry in a format such as a text file, or when you simply want to cut and paste the text between other applications. An alternative to well-known text is well-known binary, which is a binary representation of a geometry object. We also have methods that work with well-known binary. Below are some samples of what well-known text might look like for various kinds of geometries.
POINT(5 17)
LINESTRING(4 5,10 50,25 80)
POLYGON((2 2,6 2,6 6,2 6,2 2),(3 3,4 3,4 4,3 4,3 3))
MULTIPOINT(3.7 9.7,4.9 11.6)
MULTILINESTRING((4 5,11 51,21 26),(-4 -7,-9 -7,-14 -3))
MULTIPOLYGON(((2 2,6 2,6 6,2 6,2 2),(3 3,4 3,4 4,3 4,3 3)),((4 4,7 3,7 5,4 4)))
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetWellKnownTextCore(RingOrder, Int32)¶
protected string GetWellKnownTextCore(RingOrder outerRingOrder, int vertexCountInQuarter)
Parameters¶
outerRingOrder
RingOrder
vertexCountInQuarter
Int32
Returns¶
GetWellKnownBinaryCore(WkbByteOrder, Int32)¶
This method returns a byte array that represents the shape in well-known binary.
protected Byte[] GetWellKnownBinaryCore(WkbByteOrder byteOrder, int vertexCountInQuarter)
Parameters¶
byteOrder
WkbByteOrder
This parameter specifies whether the byte order is big- or little-endian.
vertexCountInQuarter
Int32
This parameter specifies how many points will make up each quarter of the
ellipse.
Returns¶
This method returns a byte array that represents the shape in well-known
binary.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a ByteOrder that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid vertexCountInQuarter which is not greater than 0 will throw an ArgumentOutOfRangeException.
Remarks:
This method returns a byte array that represents the shape in well known binary. Well-known binary allows you to describe geometries as a binary array. Well-known binary is useful when you want to save a geometry in an efficient format using as little space as possible. An alternative to well-known binary is well-known text, which is a textual representation of a geometry object. We also have methods that work with well-known text.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetWellKnownBinaryCore(RingOrder, WkbByteOrder)¶
This method returns a byte array that represents the shape in well-known binary.
protected Byte[] GetWellKnownBinaryCore(RingOrder outerRingOrder, WkbByteOrder byteOrder)
Parameters¶
outerRingOrder
RingOrder
byteOrder
WkbByteOrder
This parameter specifies whether the byte order is big- or little-endian.
Returns¶
This method returns a byte array that represents the shape in well-known
binary.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
If you pass in a ByteOrder that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
This method returns a byte array that represents the shape in well known binary. Well-known binary allows you to describe geometries as a binary array. Well-known binary is useful when you want to save a geometry in an efficient format using as little space as possible. An alternative to well-known binary is well-known text, which is a textual representation of a geometry object. We also have methods that work with well-known text.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetWellKnownBinaryCore(RingOrder, WkbByteOrder, Int32)¶
protected Byte[] GetWellKnownBinaryCore(RingOrder outerRingOrder, WkbByteOrder byteOrder, int vertexCountInQuarter)
Parameters¶
outerRingOrder
RingOrder
byteOrder
WkbByteOrder
vertexCountInQuarter
Int32
Returns¶
LoadFromWellKnownDataCore(String)¶
This method hydrates the current shape with its data from well-known text.
protected void LoadFromWellKnownDataCore(string wellKnownText)
Parameters¶
wellKnownText
String
This parameter is the well-known text you will use to hydrate your object.
Exceptions¶
ArgumentException
Passing invalid well-known text in the wellKnownText parameter will throw an ArgumentException.
ArgumentNullException
Passing a null as the wellKnownText parameter will throw an ArgumentNullException.
Remarks:
None
LoadFromWellKnownDataCore(Byte[])¶
This method hydrates the current shape with its data from well-known binary.
protected void LoadFromWellKnownDataCore(Byte[] wellKnownBinary)
Parameters¶
wellKnownBinary
Byte[]
This parameter is the well-known binary used to populate the shape.
Exceptions¶
ArgumentException
Passing invalid well-known binary in the bytes parameter will throw an ArgumentException.
ArgumentNullException
Passing a null as the bytes parameter will throw an ArgumentNullException.
Remarks:
This is used when you want to hydrate a shape based on well-known binary. You can create the shape and then load the well-known binary using this method.
ValidateCore(ShapeValidationMode)¶
This method returns a ShapeValidationResult based on a series of tests.
protected ShapeValidationResult ValidateCore(ShapeValidationMode validationMode)
Parameters¶
validationMode
ShapeValidationMode
This parameter determines whether the test is simple or advanced. In some cases, the
advanced tests can take some time. The simple test is designed to always be
fast.
Returns¶
This method returns a ShapeValidationResult based on a series of
tests.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a validationMode that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
Remarks:
We use this method, with the simple enumeration, internally before doing any kind of other methods on the shape. In this way, we are able to verify the integrity of the shape itself. If you wish to test things such as whether a polygon self-intersects, we invite you to call this method with the advanced ShapeValidationMode. One thing to consider is that for complex polygon shapes this operation could take some time, which is why we only run the basic, faster test. If you are dealing with polygon shapes that are suspect, we suggest you run the advanced test.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
ContainsCore(BaseShape)¶
This method returns whether the targetShape lies within the interior of the current shape.
protected bool ContainsCore(BaseShape targetShape)
Parameters¶
targetShape
BaseShape
The shape you wish to compare the current one to.
Returns¶
This method returns whether the targetShape lies within the interior of the current
shape.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentException
If you pass in a targetShape which is invalid, we will throw an ArgumentException.
ArgumentNullException
If you pass a null as the targetShape, we will throw an ArgumentNullException.
Remarks:
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
IntersectsCore(BaseShape)¶
This method returns whether the current shape and the targetShape have at least one point in common.
protected bool IntersectsCore(BaseShape targetShape)
Parameters¶
targetShape
BaseShape
The shape you wish to compare the current one to.
Returns¶
This method returns whether the current shape and the targetShape have at least one
point in common.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentException
If you pass in a targetShape which is invalid, we will throw an ArgumentException.
ArgumentNullException
If you pass a null as the targetShape, we will throw an ArgumentNullException.
Remarks:
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetCrossingCore(BaseShape)¶
This method returns the crossing points of the current shape and the passed-in target shape.
protected MultipointShape GetCrossingCore(BaseShape targetShape)
Parameters¶
targetShape
BaseShape
The target shape you wish to get crossing with.
Returns¶
This method returns the crossing points of the current shape and the passed-in target shape.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
ArgumentNullException
If you pass a null as the targetShape, we will throw an ArgumentNullException.
Remarks:
As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.
GeShortestPointFromOutsidePoint(PointShape)¶
internal PointShape GeShortestPointFromOutsidePoint(PointShape pointShape)
Parameters¶
pointShape
PointShape