The aim of Terrain Relative Navigation systems (TRN) is to augment inertial navigation by providing position estimates relative to known lunar surfaces. Also the purpose of TRN systems is to assist a lunar landing spacecraft with precise and safe landing. Such systems collect the height values from the lunar surface with the help of active range sensors which are then matched within a terrain Digital Elevation Map (DEM) database. Although lunar terrain elevation maps are rare and have low resolution quality, after Lunar Reconnaissance Orbit (LRO) mission is completed by 2010, maps of 20-25 m resolution will be gained. In this proposed work, a model of the lunar surface is developed with terrain generation algorithms. All the possible profiles (height values) and the slopes of the profiles that the sensor may collect during a position estimation phase are determined in advance. The DEM is pre-processed and reorganized into a Digital Profile Attributes Database (DPAD). DPAD records are organized in a way to optimize the lander's position estimation process. DPAD data is available as a function of lunar latitudes and longitudes. The DPAD over which the lunar lander is flying is loaded into the lander's memory. A novel TRN algorithm has been developed to estimate the precise location of the lander. This algorithm matches the determined slope values within the DPAD. Where only one match is found, the position of the lander is determined. When more-than-one matches arise, the system iterates until only one position solution is reached. In order to achieve accurate continuous navigation, the sensor should make measurements at specific intervals. The difference between the lander's estimate and the actual height that are measured by laser altimeter, can be used to calculate the position errors, thus providing the lander a continuous navigation solution as in TERCOM .