Extents Class Reference

Represents a rectangle on the map. More...

Collaboration diagram for Extents:
Collaboration graph

Public Member Functions

void GetBounds (out double xMin, out double yMin, out double zMin, out double xMax, out double yMax, out double zMax)
 Gets the bounds of the extents object. More...
 
void GetMeasureBounds (out double mMin, out double mMax)
 Gets the minimum and maximum measure bounds for the extents object. More...
 
void MoveTo (double x, double y)
 Moves extents so that center point will be at specified coordinates, while width and height will be preserved. More...
 
bool PointIsWithin (double x, double y)
 Checks whether a point is within extents More...
 
void SetBounds (double xMin, double yMin, double zMin, double xMax, double yMax, double zMax)
 Sets the bounds for the extents object. More...
 
void SetMeasureBounds (double mMin, double mMax)
 Sets the measure bounds of the extents object. More...
 
string ToDebugString ()
 Gets serialized contents of the extents for debug purposes. More...
 
Shape ToShape ()
 Creates a rectangular polygon matching current extents. More...
 

Properties

Point Center [get]
 Gets a center point for the extents. More...
 
double Depth [get]
 Gets the Depth of the extents object (zMax - zMin). More...
 
double Height [get]
 Gets the Height of the extents object (yMax - yMin). More...
 
double mMax [get]
 The maximum measure bound in the exents object. Measure bounds only apply to shapefiles containing measure data. More...
 
double mMin [get]
 Gets the minimum measure bound for the extents object. Measure bounds only apply to shapefiles containing measure data. More...
 
double Width [get]
 Gets the Width of the extents object (xMax - xMin). More...
 
double xMax [get]
 The maximum x bound for the extents object. More...
 
double xMin [get]
 Gets the minimum x bound for the extents object. More...
 
double yMax [get]
 The maximum y bound for the extents object. More...
 
double yMin [get]
 Gets the minimum y bound for the extents object More...
 
double zMax [get]
 The maximum z bound for the extents object. More...
 
double zMin [get]
 Gets the minimum z bound for the extents object. More...
 

Detailed Description

Represents a rectangle on the map.

In some cases additional Z and M dimensions can also be specified to denote the altitude of the displayed data for example.


Let's see how to display certain extents on the map.

double y = 48.7; // latitude, deg.
double x = 2.3; // longitude, deg.
double span = 0.1; // deg.
// extents from 48.5 to 48.9 degrees of north latitude and
// from 2.1 to 2.5 degrees of east longitude will be set
Extents ext = new Extents();
ext.SetBounds(x - span, y - span, 0.0, x + span, y + span, 0.0);
// show them on the map
AxMap axMap;
if (axMap.MapUnits == tkUnitsOfMeasure.umDecimalDegrees){
axMap.Extents = ext;
}

MapWinGIS doesn't hold instances of Extents class for layers or map, but generates them on each client call. Therefore it's useless to try to change those extents in the way like this:

AxMap axMap;
Extents ext = axMap.Extents;
ext.SetBounds(some_bounds); // map won't be updated

The following line is needed:

axMap.Extents = ext;

In case of data layers, like shapefiles or images, the extents are obtained by calculation, so the only way to alter them is to change the underlying data.

Examples:
EditAttributes.cs, ImageLabels.cs, LabelSelection.cs, RemoveShape.cs, Segmentation.cs, SelectBox.cs, ShapefileToDrawingLayer.cs, ToolTip.cs, TrackCars.cs, and Tracking.cs.

Member Function Documentation

◆ GetBounds()

void Extents.GetBounds ( out double  xMin,
out double  yMin,
out double  zMin,
out double  xMax,
out double  yMax,
out double  zMax 
)

Gets the bounds of the extents object.

Parameters
xMinReturns the minimum x value for the extents object.
yMinReturns the minimum y value for the extents object.
zMinReturns the minimum z value for the extents object.
xMaxReturns the maximum x value for the extents object.
yMaxReturns the maximum y value for the extents object.
zMaxReturns the maximum z value for the extents object.

◆ GetMeasureBounds()

void Extents.GetMeasureBounds ( out double  mMin,
out double  mMax 
)

Gets the minimum and maximum measure bounds for the extents object.

Measure bounds only apply to shapefiles containing measure data.

Parameters
mMin
mMax

◆ MoveTo()

void Extents.MoveTo ( double  x,
double  y 
)

Moves extents so that center point will be at specified coordinates, while width and height will be preserved.

Parameters
xX coordinate of new center.
yY coordinate of new center.
New API 4.9.1:
Added in version 4.9.1

◆ PointIsWithin()

bool Extents.PointIsWithin ( double  x,
double  y 
)

Checks whether a point is within extents

Parameters
xX coordinate of point
yY coordinate of point
Returns
True if point is within extents
New API 4.9.1:
Added in version 4.9.1

◆ SetBounds()

void Extents.SetBounds ( double  xMin,
double  yMin,
double  zMin,
double  xMax,
double  yMax,
double  zMax 
)

Sets the bounds for the extents object.

Parameters
xMinThe new minimum x value for the bounds of the extents object.
yMinThe new minimum y value for the bounds of the extents object.
zMinThe new minimum z value for the bounds of the extents object.
xMaxThe new maximum x value for the bounds of the extents object.
yMaxThe new maximum y value for the bounds of the extents object.
zMaxThe new maximum z value for the bounds of the extents object.
Examples:
EditAttributes.cs, RemoveShape.cs, and Tracking.cs.

◆ SetMeasureBounds()

void Extents.SetMeasureBounds ( double  mMin,
double  mMax 
)

Sets the measure bounds of the extents object.

Measure bounds only apply to shapefiles containing measure data.

Parameters
mMinThe new minimum measure bound for the extents object.
mMaxThe new maximum measure bound for the extents object.

◆ ToDebugString()

string Extents.ToDebugString ( )

Gets serialized contents of the extents for debug purposes.

Returns
Serialized string.
New API 4.9.1:
Added in version 4.9.1
Examples:
CreatePolygonShapefile.cs.

◆ ToShape()

Shape Extents.ToShape ( )

Creates a rectangular polygon matching current extents.

Returns
New polygon shape.
New API 4.9.1:
Added in version 4.9.1

Property Documentation

◆ Center

Point Extents.Center
get

Gets a center point for the extents.

New API 4.9.1:
Added in version 4.9.1

◆ Depth

double Extents.Depth
get

Gets the Depth of the extents object (zMax - zMin).

◆ Height

double Extents.Height
get

Gets the Height of the extents object (yMax - yMin).

◆ mMax

double Extents.mMax
get

The maximum measure bound in the exents object. Measure bounds only apply to shapefiles containing measure data.

◆ mMin

double Extents.mMin
get

Gets the minimum measure bound for the extents object. Measure bounds only apply to shapefiles containing measure data.

◆ Width

double Extents.Width
get

Gets the Width of the extents object (xMax - xMin).

◆ xMax

double Extents.xMax
get

The maximum x bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.

◆ xMin

double Extents.xMin
get

Gets the minimum x bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.

◆ yMax

double Extents.yMax
get

The maximum y bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.

◆ yMin

double Extents.yMin
get

Gets the minimum y bound for the extents object

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.

◆ zMax

double Extents.zMax
get

The maximum z bound for the extents object.

◆ zMin

double Extents.zMin
get

Gets the minimum z bound for the extents object.