The tilemap is just a FlxTilemapExt. Nothing fancy there.
I could grab tiles nearby entities. What I wonder is how the stamp would work. Not sure if there's a way to get the sprite of any given tilemap ? Plus, as you correctly pointed out, I'm afraid that the stamping would go outside the boundaries of said tiles. And yes, this is the purpose of the rectangles, to mask the stamps.
I might place all those rectangles manually, but sounds like a brute forced solution. I was wondering how other people might solve this, but sounds like isn't a easy task. Many thanks @jcox171 for your replies so far :)