LineBaseShape¶
Namespace: ThinkGeo.Core
This abstract class is the root of all line-based shapes, such as LineShape and MultilineShape.
public abstract class LineBaseShape : BaseShape
Inheritance object → BaseShape → LineBaseShape
Remarks:
This class is used as the base class for line shapes such as:
LineShape
MultilineShape
It can be inherited from to create your own specialized line geometry. If you choose to do this, your new class must conform to one of the well-known text standard shapes in order for the base implementations to work properly.
Properties¶
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¶
Methods¶
GetLength(GeographyUnit, DistanceUnit)¶
This method returns the length of the line shape.
public double GetLength(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 distance unit you would like to use as the return value. For example, if you select miles as your returningUnit, then the distance will be returned in miles.
Returns¶
Exceptions¶
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is a useful method when you want to know the total length of a line-based shape. If the shape is a MultiLineShape, then the length is the sum of all of its lines.
The shape's coordinate values are interpreted using . For a projected unit (Meter, Feet, and so on) the segments are summed as planar, straight-line distances in that projected space, so the result carries any scale distortion of the projection - for example in Spherical/Web Mercator the scale, and therefore the measured length, grows toward the poles. For GeographyUnit.DecimalDegree each segment is instead measured as a great-circle (Haversine) distance between its longitude/latitude endpoints, which is a spherical ground-distance estimate. If the coordinates are stored in a projected coordinate system and you want to reduce its scale distortion, use an overload that takes a Projection, SRID, or PROJ.4 string together with a DistanceCalculationMode.
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.
GetLengthCore(GeographyUnit, DistanceUnit)¶
This method returns the length of the line shape.
protected double GetLengthCore(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 distance unit you would like to use as the return value. For example, if you select miles as your returningUnit, then the distance will be returned in miles.
Returns¶
Exceptions¶
ArgumentOutOfRangeException
If you pass in a shapeUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is a useful method when you want to know the total length of a line-based shape. If the shape is a MultiLineShape, then the length is the sum of all of its lines.
The shape's coordinate values are interpreted using : for a projected unit the segments are summed as planar straight-line distances (so the result carries the projection's scale distortion, e.g. Spherical/Web Mercator toward the poles), whereas for GeographyUnit.DecimalDegree each segment is measured as a great-circle (Haversine) distance. To reduce distortion when the coordinates are stored in a projected coordinate system, use an overload that takes a Projection/SRID/PROJ.4 string plus a DistanceCalculationMode.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
ScaleUp(LineBaseShape, double)¶
This method returns a new shape that is increased by the percentage given in the percentage parameter.
public static LineBaseShape ScaleUp(LineBaseShape sourceShape, double percentage)
Parameters¶
sourceShape LineBaseShape
This parameter is the basis for the scale up up but is not modified.
percentage double
This is the percentage by which to increase the shape�s size.
Returns¶
LineBaseShape
a scaled line type shape.
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 thrown 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 apply the operation multiple times. There is also a ScaleDown method that will shrink the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleUp(Feature, double)¶
This method returns a new feature that is increased by the percentage given in the percentage parameter.
public static Feature ScaleUp(Feature sourceLine, double percentage)
Parameters¶
sourceLine Feature
This parameter is the basis for the scale up up but is not modified.
percentage double
This is the percentage by which to increase the shape�s size.
Returns¶
Feature
a scaled line type feature.
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 thrown an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to increase the size of the feature. Note that a larger percentage will scale the shape up faster as you apply the operation multiple times. There is also a ScaleDown method that will shrink the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleUp(double)¶
This method increases the size of the LineShape by the percentage given in the percentage parameter.
public void ScaleUp(double percentage)
Parameters¶
percentage double
This is the percentage by which to increase the shape�s size.
Returns¶
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 thrown 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 apply the operation multiple times. There is also a ScaleDown method that will shrink the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleUpCore(double)¶
This method increases the size of the LineShape 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.
Returns¶
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 thrown 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 apply the operation multiple times. There is also a ScaleDown method that will shrink the shape as well.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
ScaleDown(LineBaseShape, double)¶
This method returns a new shape that is decreases by the percentage given in the percentage parameter.
public static LineBaseShape ScaleDown(LineBaseShape sourceLineBaseShape, double percentage)
Parameters¶
sourceLineBaseShape LineBaseShape
This parameter is the basis for the scale up up but is not modified.
percentage double
This is the percentage by which to decrease the shape�s size.
Returns¶
LineBaseShape
a scaled down line type shape.
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 thrown an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to decrease the size of the shape. Note that a larger percentage will scale the shape down faster as you apply the operation multiple times. There is also a ScaleUp method that will enlarge the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleDown(Feature, double)¶
This method returns a new feature that is decreases by the percentage given in the percentage parameter.
public static Feature ScaleDown(Feature sourceLine, double percentage)
Parameters¶
sourceLine Feature
This parameter is the basis for the scale up up but is not modified.
percentage double
This is the percentage by which to decrease the shape�s size.
Returns¶
Feature
a scaled down line type feature.
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 thrown an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to decrease the size of the feature. Note that a larger percentage will scale the shape down faster as you apply the operation multiple times. There is also a ScaleUp method that will enlarge the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleDown(double)¶
This method decreases the size of the LineShape by the percentage given in the percentage parameter.
public void ScaleDown(double percentage)
Parameters¶
percentage double
This is the percentage by which to decrease the shape�s size.
Returns¶
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 thrown an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to decrease the size of the shape. Note that a larger percentage will scale the shape down faster as you apply the operation multiple times. There is also a ScaleUp method that will enlarge the shape as well.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ScaleDownCore(double)¶
This method decreases the size of the LineShape 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.
Returns¶
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 thrown an ArgumentOutOfRangeException.
Remarks:
This method is useful when you would like to decrease the size of the shape. Note that a larger percentage will scale the shape down faster as you apply the operation multiple times. There is also a ScaleUp method that will enlarge the shape as well.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined above.
GetLength(int, DistanceUnit)¶
Returns the length of this line shape as a real-world, on-the-ground distance, measured in the shape's localized UTM zone.
public double GetLength(int shapeSrid, DistanceUnit returningUnit)
Parameters¶
shapeSrid int
The SRID (EPSG code) of the coordinate system the shape's vertices are currently in; the shape is reprojected from this before measuring.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is the two-parameter form of LineBaseShape.GetLength(int, DistanceUnit, DistanceCalculationMode); it uses DistanceCalculationMode.Default (localized UTM). The shape's coordinates are treated as being in the coordinate system identified by , reprojected into the shape's local UTM zone and measured there, reducing the scale distortion that may be present in the storage projection. Local UTM measurement remains an approximation. For a MultilineShape the length is the sum of all of its lines.
GetLength(string, DistanceUnit)¶
Returns the length of this line shape as a real-world, on-the-ground distance, measured in the shape's localized UTM zone.
public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit)
Parameters¶
shapeProj4ProjectionParameters string
The PROJ.4 parameter string of the coordinate system the shape's vertices are currently in; the shape is reprojected from this before measuring.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is the two-parameter form of LineBaseShape.GetLength(int, DistanceUnit, DistanceCalculationMode); it uses DistanceCalculationMode.Default (localized UTM). The shape's coordinates are treated as being in the coordinate system described by , reprojected into the shape's local UTM zone and measured there, reducing the scale distortion that may be present in the storage projection. Local UTM measurement remains an approximation. For a MultilineShape the length is the sum of all of its lines.
GetLength(Projection, DistanceUnit)¶
Returns the length of this line shape as a real-world, on-the-ground distance, measured in the shape's localized UTM zone.
public double GetLength(Projection shapeProjection, DistanceUnit returningUnit)
Parameters¶
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in; the shape is reprojected from this before measuring.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is the two-parameter form of LineBaseShape.GetLength(int, DistanceUnit, DistanceCalculationMode); it uses DistanceCalculationMode.Default (localized UTM). The shape's coordinates are treated as being in , reprojected into the shape's local UTM zone and measured there, reducing the scale distortion that may be present in the storage projection. Local UTM measurement remains an approximation. For a MultilineShape the length is the sum of all of its lines.
GetLength(int, DistanceUnit, DistanceCalculationMode)¶
Returns the length of this line shape as a real-world, on-the-ground distance.
public double GetLength(int shapeSrid, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
shapeSrid int
The SRID (EPSG code) of the coordinate system the shape's vertices are currently in.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
Unlike LineBaseShape.GetLength(GeographyUnit, DistanceUnit), this overload does not measure the shape in its own (possibly distorted) coordinate system. It treats the coordinates as being in the coordinate system identified by , reprojects internally to estimate ground distance while reducing scale distortion from the storage projection (for example Spherical/Web Mercator, whose scale grows toward the poles). selects how the ground distance is measured:
DistanceCalculationMode.Haversine - reprojects to decimal degrees and sums the great-circle (spherical) distance of each segment; best for long, global spans.
DistanceCalculationMode.Default / DistanceCalculationMode.LocalizedUtmZone - reproject into the shape's localized UTM zone (meters) and measure there; this generally provides low local scale distortion for shapes within a single region, but remains an approximation. Default and LocalizedUtmZone are equivalent.
For a MultilineShape the length is the sum of all of its lines.
GetLength(string, DistanceUnit, DistanceCalculationMode)¶
Returns the length of this line shape as a real-world, on-the-ground distance.
public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
shapeProj4ProjectionParameters string
The PROJ.4 parameter string of the coordinate system the shape's vertices are currently in.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
Unlike LineBaseShape.GetLength(GeographyUnit, DistanceUnit), this overload does not measure the shape in its own (possibly distorted) coordinate system. It treats the coordinates as being in the coordinate system described by , reprojects internally to estimate ground distance while reducing scale distortion from the storage projection (for example Spherical/Web Mercator, whose scale grows toward the poles). selects how the ground distance is measured:
DistanceCalculationMode.Haversine - reprojects to decimal degrees and sums the great-circle (spherical) distance of each segment; best for long, global spans.
DistanceCalculationMode.Default / DistanceCalculationMode.LocalizedUtmZone - reproject into the shape's localized UTM zone (meters) and measure there; this generally provides low local scale distortion for shapes within a single region, but remains an approximation. Default and LocalizedUtmZone are equivalent.
For a MultilineShape the length is the sum of all of its lines.
GetLength(Projection, DistanceUnit, DistanceCalculationMode)¶
Returns the length of this line shape as a real-world, on-the-ground distance.
public double GetLength(Projection shapeProjection, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in.
returningUnit DistanceUnit
The DistanceUnit the result is returned in. For example, choose Miles to get the length in miles.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
Unlike LineBaseShape.GetLength(GeographyUnit, DistanceUnit), this overload does not measure the shape in its own (possibly distorted) coordinate system. It treats the coordinates as being in and reprojects internally to estimate ground distance while reducing scale distortion from the storage projection (for example Spherical/Web Mercator, whose scale grows toward the poles). selects how the ground distance is measured:
DistanceCalculationMode.Haversine - reprojects to decimal degrees and sums the great-circle (spherical) distance of each segment; best for long, global spans.
DistanceCalculationMode.Default / DistanceCalculationMode.LocalizedUtmZone - reproject into the shape's localized UTM zone (meters) and measure there; this generally provides low local scale distortion for shapes within a single region, but remains an approximation. Default and LocalizedUtmZone are equivalent.
For a MultilineShape the length is the sum of all of its lines.
GetLengthCore(Projection, DistanceUnit, DistanceCalculationMode)¶
Provides the overridable implementation that returns the length of this line shape as a real-world, on-the-ground distance.
protected double GetLengthCore(Projection shapeProjection, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in.
returningUnit DistanceUnit
The DistanceUnit the result is returned in.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
double
The length of the line, expressed in .
Exceptions¶
ArgumentOutOfRangeException
If you pass in a returningUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
Remarks:
This is the Core implementation behind the LineBaseShape.GetLength(int, DistanceUnit, DistanceCalculationMode) family. It treats the shape's coordinates as being in , reprojects, and estimates ground distance while reducing scale distortion from the storage projection. selects how:
DistanceCalculationMode.Haversine reprojects to decimal degrees and sums the great-circle distance of each segment;
DistanceCalculationMode.Default / DistanceCalculationMode.LocalizedUtmZone reproject into the shape's localized UTM zone (meters) and measure the planar length there (the two are equivalent).
Overriding: validate the parameters being passed in and raise the exceptions defined above.
GetLineOnALine(StartingPoint, double, double, Projection, DistanceUnit)¶
Returns the part of this line that starts and ends at the given real-world, on-the-ground distances along it, measured in the shape's localized UTM zone.
public LineBaseShape GetLineOnALine(StartingPoint startingPoint, double startingDistance, double distance, Projection shapeProjection, DistanceUnit distanceUnit)
Parameters¶
startingPoint StartingPoint
The startingPoint defines whether the method starts at the beginning or the end of the line.
startingDistance double
The ground distance from the startingPoint at which the returned line starts, in .
distance double
The ground length of the returned line, in .
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in.
distanceUnit DistanceUnit
The DistanceUnit of startingDistance and distance. For example, choose Miles to give them in miles.
Returns¶
LineBaseShape
The part of the line between the two distances, in the shape's own coordinate system.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a startingPoint that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid startingDistance or distance which is less than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has less than two points, it will throw an InvalidOperationException.
Remarks:
This is the five-parameter form of LineBaseShape.GetLineOnALine(StartingPoint, double, double, Projection, DistanceUnit, DistanceCalculationMode); it uses DistanceCalculationMode.Default (localized UTM). The shape's coordinates are treated as being in ; the distances are measured on the ground the same way LineBaseShape.GetLength(GeographyUnit, DistanceUnit) measures them. The returned line stays in the shape's own coordinate system.
GetLineOnALine(StartingPoint, double, double, Projection, DistanceUnit, DistanceCalculationMode)¶
Returns the part of this line that starts and ends at the given real-world, on-the-ground distances along it.
public LineBaseShape GetLineOnALine(StartingPoint startingPoint, double startingDistance, double distance, Projection shapeProjection, DistanceUnit distanceUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
startingPoint StartingPoint
The startingPoint defines whether the method starts at the beginning or the end of the line.
startingDistance double
The ground distance from the startingPoint at which the returned line starts, in .
distance double
The ground length of the returned line, in .
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in.
distanceUnit DistanceUnit
The DistanceUnit of startingDistance and distance. For example, choose Miles to give them in miles.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
LineBaseShape
The part of the line between the two distances, in the shape's own coordinate system.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a startingPoint that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid startingDistance or distance which is less than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has less than two points, it will throw an InvalidOperationException.
Remarks:
Unlike GetLineOnALine(StartingPoint, double, double, GeographyUnit, DistanceUnit), this overload does not measure the distances in the shape's own (possibly distorted) coordinate system. It treats the coordinates as being in and measures the distances on the ground the same way LineBaseShape.GetLength(int, DistanceUnit, DistanceCalculationMode) does, so the returned line's GetLength with the same projection and mode is . selects how the ground distance is measured:
DistanceCalculationMode.Haversine - great-circle (spherical) distance of each segment.
DistanceCalculationMode.Default / DistanceCalculationMode.LocalizedUtmZone - planar distance in the shape's localized UTM zone. Default and LocalizedUtmZone are equivalent.
The returned line stays in the shape's own coordinate system: its inner vertices are the shape's own vertices, and its two ends lie on the shape's segments. For a MultilineShape the distances run through its lines in order, as with the GeographyUnit overload.
GetLineOnALineCore(StartingPoint, double, double, Projection, DistanceUnit, DistanceCalculationMode)¶
Provides the overridable implementation that returns the part of this line that starts and ends at the given real-world, on-the-ground distances along it.
protected LineBaseShape GetLineOnALineCore(StartingPoint startingPoint, double startingDistance, double distance, Projection shapeProjection, DistanceUnit distanceUnit, DistanceCalculationMode distanceCalculationMode)
Parameters¶
startingPoint StartingPoint
The startingPoint defines whether the method starts at the beginning or the end of the line.
startingDistance double
The ground distance from the startingPoint at which the returned line starts, in .
distance double
The ground length of the returned line, in .
shapeProjection Projection
The projection describing the coordinate system the shape's vertices are currently in.
distanceUnit DistanceUnit
The DistanceUnit of startingDistance and distance.
distanceCalculationMode DistanceCalculationMode
Selects how the ground distance is computed: Haversine great-circle, or localized UTM planar.
Returns¶
LineBaseShape
The part of the line between the two distances, in the shape's own coordinate system.
Exceptions¶
ArgumentOutOfRangeException
If you pass in a startingPoint that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid startingDistance or distance which is less than 0 will throw an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
If you pass in a distanceUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.
InvalidOperationException
In the event you attempt to call this method on a shape which has less than two points, it will throw an InvalidOperationException.
Remarks:
This is the Core implementation behind the LineBaseShape.GetLineOnALine(StartingPoint, double, double, Projection, DistanceUnit, DistanceCalculationMode) family. It measures each segment on the ground the same way does, finds where the two ground distances fall on the shape's own segments, and cuts the shape there in its own coordinate system, so the inner vertices are copied unchanged.
Overriding: validate the parameters being passed in and raise the exceptions defined above.
ConvexHull()¶
This method returns the convex hull of the shape defined as the smallest convex ring that contains all the points in the shape.
public RingShape ConvexHull()
Returns¶
This method returns a RingShape defined as the smallest convex ring that contains
all the points in the shape.
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 is useful when you want to create a perimeter around the shape. For example if you had a MultiPolygon which represented buildings in a campus you could easily get the convex hull of the buildings and determine the perimeter of all of the buildings together. This also works with MultiPoint shapes where each point may represent a certain type of person you are doing statistics on. With convex hull you can get an idea of the regions those points are located in.
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 your needs. If you have questions about this please contact support as we would be happy to work with you on extending our framework.
ConvexHullCore()¶
This method returns the convex hull of the shape defined as the smallest convex ring that contains all the points in the shape.
protected RingShape ConvexHullCore()
Returns¶
This method returns a RingShape defined as the smallest convex ring that contains
all the points in the shape.
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 is useful when you want to create a perimeter around the shape. For example, if you had a MultiPolygon that represented buildings on a campus, you could easily get the convex hull of the buildings and determine the perimeter of all of the buildings together. This also works with MultiPoint shapes, where each point may represent a certain type of person you are doing statistics on. With convex hull, you can get an idea of the regions those points are located in.
Simplify(LineBaseShape, GeographyUnit, double, DistanceUnit, SimplificationType)¶
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
public static MultilineShape Simplify(LineBaseShape targetShape, GeographyUnit targetShapeUnit, double tolerance, DistanceUnit toleranceUnit, SimplificationType simplificationType)
Parameters¶
targetShape LineBaseShape
target shape which will be simplified.
targetShapeUnit GeographyUnit
the geography unit of the target shape
tolerance double
distance tolerance
toleranceUnit DistanceUnit
the distance unit of tolerance
simplificationType SimplificationType
Specifies which algorthm will be use to simplify.
Returns¶
MultilineShape
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
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 tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid simplificationType will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid shapeUnit will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid toleranceUnit will thrown an ArgumentOutOfRangeException.
Simplify(LineBaseShape, double, SimplificationType)¶
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
public static MultilineShape Simplify(LineBaseShape targetShape, double tolerance, SimplificationType simplificationType)
Parameters¶
targetShape LineBaseShape
target shape which will be simplified.
tolerance double
distance tolerance
simplificationType SimplificationType
Specifies which algorthm will be use to simplify.
Returns¶
MultilineShape
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
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 tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid simplificationType will thrown an ArgumentOutOfRangeException.
Simplify(GeographyUnit, double, DistanceUnit, SimplificationType)¶
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
public MultilineShape Simplify(GeographyUnit shapeUnit, double tolerance, DistanceUnit toleranceUnit, SimplificationType simplificationType)
Parameters¶
shapeUnit GeographyUnit
the geography unit of the target shape
tolerance double
distance tolerance
toleranceUnit DistanceUnit
the distance unit of tolerance
simplificationType SimplificationType
Specifies which algorthm will be use to simplify.
Returns¶
MultilineShape
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
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 tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid simplificationType will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid shapeUnit will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid toleranceUnit will thrown an ArgumentOutOfRangeException.
Simplify(double, SimplificationType)¶
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
public MultilineShape Simplify(double tolerance, SimplificationType simplificationType)
Parameters¶
tolerance double
distance tolerance
simplificationType SimplificationType
Specifies which algorthm will be use to simplify.
Returns¶
MultilineShape
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
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 tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid simplificationType will thrown an ArgumentOutOfRangeException.
SimplifyCore(double, SimplificationType)¶
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
protected MultilineShape SimplifyCore(double tolerance, SimplificationType simplificationType)
Parameters¶
tolerance double
distance tolerance
simplificationType SimplificationType
Specifies which algorthm will be use to simplify.
Returns¶
MultilineShape
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
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 tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid simplificationType will thrown an ArgumentOutOfRangeException.
Union(LineBaseShape)¶
Calculates a new geometry that contains all the points in this LineBaseShape and input LineBaseShape
public MultilineShape Union(LineBaseShape targetShape)
Parameters¶
targetShape LineBaseShape
The target LineBasheShape with which to compute the union
Returns¶
MultilineShape
A set combining the points of this LineBaseShape and the points of input LineBaseShape.
Union(IEnumerable<LineBaseShape>)¶
Calculates a new geometry that contains all the points in this LineBaseShape and input LineBaseShape set.
public static MultilineShape Union(IEnumerable<LineBaseShape> lineBaseShapes)
Parameters¶
lineBaseShapes IEnumerable<LineBaseShape>
Specifies the lineBaseShapes.
Returns¶
MultilineShape
A set combining the points of this LineBaseShape and the points of input LineBaseShape set.
Union(Feature)¶
Performs union.
public MultilineShape Union(Feature targetFeature)
Parameters¶
targetFeature Feature
The target feature.
Returns¶
MultilineShape
The result of the operation.
Union(IEnumerable<Feature>)¶
Performs union.
public static MultilineShape Union(IEnumerable<Feature> targetFeatures)
Parameters¶
targetFeatures IEnumerable<Feature>
The target features.
Returns¶
MultilineShape
The result of the operation.
UnionCore(IEnumerable<LineBaseShape>)¶
The protected virtual method used by "Union" that you can overwrite to implement your own logic.
protected MultilineShape UnionCore(IEnumerable<LineBaseShape> lineBaseShapes)
Parameters¶
lineBaseShapes IEnumerable<LineBaseShape>
The target LineBasheShape set with which to compute the union
Returns¶
MultilineShape
A set combining the points of this LineBaseShape and the points of input LineBaseShape set.
GetIntersection(Feature)¶
Returns intersection for .
public MultilineShape GetIntersection(Feature targetFeature)
Parameters¶
targetFeature Feature
The target feature.
Returns¶
MultilineShape
The result of the operation.
GetIntersection(AreaBaseShape)¶
Returns intersection for .
public MultilineShape GetIntersection(AreaBaseShape targetShape)
Parameters¶
targetShape AreaBaseShape
The target shape.
Returns¶
MultilineShape
The result of the operation.
GetIntersectionCore(AreaBaseShape)¶
Provides the overridable implementation that returns intersection for .
protected MultilineShape GetIntersectionCore(AreaBaseShape targetShape)
Parameters¶
targetShape AreaBaseShape
The target shape.
Returns¶
MultilineShape
The result of the operation.
A(Vertex, Vertex, PointShape)¶
internal static bool A(Vertex , Vertex , PointShape )
Parameters¶
`` Vertex
`` Vertex
`` PointShape
Returns¶
Snap(IEnumerable<LineBaseShape>, GeographyUnit, double, DistanceUnit)¶
Simplify the LineShapes by snapping vertexes based on specified tolerance distance.
public static Collection<LineShape> Snap(IEnumerable<LineBaseShape> shapes, GeographyUnit shapeUnit, double snappingTolerance, DistanceUnit toleranceUnit)
Parameters¶
shapes IEnumerable<LineBaseShape>
target shapes which will be simplified
shapeUnit GeographyUnit
the geography unit of the target shapes
snappingTolerance double
distance tolerance
toleranceUnit DistanceUnit
the distance unit of tolerance
Returns¶
Collection<LineShape>
Simplified lineshape depends on distance tolerance of each vertexes.
Exceptions¶
InvalidOperationException
In the event you attempt to call this method on an empty ineBaseShapes collection, it will throw an InvalidOperationException.
ArgumentOutOfRangeException
Passing an invalid tolerance which is less than 0 will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid shapeUnit will thrown an ArgumentOutOfRangeException.
ArgumentOutOfRangeException
Passing an invalid toleranceUnit will thrown an ArgumentOutOfRangeException.