Use a set of helper sprites that can check your requirement/condition with overlap.
Move them to each tile in your tilemap, check conditions, and if true place ledge sprite.
Alternatively you can check these ledge grabbing conditions whenever your character collides with ANY tile while airborne, instead of just your ledge sprite...