Surveyors do this in their sleep, and have been doing it for centuries. That has been a standard technique for mapmaking until at least the late 20th century (before laser rangefinders, satellites and GPS).
They typically use an instrument called a theodolite for this, which is basically a telescope with crosshairs/bullseye mounted on a leveling tripod, with vertical and horizontal precision angle scales. You might have seen theodolites around construction zones.
If they can, they’ll have an assistant hold a graduated staff(1) at the place they want to measure for extra precision. If they can’t, they will seek an easily distinguishable feature of the object/place.
Just like in astronomy, in order to make this type of measurement they need a reference landmark to measure the angles with precision. In astronomy we use very distant or “background” stars; in surveying they can use a staff on each of the observing spots as viewed from the other.
You start from one viewing spot, level the theodolite, aim it at the leveled staff placed at the other spot, and write down the angle on the horizontal scale. Then you “sweep” the theodolite until it points at the site of interest, and note the second horizontal angle measurement. Subtract the two and you have the angle at that corner. Notice that you don’t even have to align the theodolite with the North. Swap places with your staff, and repeat from the other viewing spot, and you have a second angle. With two angles and one known distance (between the two observing spots, you need to measure that too) you can use use trigonometry (compute the third angle and use the sine law) to calculate the distance to the site of interest. With the coordinates of both viewing spots you even have the full coordinates of the site.
If you can’t or don’t want to go back and forth for whatever reason, you could use a third object as a reference point. The reference object must be one for which you know the distance and location so you can adjust for the reference’s own parallax. The trigonometry is obviously more complicated. Or the reference must be so far away that its own parallax can be considered negligible (like it happens in astronomy with background stars)
Surveyors will often make several measurements from different locations, including previously known and accessible landmarks. These measurements are then chained together, for error correction.
(1) If you can get someone at the spot with a graduated staff, the fastest way to measure the distance is to compare the apparent size of the graduations through the scope against the graduated crosshairs (you must adjust for the vertical angle to the site; the staff is kept vertical with the help of a bubble level so you know the angle); this technique does not use parallax. But you usually can’t do this when surveying mountaintops for example. This might also be more demanding on the optics and I don’t know when it became feasible.
(*) I studied basic surveying in college but it’s been decades. I might (probably) have some details wrong. Hopefully others can chime in if corrections are needed.