The game doesn't appear to recognize landforms in any other sense than that they can't be navigated through. In other words, the ship pinging you only finds your sub, not the land you're resting on, as if your sub had been floating freely in the water.
You can also spot ships (and be spotted) through land. This caused quite a bit of trouble for me at Scapa Flow recently, as I was being bombarded by warships from several directions while being completely sheltered (or so I thought) by surrounding islands and coastlines, and not being able to even visually locate where the shots were coming from.
This is a major annoyance for me, I hope they'll fix it in SH5 (or did they do that in SH4? I haven't played it yet).