jiayuasu opened a new issue, #3147:
URL: https://github.com/apache/sedona/issues/3147
Part of #2230.
Implement `GeoSeries.skew(xs=0.0, ys=0.0, origin="center",
use_radians=False)` and the corresponding active-geometry delegation from
`GeoDataFrame`.
## Requirements
- Keep execution fully distributed with Spark expressions. Do not use
`to_geopandas()`, `collect()`, `toLocalIterator()`, or Python row UDFs in the
implementation.
- Normalize `xs` and `ys` as operation-wide numeric scalars. Reject arrays,
Series, Spark Columns, and other per-row/distributed values deterministically.
- Interpret angles as degrees by default and radians when
`use_radians=True`. Match Shapely's exact-zero behavior by setting a tangent to
`0.0` when `abs(tan(angle)) < 2.5e-16`.
- Support per-row `"center"` (2D bounding-box center) and `"centroid"`
origins, plus a local nonempty 2D/3D Shapely Point or numeric tuple of length
2/3. Origin Z is ignored.
- Express the shear through Sedona's 2D `ST_Affine` overload. For `tx =
tan(xs)`, `ty = tan(ys)`, and origin `(x0, y0)`:
```text
x' = x + tx * (y - y0)
y' = y + ty * (x - x0)
xoff = -y0 * tx
yoff = -x0 * ty
```
- Preserve existing Z coordinates exactly; 2D inputs must remain 2D.
- Preserve the index, CRS/SRID, nulls, typed empty geometries, and geometry
types. Guard empty geometries before computed-origin expressions so they cannot
become null.
- Document JTS/Shapely differences for mixed-dimensional collections, M/ZM
ordinates, NaN Z coordinates, and non-finite angles. Do not collect data to
emulate local Shapely behavior.
- Reuse shared affine-family scalar validation where practical now that
`affine_transform`, `scale`, and `skew` share the same contract.
## Tests
- Default, positive, negative, zero, degree, and radian angles, including
the 180-degree exact-zero tangent case.
- `"center"`, `"centroid"`, 2D/3D tuple, and 2D/3D Point origins.
- Point, LineString, Polygon, multi-geometries, and homogeneous
GeometryCollection parity with GeoPandas.
- Exact 3D regression showing Z preservation and origin Z being ignored.
- Null and typed empty preservation, named index, CRS/SRID, and GeoDataFrame
delegation.
- Deterministic validation for invalid angles, `use_radians`, origins,
arrays/Series/distributed values, including all-empty input.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]