In 1958, during the period of autonomy of the Central African Republic within the French Community ( ), there were plans for a railway from Bangui to Fort Lamy (now N'Djamena) in Chad, a distance of about 870 kilometers .