An observatory was a facility used to observe and analyze spatial phenomenon. They typically had complex telescopes within them, and could be located on the surface of a planet or in space.
In 2373, the USS Voyager was thrown back in time to Earth in 1996 where it was picked up by Griffith Observatory located in the city of Los Angeles, on the planet's North American continent. In response, the observatory's operator, Rain Robinson, sent a standard greeting message to the starship. (VOY: "Future's End")
In 2376, the starship Voyager was again spotted by an observatory while trapped in orbit of a planet experiencing the effects of differential space-time. (VOY: "Blink of an Eye")
The Amargosa observatory was a Federation outpost orbiting the Amargosa star during the late 24th century. (Star Trek Generations)