In the summer of 1502, Cesare Borgia appointed Leonardo da Vinci for his engineering expertise. His assignment was specific and concerning with military architecture: he was expected to “see, measure and do good estimation”. The Codex L, a small notebook conserved in the Library of the Institute of France, show the results of the survey of the city walls of Cesena and Urbino. The technique Leonardo adopted consists in traversing rectilinear stretches, measuring their length by means of an instrument able to count his steps and establishing their orientation by means of a compass. At the end of the path, the data relative to the sides of a closed polygon are obtained, resulting the geometric plan of the walls. This practice is testified by some residual eidotypes provided with quotas and orientations. In some cases, only the lists of distances in numbers are present, but the analysis of the figures makes it possible to reconstruct the surveyed plans, as Nando De Toni pioneered many years ago. This study focuses on the tools and the urban survey technique used by Leonardo. The analysis of some sheets from the Codex L, contextualized with respect to the actual topography of the sites, allows to understand the correct sequence of the operations carried out first in the site and then at the drawing board. By means of specific digital reconstructions, it is therefore possible to study the instrumental and operational limits of this practice and, by comparing it with the current state, to reconstruct the entire defensive structure.