Teradata Package for Python Function Reference | 20.00 - simplify - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference - 20.00
- Deployment
- VantageCloud
- VantageCore
- Edition
- Enterprise
- IntelliFlex
- VMware
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.03
- Published
- December 2024
- Language
- English (United States)
- Last Update
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- Product Category
- Teradata Vantage
- teradataml.geospatial.geodataframecolumn.GeoDataFrameColumn.simplify = simplify(self, tolerance)
- DESCRIPTION:
Simplifies a geometry by removing points that would fall within a
specified distance tolerance.
Notes:
* The simplification always returns a valid geometry.
* Simplified geometries require less storage space and fewer spatial
operations during geospatial manipulations. Consequently, operations
on simplified geometries generally perform faster.
* Smaller tolerance values result in a geometry closer to the input
geometry, but will remove fewer vertices. Larger tolerance values
will remove more vertices, but the resulting simplified geometry
will be less similar to the original input.
PARAMETERS:
tolerance:
Required Argument.
Specifies the distance tolerance for the simplification. The
simplified line will never be farther away from the original line
than the tolerance value.
Types: float, str, ColumnExpression
SUPPORTED GEOMETRY TYPES:
Valid on the following 2D geometries:
LineString, MultiLineString, Polygon, and MultiPolygon.
It is valid on these types within Geometry Collections. If method is called on other 2D
geometries, those geometries are returned unchanged.
This method is not valid on 3D geometries.
RAISES:
TypeError, ValueError, TeradataMlException
RETURNS:
GeoDataFrameColumn containing Geometry values
EXAMPLES:
from teradataml import GeoDataFrame, load_example_data
from teradataml import Point, LineString, Polygon, GeometryCollection
# Load example data.
load_example_data("geodataframe", "sample_shapes")
# Create a GeoDataFrame.
geodf = GeoDataFrame("sample_shapes")
print(geodf)
# Let's select only few columns from GeoDataFrame.
pols_lines = geodf.select(["skey", "polygons", "linestrings"])[geodf.skey.isin([1001, 1002, 1003])]
# Example 1: Simplify the geometry in column 'polygons' within a specified distance tolerance of 2.8.
pols_lines.assign(res = pols_lines.polygons.simplify(2.8))
# Example 2: Simplify the geometry in column 'linestrings' within a specified distance tolerance of 2.8.
pols_lines.assign(res = pols_lines.linestrings.simplify(tolerance=2.8))