A method is present for generating a route for a vehicle. A start point and an end point are identified for the vehicle. A spatial model of terrain encompassing the start point and the end point is identified to form an identified spatial model. The route for the vehicle is generated from the start point to the end point using the spatial model based on a cost to traverse a grid point within a grid to meet a number of criteria for energy management for the vehicle.