1

I am looking at doing a spatial query where I can find when the center of one feature falls within another. For example, when the center (centroid) of a building falls within a grid tile. I know I can do this if I create a centroid of the building polygon, but I would like to do this on the polygon layer. Is there a way to do this with ST_Within, or another function?

Thanks...

enter image description here

1 Answer 1

2

If I'm understanding you correctly, you might try ST_Within(ST_Centroid(building_geom), other_geom)

If that's not what you're asking, could you clarify what you mean by "I would like to do this on the polygon layer", as in, what the "do this" is referring to?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.