• Documentation
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Search Results for

    Show / Hide Table of Contents
    • Mars.Components
      • DependencyRegistrationModelling
    • Mars.Components.Agents
      • AbstractAgent
      • AbstractEntity
      • Agent
    • Mars.Components.Environments
      • AbstractEnvironment
      • AbstractGraphElement
      • AlwaysPassingNodeGuard
      • EntityLane<TEntity>
      • GeoEnvironment
      • GeoHashEnvironment<T>
      • IEnvironmentMediator
      • IModalChoiceResolver
      • PathHeuristics
      • SpatialEdge
      • SpatialGraphEntityExtensions
      • SpatialGraphEnvironment
      • SpatialGraphHelper
      • SpatialHashEnvironment<TEntity>
      • SpatialLane
      • SpatialNode
    • Mars.Components.Environments.Cartesian
      • CartesianEnvironment<TEntity>
      • CollisionEnvironment<TCharacter, TObstacle>
      • CollisionKind
      • ConeExplorationView
      • ExplorationView
      • GeometryFactory
      • ICartesianEnvironment<TEntity>
      • ICharacter
      • ICollidable
      • ICollisionEnvironment<TCharacter, TObstacle>
      • IObstacle
      • IVisible
      • RayExplorationView
      • TrapezoidExploration
      • VisibilityKind
    • Mars.Components.Environments.Cartesian.Routing
      • CartesianRoutingService<TObstacle>
      • GeometryCoordinatesRoutingPointsGenerator
      • HomogenousRoutingPointsGenerator
      • IRoutingPointsGenerator
      • RandomRoutingPointsGenerator
      • SectionalRandomRoutingPointsGenerator
    • Mars.Components.Layers
      • AbstractActiveLayer
      • AbstractDataLayer
      • AbstractLayer
      • AgentSchedulerLayer<TAgent, TLayer>
      • BoundDataSet
      • DisposeBase
      • MatrixRaster
      • QuerySourceLoader
      • Raster
      • Raster<TValue>
      • RasterLayer
      • SchedulerEntry
      • SchedulerLayer
      • VectorFeature
      • VectorLayer
      • VectorLayer<T>
      • VectorLayerHelper
    • Mars.Components.Layers.Temporal
      • IQueryFieldProvider
      • ITemporalObjectCatalog
      • ITemporalObjectIterator
      • TemporalCatalogFeature<TKey>
      • TemporalFeatureKind
      • TemporalMetadataLoader
    • Mars.Components.Services
      • AgentManager
    • Mars.Components.Services.Explorations
      • BoltzmannExploration
      • EpsilonGreedyExploration
      • IExplorationPolicy
      • RouletteWheelExploration
      • TabuSearchExploration
    • Mars.Components.Services.Learning
      • InfiniteQLearning
      • QLearning
      • Sarsa
    • Mars.Components.Services.Planning
      • ActionPlanResult
      • GoapAction
      • GoapAgentStates
      • GoapGoal
      • GoapPlanner
      • GoapStateKey<T>
      • GoapStateProperty
      • GoapStateProperty<TElement>
      • IGoapAction
      • IGoapAgentStates
      • IGoapGoal
      • IGoapPlanner
      • IGoapStateKey
      • StatesCommons
    • Mars.Components.Services.Planning.ActionCommons
      • AllGoalsSatisfiedAction
      • NoGoalReachableAction
    • Mars.Components.Starter
      • Command
      • CommandArgumentContainer
      • CommandParser
      • CommandSet
      • HelpCommand
      • Option
      • OptionContext
      • OptionException
      • OptionSet
      • OptionValueCollection
      • OptionValueType
      • SimulationStarter
    • Mars.Components.Starter.Exceptions
      • SimulationStartupException
    • Mars.Interfaces
      • IModelObject
      • ISimulationContainer
      • ISimulationContext
      • ISimulationModule
      • ISimulationState
      • IStepExecutionContext
      • SimulationContext
      • SimulationContext.WorkflowStateType
      • StepExecutionContext
    • Mars.Interfaces.Agents
      • IAgent
      • IAgent<TLayer>
      • IEntity
      • IMarsDslAgent
      • IModalCapabilitiesAgent
      • ISpatialGraphEntity
      • ITickClient
    • Mars.Interfaces.Annotations
      • ActiveConstructor
      • PropertyDescription
    • Mars.Interfaces.Data
      • AbstractDomainData
      • GeometryData
      • IDomainData
      • IGeometryData
      • IIdentifiableData
      • IMarsFeature
      • IRasterBandData
      • ISource
      • IStringData
      • IStringStructuredData
      • IStructuredData
      • IStructuredDataGeometry
      • IValueData
      • LayerInitData
      • RasterBandData
      • StringDataDto
      • StructuredData
      • VectorStructuredData
    • Mars.Interfaces.Environments
      • BoundingBox
      • DirectionType
      • EdgeExploreResult
      • EdgeStop
      • ExploreDirection
      • GeoPositionExtension
      • HighwayType
      • IEdge<TEdge, TNode>
      • IEntityLane<TEntity>
      • IEnvironment
      • IEnvironment<TEntity>
      • IGeoGridEnvironment<T>
      • IGraphEntity
      • IGraphEnvironment<TEdge, TNode>
      • INode<TEdge, TNode>
      • INodeGuard
      • IPositionable
      • IRoutePlanner
      • ISpatialEdge
      • ISpatialGraphEnvironment
      • ISpatialLane
      • ISpatialNode
      • LaneExploreResult
      • ModalChoice
      • MultimodalRoute
      • NodeIntegrationKind
      • Position
      • Route
      • RouteStop
      • Size
      • SpatialGraphExploreResult
      • SpatialModalityType
      • TrafficLightPhase
    • Mars.Interfaces.Layers
      • FinallySimulationStep
      • IBoundedDataLayer
      • IChangingLayer
      • IDataContainer
      • IDataLayer
      • IDataSet
      • ILayer
      • IMarsDslLayer
      • IModalChoiceConsumer
      • InitSimulationStep
      • INotifyChangedSource<T>
      • IRaster
      • IRaster<TValue>
      • IRasterLayer
      • ISteppedActiveLayer
      • IVectorFeature
      • IVectorLayer
      • IVectorLayer<T>
      • IVectorNode<TEntity>
      • RegisterAgent
      • UnregisterAgent
    • Mars.Interfaces.Model
      • ActiveTypeMapping
      • AgentMapping
      • AgentType
      • ConstructorType
      • ContainsOperator
      • DataContainer
      • DataType
      • EntityMapping
      • EntityType
      • Execution
      • FeatureType
      • Globals
      • IdentifiableElement
      • IndividualMapping
      • Input
      • InputConfiguration
      • LayerMapping
      • LayerType
      • ModelDescription
      • ModelElement
      • ObjectType
      • Output
      • OutputConfiguration
      • OutputFilter
      • OutputKind
      • OutputTargetType
      • ParameterMapping
      • Processing
      • ProcessingConfiguration
      • ProcessingTargetType
      • PropertyType
      • SimulationConfig
      • TimeSpanUnit
      • TimeSpanUnitExtensions
      • TypeElement
      • TypeMapping
    • Mars.Interfaces.Model.Converters
      • CultureConverter
      • SerializationTypeConverter
      • TimeSpanUnitConverter
    • Mars.Interfaces.Model.Exceptions
      • InvalidTypeException
      • MissingTypeException
    • Mars.Interfaces.Model.Options
      • AbstractEndpointOptions
      • AbstractFileOptions
      • AbstractOptions
      • AscOptions
      • CsvOptions
      • GeoJsonOptions
      • MongoOptions
      • MqttOptions
      • PostgresSqlOptions
      • RedisOptions
      • RelationalEndpointOptions
      • SerializationType
      • SocketOutputOptions
      • SpatialGraphOptions
      • SqLiteOptions
      • TripsOptions

    Class BoundingBox

    Represents a bounding box with lower-left and upper-right coordinate.
    Inheritance
    System.Object
    BoundingBox
    Implements
    System.IComparable<BoundingBox>
    IIntersectable<BoundingBox>
    IExpandable<BoundingBox>
    System.IEquatable<BoundingBox>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Mars.Interfaces.Environments
    Assembly: Mars.Interfaces.dll
    Syntax
    public class BoundingBox : IComparable<BoundingBox>, IEquatable<BoundingBox>

    Constructors

    BoundingBox()

    Creates a null Envelope.
    Declaration
    public BoundingBox()

    BoundingBox(Envelope)

    Create an Envelope from an existing .
    Declaration
    public BoundingBox(Envelope env)
    Parameters
    Type Name Description
    Envelope env The Envelope to initialize from.

    BoundingBox(BoundingBox)

    Create an Envelope from an existing bounding box.
    Declaration
    public BoundingBox(BoundingBox env)
    Parameters
    Type Name Description
    BoundingBox env The Envelope to initialize from.

    BoundingBox(Position)

    Creates an Envelope for a region defined by a single Coordinate.
    Declaration
    public BoundingBox(Position p)
    Parameters
    Type Name Description
    Position p The Coordinate.

    BoundingBox(Position, Position)

    Creates a new BoundingBox with the lower left and upper right corner to span out the box.
    Declaration
    public BoundingBox(Position lowerLeft, Position upperRight)
    Parameters
    Type Name Description
    Position lowerLeft The lower left corner of the box (minX/Lon, minY/Lat).
    Position upperRight The upper right corner of the box (maxX/Lon, maxY/Lat).

    BoundingBox(Double, Double)

    Creates an Envelope for a region defined by a single Coordinate.
    Declaration
    public BoundingBox(double x, double y)
    Parameters
    Type Name Description
    System.Double x The x coordinate component.
    System.Double y The y coordinate component.

    BoundingBox(Double, Double, Double)

    Creates an Envelope for a region defined by a single coordinate and expand it to the given distance.
    Declaration
    public BoundingBox(double x, double y, double distance)
    Parameters
    Type Name Description
    System.Double x The x coordinate component.
    System.Double y The y coordinate component.
    System.Double distance The distance to expand to.

    BoundingBox(Double, Double, Double, Double)

    Creates an Envelope for a region defined by maximum and minimum values.
    Declaration
    public BoundingBox(double minX, double minY, double maxX, double maxY)
    Parameters
    Type Name Description
    System.Double minX The first x-value.
    System.Double minY The first y-value.
    System.Double maxX The second x-value.
    System.Double maxY The second y-value.

    Properties

    Area

    Gets the area of this envelope.
    Declaration
    public double Area { get; }
    Property Value
    Type Description
    System.Double The area of the envelope, or 0.0 if envelope is null

    Centre

    Computes the coordinate of the centre of this envelope (as long as it is non-null).
    Declaration
    public Position Centre { get; }
    Property Value
    Type Description
    Position The centre coordinate of this envelope, or null if the envelope is null.

    Diameter

    Gets the length of the diameter (diagonal) of the envelope.
    Declaration
    public double Diameter { get; }
    Property Value
    Type Description
    System.Double The diameter length

    Height

    Returns the difference between the maximum and minimum y values.
    Declaration
    public double Height { get; }
    Property Value
    Type Description
    System.Double max y - min y, or 0 if this is a null Envelope.

    IsNull

    Returns true if this Envelope is a "null" envelope.
    Declaration
    public bool IsNull { get; }
    Property Value
    Type Description
    System.Boolean true if this Envelope is uninitialized or is the envelope of the empty point.

    LowerLeft

    Gets the lower right corner coordinate of this box.
    Declaration
    public Position LowerLeft { get; }
    Property Value
    Type Description
    Position

    LowerRight

    Gets the lower right corner coordinate of this box.
    Declaration
    public Position LowerRight { get; }
    Property Value
    Type Description
    Position

    MaxX

    Returns the Envelopes maximum x-value. min x > max x indicates that this is a null Envelope.
    Declaration
    public double MaxX { get; set; }
    Property Value
    Type Description
    System.Double The maximum x-coordinate.

    MaxY

    Returns the Envelopes maximum y-value. min y > max y indicates that this is a null Envelope.
    Declaration
    public double MaxY { get; set; }
    Property Value
    Type Description
    System.Double The maximum y-coordinate.

    Midpoint

    Gets the central coordinate of this box.
    Declaration
    public Position Midpoint { get; }
    Property Value
    Type Description
    Position

    MinX

    Returns the Envelopes minimum x-value. min x > max x indicates that this is a null Envelope.
    Declaration
    public double MinX { get; set; }
    Property Value
    Type Description
    System.Double The minimum x-coordinate.

    MinY

    Returns the Envelopes minimum y-value. min y > max y indicates that this is a null Envelope.
    Declaration
    public double MinY { get; set; }
    Property Value
    Type Description
    System.Double The minimum y-coordinate.

    UpperLeft

    Gets the upper left corner coordinate of this box.
    Declaration
    public Position UpperLeft { get; }
    Property Value
    Type Description
    Position

    UpperRight

    Gets the upper right corner coordinate of this box.
    Declaration
    public Position UpperRight { get; }
    Property Value
    Type Description
    Position

    Width

    Returns the difference between the maximum and minimum x values.
    Declaration
    public double Width { get; }
    Property Value
    Type Description
    System.Double max x - min x, or 0 if this is a null Envelope.

    Methods

    CompareTo(BoundingBox)

    Compares two bounding boxes using lexicographic ordering. The ordering comparison is based on the usual numerical comparison between the sequence of ordinates. Null envelopes are less than all non-null envelopes.
    Declaration
    public int CompareTo(BoundingBox env)
    Parameters
    Type Name Description
    BoundingBox env An envelope
    Returns
    Type Description
    System.Int32

    Contains(Coordinate)

    Tests if the given point lies in or on the envelope.
    Declaration
    public bool Contains(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p the point which this Envelope is being checked for containing
    Returns
    Type Description
    System.Boolean true if the point lies in the interior or on the boundary of this Envelope.
    Remarks
    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    Contains(BoundingBox)

    Tests if the Envelope other lies completely inside this bounding box (inclusive of the boundary).
    Declaration
    public bool Contains(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other
    Returns
    Type Description
    System.Boolean true if other is contained in this Envelope
    Remarks
    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    Contains(Double, Double)

    Tests if the given point lies in or on the envelope.
    Declaration
    public bool Contains(double x, double y)
    Parameters
    Type Name Description
    System.Double x the x-coordinate of the point which this Envelope is being checked for containing
    System.Double y the y-coordinate of the point which this Envelope is being checked for containing
    Returns
    Type Description
    System.Boolean true if (x, y) lies in the interior or on the boundary of this Envelope.
    Remarks
    Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

    Copy()

    Creates a deep copy of the current envelope.
    Declaration
    public BoundingBox Copy()
    Returns
    Type Description
    BoundingBox

    CreateGeoBoundingBox(Double, Double, Double, Double)

    Declaration
    public static BoundingBox CreateGeoBoundingBox(double longitude, double latitude, double distanceLongitude, double distanceLatitude)
    Parameters
    Type Name Description
    System.Double longitude
    System.Double latitude
    System.Double distanceLongitude
    System.Double distanceLatitude
    Returns
    Type Description
    BoundingBox

    Disjoint(BoundingBox)

    Tests if the region defined by other is disjoint from the region of this Envelope.
    Declaration
    public bool Disjoint(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other The Envelope being checked for disjointness
    Returns
    Type Description
    System.Boolean true if the Envelopes are disjoint
    See Also
    Intersects(BoundingBox)

    Distance(BoundingBox)

    Computes the distance between this and another Envelope. The distance between overlapping Envelopes is 0. Otherwise, the distance is the Euclidean distance between the closest points.
    Declaration
    public double Distance(BoundingBox env)
    Parameters
    Type Name Description
    BoundingBox env
    Returns
    Type Description
    System.Double The distance between this and another BoundingBox.

    Equals(BoundingBox)

    Declaration
    public bool Equals(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    System.Object o
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)

    ExpandBy(Double)

    Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
    Declaration
    public void ExpandBy(double distance)
    Parameters
    Type Name Description
    System.Double distance The distance to expand the envelope.

    ExpandBy(Double, Double)

    Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
    Declaration
    public BoundingBox ExpandBy(double deltaX, double deltaY)
    Parameters
    Type Name Description
    System.Double deltaX The distance to expand the envelope along the the X axis.
    System.Double deltaY The distance to expand the envelope along the the Y axis.
    Returns
    Type Description
    BoundingBox

    ExpandedBy(BoundingBox)

    Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.
    Declaration
    public BoundingBox ExpandedBy(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other the Envelope to expand to include.
    Returns
    Type Description
    BoundingBox

    ExpandToInclude(Envelope)

    Declaration
    public void ExpandToInclude(Envelope envelope)
    Parameters
    Type Name Description
    Envelope envelope

    ExpandToInclude(BoundingBox)

    Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.
    Declaration
    public void ExpandToInclude(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other the Envelope to expand to include.

    ExpandToInclude(Double, Double)

    Enlarges this Envelope so that it contains the given .
    Declaration
    public void ExpandToInclude(double x, double y)
    Parameters
    Type Name Description
    System.Double x The value to lower the minimum x to or to raise the maximum x to.
    System.Double y The value to lower the minimum y to or to raise the maximum y to.
    Remarks
    Has no effect if the point is already on or within the envelope.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    Init()

    Initialize to a null Envelope.
    Declaration
    public void Init()

    Intersection(BoundingBox)

    Computes the intersection of two BoundingBoxs.
    Declaration
    public BoundingBox Intersection(BoundingBox env)
    Parameters
    Type Name Description
    BoundingBox env The envelope to intersect with
    Returns
    Type Description
    BoundingBox A new Envelope representing the intersection of the envelopes (this will be the null envelope if either argument is null, or they do not intersect

    Intersects(BoundingBox)

    Check if the region defined by other intersects the region of this Envelope.
    Declaration
    public bool Intersects(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other The Envelope which this Envelope is being checked for intersecting.
    Returns
    Type Description
    System.Boolean true if the Envelopes intersect.

    Intersects(Position)

    Check if the position (x, y) overlaps (lies inside) the region of this BoundingBox.
    Declaration
    public bool Intersects(Position position)
    Parameters
    Type Name Description
    Position position that may or may not lie within the bounding box.
    Returns
    Type Description
    System.Boolean true if the position intersects this BoundingBox.

    Intersects(Position, Position)

    Tests if the extent defined by two extremal points intersects the extent of this Envelope.
    Declaration
    public bool Intersects(Position a, Position b)
    Parameters
    Type Name Description
    Position a A point
    Position b Another point
    Returns
    Type Description
    System.Boolean true if the extents intersect

    Intersects(Double, Double)

    Check if the point (x, y) overlaps (lies inside) the region of this Envelope.
    Declaration
    public bool Intersects(double x, double y)
    Parameters
    Type Name Description
    System.Double x the x-ordinate of the point.
    System.Double y the y-ordinate of the point.
    Returns
    Type Description
    System.Boolean true if the point overlaps this Envelope.

    Overlaps(BoundingBox)

    Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).
    Declaration
    public bool Overlaps(BoundingBox other)
    Parameters
    Type Name Description
    BoundingBox other the Envelope to check
    Returns
    Type Description
    System.Boolean true if this Envelope covers the other

    Overlaps(Double, Double)

    Tests if the given point lies in or on the envelope.
    Declaration
    public bool Overlaps(double x, double y)
    Parameters
    Type Name Description
    System.Double x the x-coordinate of the point which this Envelope is being checked for containing
    System.Double y the y-coordinate of the point which this Envelope is being checked for containing
    Returns
    Type Description
    System.Boolean true if (x, y) lies in the interior or on the boundary of this Envelope.

    Parse(String)

    Method to parse an envelope from its ToString() value
    Declaration
    public static BoundingBox Parse(string envelope)
    Parameters
    Type Name Description
    System.String envelope The envelope string
    Returns
    Type Description
    BoundingBox The envelope

    ToEnvelope()

    Transforms the bounding box to a
    Declaration
    public Envelope ToEnvelope()
    Returns
    Type Description
    Envelope An envelope with the same spatial extent.

    ToString()

    Function to get a textual representation of this envelope
    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String A textual representation of this envelope
    Overrides
    System.Object.ToString()

    Translate(Double, Double)

    Translates this envelope by given amounts in the X and Y direction.
    Declaration
    public void Translate(double transX, double transY)
    Parameters
    Type Name Description
    System.Double transX The amount to translate along the X axis.
    System.Double transY The amount to translate along the Y axis.

    Implements

    System.IComparable<T>
    IIntersectable<>
    IExpandable<>
    System.IEquatable<T>
    In This Article
    Back to top © 2022 MARS GROUP