Python/Pyspark, return geojson record with Z values / Truncate Z
I have a dataframe with a column called ‘geometry’, it contains Multipolygon and Polygon values. I want to use Pyspark or Python to find and return where coordinates contain [X, Y, Z]; also would like to create a code block to remove the Z value if exists. How can I do this? Example below, I’d like to return the first coordinate value, and not return any other values.