Geometrical aspects of the Kadomtsev-Petviashvili equation