On one of my many trips to Bunnings I finally found the right sort of foam for layout building, extruded (and not expanded) polystyrene. It goes by the name Knaff board. This stuff is about 50mm thick comes in a convenient sized 1200 by 600 (or 4'by 2' for the rest of us) for about $25. I don't know if it comes in larger sizes.
Here we have the wharf and a ship placed on the board. I have a much larger card model to place behind the wharf, which probably needs too be a wee bit higher.