thinInstace hide or move from grounds

An easy way would be to check for intersection between the planes and a vertical ray which would pass by the tree bounding box center (or the tree position).

You can have a look here for how to use the ray class for mesh intersection: Get line length between two mesh