Extent Class

Summary: A two-dimensional spatial bounding box.

Module: aspose.gis

Full Name: aspose.gis.Extent

Aspose.PSD Version: 25.9.0

Constructors

NameDescription
Extent()Creates new instance.
Extent(srs)Creates new instance.
Extent(x_min, y_min, x_max, y_max, srs)Creates new instance.

Properties

NameTypeAccessDescription
centerIPointrCenter of the extent.
heightdoublerHeight of the extent.
is_validboolrDetermines whether this Extent is valid.
spatial_reference_systemSpatialReferenceSystemr/wSpatialReferenceSystem associated with this extent.
Can be if Extent.spatial_reference_system is unknown.
Use Aspose.Gis.Extent.GetTransformed(Aspose.Gis.SpatialReferencing.SpatialReferenceSystem)
in order to transform extent between difference spatial reference systems.
widthdoublerWidth of the extent.
x_maxdoubler/wMaximum value of the X coordinate.
x_mindoubler/wMinimum value of the X coordinate.
y_maxdoubler/wMaximum value of the Y coordinate.
y_mindoubler/wMinimum value of the Y coordinate.

Methods

NameDescription
clone()Clones this instance.
contains(extent)Determines whether this extent contains the argument.
contains(geometry)Determines whether this extent contains the argument.
contains(x, y)Determines whether this extent contains a coordinate defined by the arguments.
get_transformed(target_srs)Returns new extent in specified SpatialReferenceSystem that contains this extent.
grow(extent)Grows this extent so it includes the argument.
grow(x, y)Grows this extent so it includes the specified point.
grow_x(value)Grows this extent along the X axis so it includes the specified value.
grow_y(value)Grows this extent along the Y axis so it includes the specified value.
intersects(extent)Determines whether this extent intersects with the argument.
intersects(geometry)Determines whether this extent intersects with the argument.
normalize()Swaps Extent.x_min with Extent.x_max if Extent.width is negative and
Extent.y_min with Extent.y_max if Extent.height is negative.
to_polygon()Converts this extent to a rectangular polygon that represents it.

Constructor: Extent()

 Extent() 

Creates new instance.

Constructor: Extent(srs)

 Extent(srs) 

Creates new instance.

Parameters:

ParameterTypeDescription
srsSpatialReferenceSystemSpatialReferenceSystem associated with this extent.
Can be to indicate that SRS is unknown.

Constructor: Extent(x_min, y_min, x_max, y_max, srs)

 Extent(x_min, y_min, x_max, y_max, srs) 

Creates new instance.

Parameters:

ParameterTypeDescription
x_mindoubleMinimum X value.
y_mindoubleMinimum Y value.
x_maxdoubleMaximum X value.
y_maxdoubleMaximum Y value.
srsSpatialReferenceSystemSpatialReferenceSystem associated with this extent.
Can be to indicate that SRS is unknown.

Method: clone()

 clone() 

Clones this instance.

Returns

TypeDescription
ExtentClone of this instance.

Method: contains(extent)

 contains(extent) 

Determines whether this extent contains the argument.

Parameters:

ParameterTypeDescription
extentExtentAnother extent.

Returns

TypeDescription
boolValue, indicating whether this extent contains the argument.

Method: contains(geometry)

 contains(geometry) 

Determines whether this extent contains the argument.

Parameters:

ParameterTypeDescription
geometryIGeometryA geometry to test for containment.

Returns

TypeDescription
boolValue, indicating whether this extent contains the argument.

Method: contains(x, y)

 contains(x, y) 

Determines whether this extent contains a coordinate defined by the arguments.

Parameters:

ParameterTypeDescription
xdoubleX of the coordinate.
ydoubleY of the coordinate.

Returns

TypeDescription
boolValue, indicating whether coordinate is inside bounding box.

Method: get_transformed(target_srs)

 get_transformed(target_srs) 

Returns new extent in specified SpatialReferenceSystem that contains this extent.

Parameters:

ParameterTypeDescription
target_srsSpatialReferenceSystemSpatialReferenceSystem to transform to.

Returns

TypeDescription
ExtentThe result of transformation this extent to the specified SRS.

Method: grow(extent)

 grow(extent) 

Grows this extent so it includes the argument.

Parameters:

ParameterTypeDescription
extentExtentOther extent.

Method: grow(x, y)

 grow(x, y) 

Grows this extent so it includes the specified point.

Parameters:

ParameterTypeDescription
xdoubleX coordinate to include.
ydoubleY coordinate to include.

Method: grow_x(value)

 grow_x(value) 

Grows this extent along the X axis so it includes the specified value.

Parameters:

ParameterTypeDescription
valuedoubleValue to include.

Method: grow_y(value)

 grow_y(value) 

Grows this extent along the Y axis so it includes the specified value.

Parameters:

ParameterTypeDescription
valuedoubleValue to include.

Method: intersects(extent)

 intersects(extent) 

Determines whether this extent intersects with the argument.

Parameters:

ParameterTypeDescription
extentExtentAnother extent.

Returns

TypeDescription
boolValue, indicating whether this extent intersects with the argument.

Method: intersects(geometry)

 intersects(geometry) 

Determines whether this extent intersects with the argument.

Parameters:

ParameterTypeDescription
geometryIGeometryA geometry to test for intersection

Returns

TypeDescription
boolValue, indicating whether this extent intersects with the argument.

Method: to_polygon()

 to_polygon() 

Converts this extent to a rectangular polygon that represents it.

Returns

TypeDescription
PolygonA rectangular Polygon that represents this extent. For invalid extents
an empty polygon is returned.