Class LineBaseShape
This abstract class is the root of all line-based shapes, such as LineShape and MultilineShape.
public abstract class LineBaseShape : BaseShape
- Inheritance
-
LineBaseShape
- Derived
- Inherited Members
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.
Constructors
LineBaseShape()
This is the default constructor for AreaBaseShape.
protected LineBaseShape()
Remarks
This constructor simply calls the base constructor.
Methods
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
- RingShape
This method returns a RingShape defined as the smallest convex ring that contains all the points in the shape.
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.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
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 virtual RingShape ConvexHullCore()
Returns
- RingShape
This method returns a RingShape defined as the smallest convex ring that contains all the points in the shape.
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.
Exceptions
- InvalidOperationException
In the event you attempt to call this method on a shape which has no points, it will throw an InvalidOperationException.
GetIntersection(AreaBaseShape)
public MultilineShape GetIntersection(AreaBaseShape targetShape)
Parameters
targetShape
AreaBaseShape
Returns
GetIntersection(Feature)
public MultilineShape GetIntersection(Feature targetFeature)
Parameters
targetFeature
Feature
Returns
GetIntersectionCore(AreaBaseShape)
protected virtual MultilineShape GetIntersectionCore(AreaBaseShape targetShape)
Parameters
targetShape
AreaBaseShape
Returns
GetLength(int, DistanceUnit)
public double GetLength(int shapeSrid, DistanceUnit returningUnit)
Parameters
shapeSrid
intreturningUnit
DistanceUnit
Returns
GetLength(int, DistanceUnit, DistanceCalculationMode)
public double GetLength(int shapeSrid, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters
shapeSrid
intreturningUnit
DistanceUnitdistanceCalculationMode
DistanceCalculationMode
Returns
GetLength(string, DistanceUnit)
public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit)
Parameters
shapeProj4ProjectionParameters
stringreturningUnit
DistanceUnit
Returns
GetLength(string, DistanceUnit, DistanceCalculationMode)
public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters
shapeProj4ProjectionParameters
stringreturningUnit
DistanceUnitdistanceCalculationMode
DistanceCalculationMode
Returns
GetLength(GeographyUnit, DistanceUnit)
This method returns the length of the line shape.
public double GetLength(GeographyUnit shapeUnit, DistanceUnit returningUnit)
Parameters
shapeUnit
GeographyUnitThis is the GeographyUnit of the shape you are performing the operation on.
returningUnit
DistanceUnitThis 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
- double
This overload returns the length in the unit of your choice, based on the returningUnit parameter specified.
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.
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.
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.
GetLength(Projection, DistanceUnit)
public double GetLength(Projection shapeProjection, DistanceUnit returningUnit)
Parameters
shapeProjection
ProjectionreturningUnit
DistanceUnit
Returns
GetLength(Projection, DistanceUnit, DistanceCalculationMode)
public double GetLength(Projection shapeProjection, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters
shapeProjection
ProjectionreturningUnit
DistanceUnitdistanceCalculationMode
DistanceCalculationMode
Returns
GetLengthCore(GeographyUnit, DistanceUnit)
This method returns the length of the line shape.
protected virtual double GetLengthCore(GeographyUnit shapeUnit, DistanceUnit returningUnit)
Parameters
shapeUnit
GeographyUnitThis is the GeographyUnit of the shape you are performing the operation on.
returningUnit
DistanceUnitThis 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
- double
This overload returns the length in the unit of your choice, based on the returningUnit parameter specified.
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.
Overriding:
Please ensure that you validate the parameters being passed in and raise the exceptions defined
above.
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.
GetLengthCore(Projection, DistanceUnit, DistanceCalculationMode)
protected virtual double GetLengthCore(Projection shapeProjection, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)
Parameters
shapeProjection
ProjectionreturningUnit
DistanceUnitdistanceCalculationMode
DistanceCalculationMode
Returns
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
doubleThis is the percentage by which to decrease the shape�s size.
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.
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.
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
FeatureThis parameter is the basis for the scale up up but is not modified.
percentage
doubleThis is the percentage by which to decrease the shape�s size.
Returns
- Feature
a scaled down line type feature.
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.
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.
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
LineBaseShapeThis parameter is the basis for the scale up up but is not modified.
percentage
doubleThis is the percentage by which to decrease the shape�s size.
Returns
- LineBaseShape
a scaled down line type shape.
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.
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.
ScaleDownCore(double)
This method decreases the size of the LineShape by the percentage given in the percentage parameter.
protected virtual void ScaleDownCore(double percentage)
Parameters
percentage
doubleThis is the percentage by which to decrease the shape�s size.
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.
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.
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
doubleThis is the percentage by which to increase the shape�s size.
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.
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.
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
FeatureThis parameter is the basis for the scale up up but is not modified.
percentage
doubleThis is the percentage by which to increase the shape�s size.
Returns
- Feature
a scaled line type feature.
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.
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.
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
LineBaseShapeThis parameter is the basis for the scale up up but is not modified.
percentage
doubleThis is the percentage by which to increase the shape�s size.
Returns
- LineBaseShape
a scaled line type shape.
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.
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.
ScaleUpCore(double)
This method increases the size of the LineShape by the percentage given in the percentage parameter.
protected virtual void ScaleUpCore(double percentage)
Parameters
percentage
doubleThis is the percentage by which to increase the shape�s size.
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.
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.
Simplify(double, SimplificationType)
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
public MultilineShape Simplify(double tolerance, SimplificationType simplificationType)
Parameters
tolerance
doubledistance tolerance
simplificationType
SimplificationTypeSpecifies 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
GeographyUnitthe geography unit of the target shape
tolerance
doubledistance tolerance
toleranceUnit
DistanceUnitthe distance unit of tolerance
simplificationType
SimplificationTypeSpecifies 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
LineBaseShapetarget shape which will be simplified.
tolerance
doubledistance tolerance
simplificationType
SimplificationTypeSpecifies 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(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
LineBaseShapetarget shape which will be simplified.
targetShapeUnit
GeographyUnitthe geography unit of the target shape
tolerance
doubledistance tolerance
toleranceUnit
DistanceUnitthe distance unit of tolerance
simplificationType
SimplificationTypeSpecifies 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.
SimplifyCore(double, SimplificationType)
Simplify the LineBaseShape to MultilineShape depends on distance tolerance and different SimplificationType.
protected virtual MultilineShape SimplifyCore(double tolerance, SimplificationType simplificationType)
Parameters
tolerance
doubledistance tolerance
simplificationType
SimplificationTypeSpecifies 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.
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
GeographyUnitthe geography unit of the target shapes
snappingTolerance
doubledistance tolerance
toleranceUnit
DistanceUnitthe 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.
Union(IEnumerable<Feature>)
public static MultilineShape Union(IEnumerable<Feature> targetFeatures)
Parameters
targetFeatures
IEnumerable<Feature>
Returns
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>
Returns
- MultilineShape
A set combining the points of this LineBaseShape and the points of input LineBaseShape set.
Union(Feature)
public MultilineShape Union(Feature targetFeature)
Parameters
targetFeature
Feature
Returns
Union(LineBaseShape)
Calculates a new geometry that contains all the points in this LineBaseShape and input LineBaseShape
public MultilineShape Union(LineBaseShape targetShape)
Parameters
targetShape
LineBaseShapeThe target LineBasheShape with which to compute the union
Returns
- MultilineShape
A set combining the points of this LineBaseShape and the points of input LineBaseShape.
UnionCore(IEnumerable<LineBaseShape>)
The protected virtual method used by "Union" that you can overwrite to implement your own logic.
protected virtual 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.