4 ms·
I took a shot at this. If you assume flat terrain between you and the base of the building, the problem can be simplified to basically the distance to the build
by sorenjan 4y ago
I took a shot at this. If you assume flat terrain between you and the base of the building, the problem can be simplified to basically the distance to the building from your current position times the tangent of the angle from the horizontal plane to the top of the building, from the definition of the tangent function[0]. To find the distance you can plug in your current coordinates and the buildings coordinates in a great circle distance calculator, like this one: [1], or just use the distance measure feature in Google maps. To find the angle you can zoom in on the top of the building in street view mode, and in the URL you'll have the pitch angle as a number between 1 and 179, ending in t [2] (so for instance 150.1t is a pitch angle of 150.1 degrees). Conveniently you'll also have the coordinates of the street view position in the same URL. To get the angle from the horizontal plane you have to subtract 90, since 0 pitch is straight down.
I tried it with a tall building (Turning Torso in Malmö), and got 199 m on my first attempt and 195 on my second. The correct height is 190.4 m, so pretty close. The first attempt was 100 m away, the second more than 1.2 km.
I then tried it with the Chrysler building from the other side of East river about 1.5 km away, and got 274 m which is close to the actual 282 m.
You can probably use more sophisticated methods that downloads the 360 image as a stereographic projection and extracts the pitch angle from there, but for something that's a close enough one off I think this works ok.
[0] https://en.wikipedia.org/wiki/Trigonometric_functions#Right-angled_triangle_definitions https://en.wikipedia.org/wiki/Trigonometric_functions#Right-...
[1] https://www.gpsvisualizer.com/calculators https://www.gpsvisualizer.com/calculators
[2] https://www.trekview.org/blog/2020/decoding-google-street-view-urls/ https://www.trekview.org/blog/2020/decoding-google-street-vi...