William Petrie (1784–1816) was a British officer of the East India Company in Chennai (formerly Madras) during the 1780s.
Petrie set up a private observatory in his residence located in Egmore, Chennai, India. The main aim of the observatory was "to provide navigational assistance to the company ships and help determine the longitudes by observing the eclipses of Moon and satellites of Jupiter". He gave the observatory to the East India Company and the first modern astronomical observatory outside Europe was born. It was named as the Madras Observatory and was located in Nungambakkam . Michael Topping (1747–96) was appointed as the astronomer of this observatory by the Company. The Madras Observatory later evolved into Indian Institute of Astrophysics.
Petrie was a Member of Council in Madras in the 1790s, and acted for three months as Governor of Madras in 1807. He was appointed Governor of Prince of Wales Island (Penang Island) in 1809, and died there.
He was elected as a Fellow of the Royal Society in November 1795.
The chronology of his advancement through the Honorable the East India Company is as follows:
Petrie received his appointment on 29 Nov 1811 probably owing to Archibald Seton being absent on duty with the Java Expedition. Seton was officially Lieutenant-Governor of Penang from 9 May 1811 to 27 July 1812 but was absent on duty with The Java Expedition from 13 May 1811 until the end.
Petrie served as Acting Governor till the end of Seton's official rule and then as Governor of Penang from September 1812 to October 1816. He died while still in office, after being arrested on 6 accounts of rape and murder.