Table of Contents

Class LineBaseShape

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll

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

MultilineShape

GetIntersection(Feature)

public MultilineShape GetIntersection(Feature targetFeature)

Parameters

targetFeature Feature

Returns

MultilineShape

GetIntersectionCore(AreaBaseShape)

protected virtual MultilineShape GetIntersectionCore(AreaBaseShape targetShape)

Parameters

targetShape AreaBaseShape

Returns

MultilineShape

GetLength(int, DistanceUnit)

public double GetLength(int shapeSrid, DistanceUnit returningUnit)

Parameters

shapeSrid int
returningUnit DistanceUnit

Returns

double

GetLength(int, DistanceUnit, DistanceCalculationMode)

public double GetLength(int shapeSrid, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)

Parameters

shapeSrid int
returningUnit DistanceUnit
distanceCalculationMode DistanceCalculationMode

Returns

double

GetLength(string, DistanceUnit)

public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit)

Parameters

shapeProj4ProjectionParameters string
returningUnit DistanceUnit

Returns

double

GetLength(string, DistanceUnit, DistanceCalculationMode)

public double GetLength(string shapeProj4ProjectionParameters, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)

Parameters

shapeProj4ProjectionParameters string
returningUnit DistanceUnit
distanceCalculationMode DistanceCalculationMode

Returns

double

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

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 Projection
returningUnit DistanceUnit

Returns

double

GetLength(Projection, DistanceUnit, DistanceCalculationMode)

public double GetLength(Projection shapeProjection, DistanceUnit returningUnit, DistanceCalculationMode distanceCalculationMode)

Parameters

shapeProjection Projection
returningUnit DistanceUnit
distanceCalculationMode DistanceCalculationMode

Returns

double

GetLengthCore(GeographyUnit, DistanceUnit)

This method returns the length of the line shape.

protected virtual 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

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 Projection
returningUnit DistanceUnit
distanceCalculationMode DistanceCalculationMode

Returns

double

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.

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 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.

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 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.

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 double

This 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 double

This 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 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.

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 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.

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 double

This 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 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(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(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.

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 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.

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.

Union(IEnumerable<Feature>)

public static MultilineShape Union(IEnumerable<Feature> targetFeatures)

Parameters

targetFeatures IEnumerable<Feature>

Returns

MultilineShape

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

MultilineShape

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.

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.