IPolygon Class
Summary: A IPolygon whose boundaries are defined by linear rings.
Module: aspose.gis.geometries
Full Name: aspose.gis.geometries.IPolygon
Inheritance: ICurvePolygon, ISurface, IGeometry
Aspose.PSD Version: 25.9.0
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| dimension | GeometryDimension | r | Gets the topological dimension of this IGeometry. If the dimension is unknown (e.g. for an empty GEOMETRYCOLLECTION) GeometryDimension.POINT is returned. |
| exterior_ring | ILinearRing | r | Gets the exterior ring. |
| geometry_type | GeometryType | r | Gets the type of the geometry. |
| has_curve_geometry | bool | r | Gets a value indicating whether this geometry is or contains curve (not linear) geometry. |
| has_m | bool | r | Gets a value indicating whether this instance has M coordinate. |
| has_z | bool | r | Gets a value indicating whether this instance has Z coordinate. |
| interior_rings_count | int | r | Gets the number of interior rings. |
| is_empty | bool | r | Gets a value indicating whether this instance is empty (represents the empty point set). |
| is_simple | bool | r | Gets a value indicating whether this instance is simple from SFA point of view. |
| is_valid | bool | r | Gets a value indicating whether this instance is valid. |
| spatial_reference_system | SpatialReferenceSystem | r | Gets SpatialReferenceSystem of this instance. This property can be |
Methods
| Name | Description |
|---|---|
| as_binary() | Translates this geometry to its Well-Known Binary representation. |
| as_binary(variant) | Translates this geometry to its Well-Known Binary representation. |
| as_image(output_path, width, height, renderer, symbolizer) | Export this geometry to an image representation. |
| as_image(output_path, width, height, renderer, symbolizer) | Export this geometry to an image representation. |
| as_image(width, height, renderer, symbolizer) | Export this geometry to an image representation. |
| as_text() | Translates this geometry to its Well-Known Text representation. |
| as_text(variant) | Translates this geometry to its Well-Known Text representation. |
| as_text(variant, format) | Translates this geometry to its Well-Known Text representation. |
| clone() | Clones this instance. |
| covered_by(other) | Determines whether this geometry is covered by a specified geometry. |
| covers(other) | Determines whether this geometry covers a specified geometry. |
| crosses(other) | Determines if this geometry and a specified geometry cross. |
| difference(other) | Subtracts a specified geometry from this geometry. |
| disjoint(other) | Determines if this geometry is disjoint from a specified geometry. |
| get_area() | Computes the area of this geometry. |
| get_buffer(distance, quadrant_segments) | Computes a buffer region around this geometry. |
| get_centroid() | Computes the centroid of this geometry. |
| get_convex_hull() | Computes the convex hull of this geometry. |
| get_distance_to(other) | Computes the minimum distance between this geometry and a specified geometry. |
| get_extent() | Computes and returns a bounding extent of this geometry. |
| get_interior_ring(index) | Gets the interior ring by its index. |
| get_length() | Computes the length of this geometry. |
| get_point_on_surface() | Finds a point that is guaranteed to be on this surface. |
| intersection(other) | Builds an intersection between this geometry and a specified geometry. |
| intersects(extent) | Determines whether this geometry intersects a specified extent. |
| intersects(other) | Determines if this geometry and a specified geometry intersects. |
| overlaps(other) | Determines whether this geometry overlap with a specified geometry. |
| relate(other, intersection_pattern_matrix) | Determines if DE-9IM intersection matrix of this geometry and a specified geometry matches provided pattern. |
| replace_polygons_by_lines() | Gets polygons represented as lines of this geometry. |
| spatially_contains(other) | Determines whether this geometry spatially contains a specified geometry. |
| spatially_equals(other) | Determines if this geometry spatially equal to a specified geometry. |
| sym_difference(other) | Builds a symmetric difference between this geometry and a specified geometry. |
| to_editable() | Gets an editable copy of this geometry. |
| to_linear_geometry() | Gets approximate or equivalent non-curve version of this geometry using the default |
| to_linear_geometry(tolerance) | Gets approximate or equivalent non-curve version of this geometry using the specified |
| touches(other) | Determines if this geometry and a specified geometry touch. |
| union(other) | Unites this geometry and a specified geometry. |
| union(other) | Unites this geometry and a specified geometry. |
| within(extent) | Determines whether this geometry is within a specified extent. |
| within(other) | Determines whether this geometry is within a specified geometry. |
Method: as_binary()
as_binary()
Translates this geometry to its Well-Known Binary representation.
Returns
| Type | Description |
|---|---|
| byte | Well-Known Binary representation of this geometry. |
Method: as_binary(variant)
as_binary(variant)
Translates this geometry to its Well-Known Binary representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| variant | WkbVariant | Well-Known Binary variant to use. |
Returns
| Type | Description |
|---|---|
| byte | Well-Known Binary representation of this geometry. |
Method: as_image(output_path, width, height, renderer, symbolizer)
as_image(output_path, width, height, renderer, symbolizer)
Export this geometry to an image representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| output_path | AbstractPath | Path to the output image. |
| width | Measurement | Width of the map. |
| height | Measurement | Height of the map. |
| renderer | Renderer | Renderer to use. |
| symbolizer | VectorSymbolizer | A symbolizer to use for rendering. If |
Method: as_image(output_path, width, height, renderer, symbolizer)
as_image(output_path, width, height, renderer, symbolizer)
Export this geometry to an image representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| output_path | string | Path to the output image. |
| width | Measurement | Width of the map. |
| height | Measurement | Height of the map. |
| renderer | Renderer | Renderer to use. |
| symbolizer | VectorSymbolizer | A symbolizer to use for rendering. If |
Method: as_image(width, height, renderer, symbolizer)
as_image(width, height, renderer, symbolizer)
Export this geometry to an image representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| width | Measurement | Width of the map. |
| height | Measurement | Height of the map. |
| renderer | Renderer | Renderer to use. |
| symbolizer | VectorSymbolizer | A symbolizer to use for rendering. If |
Returns
| Type | Description |
|---|---|
| _io.BufferedRandom | The image as stream |
Method: as_text()
as_text()
Translates this geometry to its Well-Known Text representation.
Returns
| Type | Description |
|---|---|
| string | Well-Known Text representation of this geometry. |
Method: as_text(variant)
as_text(variant)
Translates this geometry to its Well-Known Text representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| variant | WktVariant | Well-Known Text variant to use. |
Returns
| Type | Description |
|---|---|
| string | Well-Known Text representation of this geometry. |
Method: as_text(variant, format)
as_text(variant, format)
Translates this geometry to its Well-Known Text representation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| variant | WktVariant | Well-Known Text variant to use. |
| format | NumericFormat | Coordinate format for conversion to string. See the NumericFormat to get it. |
Returns
| Type | Description |
|---|---|
| string | Well-Known Text representation of this geometry. |
Method: clone()
clone()
Clones this instance.
Returns
| Type | Description |
|---|---|
| Geometry | The clone of this instance |
Method: covered_by(other)
covered_by(other)
Determines whether this geometry is covered by a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: covers(other)
covers(other)
Determines whether this geometry covers a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: crosses(other)
crosses(other)
Determines if this geometry and a specified geometry cross.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: difference(other)
difference(other)
Subtracts a specified geometry from this geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry to subtract. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents a difference of this geometry and an argument. The result geometry contains point set that present in this geometry but not present in an argument. |
Method: disjoint(other)
disjoint(other)
Determines if this geometry is disjoint from a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: get_area()
get_area()
Computes the area of this geometry.
Returns
| Type | Description |
|---|---|
| double | The area of this geometry. Sum of areas of elements of this geometry if this geometry is a GeometryCollection. |
Method: get_buffer(distance, quadrant_segments)
get_buffer(distance, quadrant_segments)
Computes a buffer region around this geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| distance | double | The buffer region width (in Spatial Reference units). |
| quadrant_segments | int | Number of segments used to approximate a 90 degree of curvature. The larger this number is the better approximation of curves is produced. Default is 30. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents all points that are within a specified distance from this geometry. The type of result is either Geometry.null, IPolygon or IMultiPolygon. |
Method: get_centroid()
get_centroid()
Computes the centroid of this geometry.
Returns
| Type | Description |
|---|---|
| IPoint | The centroid of this geometry. If this geometry is empty an empty point returned. The centroid is equal to the centroid of the highest dimension geometries in this geometry (e.g. if both points and lines are contained in the geometry, only lines contribute to centroid). |
Method: get_convex_hull()
get_convex_hull()
Computes the convex hull of this geometry.
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents a convex hull of this geometry. If this geometry has no points then the result is Geometry.null. If this geometry has only one point then the result is this point. If this geometry has only two points then the result is ILineString with the points. If this geometry has three or more points then the result is ILinearRing that represents a convex hull around all geometries points. |
Method: get_distance_to(other)
get_distance_to(other)
Computes the minimum distance between this geometry and a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry to find distance to. |
Returns
| Type | Description |
|---|---|
| double | If both geometries are not IGeometry.is_empty - a distance between closest points of the geometries. If at least one geometry is empty -1 is returned. |
Method: get_extent()
get_extent()
Computes and returns a bounding extent of this geometry.
Returns
| Type | Description |
|---|---|
| Extent | A bounding extent of this geometry. |
Method: get_interior_ring(index)
get_interior_ring(index)
Gets the interior ring by its index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The index. |
Returns
| Type | Description |
|---|---|
| ILinearRing | The interior ring. |
Method: get_length()
get_length()
Computes the length of this geometry.
Returns
| Type | Description |
|---|---|
| double | The length of this geometry. Perimeter if this is a Polygon. Sum of lengths of elements of this geometry if this geometry is a GeometryCollection. |
Method: get_point_on_surface()
get_point_on_surface()
Finds a point that is guaranteed to be on this surface.
Returns
| Type | Description |
|---|---|
| IPoint | A point on this surface. An empty point if this surface has no interior. |
Method: intersection(other)
intersection(other)
Builds an intersection between this geometry and a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry to compute intersection with. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents an intersection of this geometry and an argument. The result geometry contain point set that present in both this geometry and an argument. |
Method: intersects(extent)
intersects(extent)
Determines whether this geometry intersects a specified extent.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| extent | Extent | The extent. |
Returns
| Type | Description |
|---|---|
| bool |
Method: intersects(other)
intersects(other)
Determines if this geometry and a specified geometry intersects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: overlaps(other)
overlaps(other)
Determines whether this geometry overlap with a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: relate(other, intersection_pattern_matrix)
relate(other, intersection_pattern_matrix)
Determines if DE-9IM intersection matrix of this geometry and a specified geometry matches provided pattern.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
| intersection_pattern_matrix | string | A patter to match with. This should be a string with length equal to 9. Each character of the string represent expected dimension of an intersection:
Possible values of each characters are:
For example, an intersection pattern “F0*******” means, that there should not be intersection between geometries interiors and intersection between geometries boundaries must be a point. See OpenGIS Simple Features Specification for more details about intersection matrix pattern. |
Returns
| Type | Description |
|---|---|
| bool |
Method: replace_polygons_by_lines()
replace_polygons_by_lines()
Gets polygons represented as lines of this geometry.
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry, that has no polygon geometries. The following transformation are applied:
|
Method: spatially_contains(other)
spatially_contains(other)
Determines whether this geometry spatially contains a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: spatially_equals(other)
spatially_equals(other)
Determines if this geometry spatially equal to a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: sym_difference(other)
sym_difference(other)
Builds a symmetric difference between this geometry and a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry to compute symmetric difference with. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents a symmetric difference of this geometry and an argument. The result geometry contains point set that present in one of the geometries but not present in both of them. |
Method: to_editable()
to_editable()
Gets an editable copy of this geometry.
Returns
| Type | Description |
|---|---|
| Polygon | An editable copy of this geometry. |
Method: to_linear_geometry()
to_linear_geometry()
Gets approximate or equivalent non-curve version of this geometry using the default
Returns
| Type | Description |
|---|---|
| IPolygon | A geometry that has no curve geometries. This is the equivalent of <DOM Element: class at 0x2a1791a70d0>.IGeometry.to_linear_geometry()(float) with default of this geometry:
For more details on what transformations are applied refer to <DOM Element: class at 0x2a1791a70d0>.IGeometry.to_linear_geometry()(float) specification. |
Method: to_linear_geometry(tolerance)
to_linear_geometry(tolerance)
Gets approximate or equivalent non-curve version of this geometry using the specified
Parameters:
| Parameter | Type | Description |
|---|---|---|
| tolerance | double | The curved geometry, unless the number of points needed to linearize the geometry exceeds the per-quadrant maximum which is currently equal to 10000 points. |
Returns
| Type | Description |
|---|---|
| IPolygon | A geometry, that has no curve geometries. The following transformations are applied:
As a result, IGeometry.has_curve_geometry of output geometry is |
Method: touches(other)
touches(other)
Determines if this geometry and a specified geometry touch.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |
Method: union(other)
union(other)
Unites this geometry and a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry to unite with. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents a union of this geometry and an argument. The result geometry contains point set that present in this geometry or in an argument. |
Method: union(other)
union(other)
Unites this geometry and a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry[] | A geometry to unite with. |
Returns
| Type | Description |
|---|---|
| IGeometry | A geometry that represents a union of this geometry and an argument. The result geometry contains point set that present in this geometry or in an argument. |
Method: within(extent)
within(extent)
Determines whether this geometry is within a specified extent.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| extent | Extent | The extent. |
Returns
| Type | Description |
|---|---|
| bool |
Method: within(other)
within(other)
Determines whether this geometry is within a specified geometry.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IGeometry | A geometry. |
Returns
| Type | Description |
|---|---|
| bool |