Finding Nearest Geoshape to a Point in Pipeline Builder

In Pipeline Builder, I know I can use KNN joins to find the closest points to a geoshape. However, is there a way to find the nearest geoshapes to a point? What is the best recommended way of doing this?

There’s a few ways, if the geometries are relatively small, you could compute centroids and then use a simple geo-join to find the nearest.

If that’s not enough, you could do it in two steps, explode geo array to get all the points, and then use a join and then that creates a mapping between a point and it’s nearest points which are parts of a geoshape.