A method for determining reference elements of an environment to associate a predetermined map with a real-time environment map, the method comprising at least the steps of: - providing a ceiling value and a floor value, these values respectively corresponding to a virtual or real ceiling and a virtual or real floor in the environment; - measuring, using a distance-measuring sensor, sets of environment point positions, each of said positions comprising at least a first coordinate along a first direction and a second coordinate along a second direction non collinear with the first direction, each set of environment point positions being aligned along a straight line; - determining reference elements and non-reference elements of the environment, each reference element comprising a set of reference environment point positions, said set of reference environment point positions comprising at least one position from one set of environment point positions * whose second coordinate is strictly smaller than the ceiling value and strictly higher than the floor value, and * whose distance to the distance-measuring sensor, taken along the first direction, is a highest distance in a set of distances of said one set of environment points to the distance-measuring sensor, said distances being taken along the first direction, said non-reference elements corresponding to positions of one set of environment point positions, whose distance to the distance-measuring sensor, taken along the first direction, is not the highest distance in a set of distances of said one set of environment points to the distance-measuring sensor, said distances being taken along the first direction. - providing a ceiling value and a floor value, these values respectively corresponding to a virtual or real ceiling and a virtual or real floor in the environment; - measuring, using a distance-measuring sensor, sets of environment point positions, each of said positions comprising at least a first coordinate along a first direction and a second coordinate along a second direction non collinear with the first direction, each set of environment point positions being aligned along a straight line; - determining reference elements and non-reference elements of the environment, each reference element comprising a set of reference environment point positions, said set of reference environment point positions comprising at least one position from one set of environment point positions * whose second coordinate is strictly smaller than the ceiling value and strictly higher than the floor value, and * whose distance to the distance-measuring sensor, taken along the first direction, is a highest distance in a set of distances of said one set of environment points to the distance-measuring sensor, said distances being taken along the first direction, * whose second coordinate is strictly smaller than the ceiling value and strictly higher than the floor value, and * whose distance to the distance-measuring sensor, taken along the first direction, is a highest distance in a set of distances of said one set of environment points to the distance-measuring sensor, said distances being taken along the first direction,