the Waal river froze over in late December 1794. Soon important cities, like Nijmegen and Utrecht capitulated. The Patriot Revolutionary Committee (with Samuel Iperusz. Wiselius and Nicolaas van Staphorst) deemed it important to liberate an important city itself, without direct French aid, to support its claims to independent authority in the Netherlands. It therefore sent Krayenhoff to Amsterdam, in a French lieutenant's uniform, to organize another insurrection. On Sunday afternoon 18 January 1795 – at Daendels' instruction – he came to tell Amsterdam's burgomasters that they had better resign the next day. Intimidated by large crowds of Patriot sympathizers (who threatened President-Burgomaster Straalman's personal safety) and demoralized by the fact that the commander of the Amsterdam garrison, Col. Golowkin, refused to intervene, the city government handed over command of the garrison to Krayenhoff at midnight. The next morning, the Amsterdam Revolutionary Committee triumphantly rode to city hall, while exultant crowds planted a liberty tree on Dam Square. In 1796 he became head of Dutch fortifications and moved to Muiden. From 1798 he was involved in organising the new Rijkswaterstaat, after the establishment of the unitary state. He was involved in the campaign against the Anglo-Russian invasion of Holland of 1799 as commander of the Batavian Engineers (see Battle of Castricum) and advised the army leadership. After the Convention of Alkmaar of 18 October 1799, in which the evacuation of the invasion troops was agreed, Krayenhoff, on behalf of the Batavian command inspected the fortifications which the British had promised to leave intact as part of the capitulation. Krayenhoff was meanwhile beginning his life's work : setting up a system of triangulation, so that the Netherlands could be mapped in detail. Krayenhoff busied himself with determining the Amsterdam Level. King Louis Bonaparte (the ruler of the Kingdom of Holland after 1806) was very taken with him and gave him various positions. Krayenhoff was for ten months Minister of War and organized Amsterdam's defensive fortifications against a feared invasion by the king's brother Napoleon Bonaparte. Krayenhoff in this context initiated the construction of the Stelling van Amsterdam, at this time called the Posten van Krayenhoff, or the Oude Stelling van Amsterdam. When Napoleon became aware of this, Krayenhoff had to be fired. However, in a personal encounter in October 1811, Napoleon showed interest in him. Together they went to see the fortifications in Naarden and Muiden. The emperor gave him an appointment