1

I have checked other questions but nobody is talking about how to calculate the height of an object using GPS,

Consider I have two data points vertically (not horizontally which calculates the distance), I have (lat1,lon1,alt1) and (lat2,lon2,alt2). now, How can I calculate the height of the object? Is there any formula using which I can get the height? consider a cube and data points are of the front top left and the front bottom left, can I get the height of this cube using these two data points using any formula?

enter image description here

  • How are latitude and longitude related to height? – Jonathan Hall Feb 06 '21 at 12:00
  • lat, lon is just there to find the position. Altitude is also there in the data point, – Ekta Dobaria Feb 06 '21 at 12:02
  • Can I measure, for example, a building's height using geo-coordinates? we can measure its length and width using geo refs but what about height? is there any formula? – Ekta Dobaria Feb 06 '21 at 12:04
  • @EktaDobaria It is clear now. I assume that the Lat/Longs of both points may be different; i.e. the 2 points may not always be exactly on top of each other. If they are always on top of each other then the vertical distance is simply the difference between Alt2 and Alt1. – Mohsen Alyafei Feb 06 '21 at 15:26
  • @EktaDobaria remember that your question is about `distance` not about `height difference` or `altitude difference` – Mohsen Alyafei Feb 06 '21 at 15:27
  • 1
    @MohsenAlyafei Thansk, I mentioned the word distance but also specified the work verticle to give clear idea. – Ekta Dobaria Feb 07 '21 at 05:48
  • 1
    @MohsenAlyafei YOu are right all the points may not be exactly on top of each other every time, so what do you suggest instead of alt2-alt1, is there any formula for that kind of scenario to calculate the height difference or altitude difference( whatever we say height or alt diff)? – Ekta Dobaria Feb 07 '21 at 05:50

3 Answers3

1

The question is not clear.

Is the vertical distance what is required?

Please see the image below.

enter image description here

Mohsen Alyafei
  • 4,765
  • 3
  • 30
  • 42
0

If I am reading your question right, when you say height this is going to be the vertical. Simply go

alt2 - alt1

(assuming alt2 > alt1) or go

mod(alt1 - alt2)

This should give you the vertical rise irrespective of where the Lat, Long are in space!!!! Hope that solves it!

TheAnalyst
  • 21
  • 1
  • 5
  • Thanks for your reply! It calculates the difference in which unit? I mean alt2-alt1 is m or km or what? – Ekta Dobaria Feb 06 '21 at 15:13
  • you be the judge of that, what is your output looking like? This is a very basic question, unsure if it is meant for a forum like this? – TheAnalyst Feb 06 '21 at 15:42
  • Please check the comments by Mohsen, he is thinking in the right way. I have asked because I am not sure if you say alt2-alt1 what unit it calculates? I have checked other questions but all are related to a distance, not the height difference. – Ekta Dobaria Feb 07 '21 at 05:52
0

The Height is simply Alt2 - Alt1. The Height units will be the same unit type as the input Altitude values. For example if Altitude2 is 10 meters, and Altitude1 is 2 meters, then Height is 8 meters. If your Altitudes are in different unit types you will need to convert them to be the same unit type prior to calculating the Height.

The Altitude values given by a GPS will typically be referenced to Mean Sea Level, and understood to represent the Height "Above Mean Sea Level" or "AMSL". Note: In low lying areas you may see a negative altitude, so be sure to account for that in your code.

The GPS should give an indication whether the Altitude is being expressed in Meters or Feet, and should also typically give the user the option to specify their desired units.

Note: In some disciplines you will see heights expressed in AGL ("Above Ground Level"), or even both AGL and AMSL. For example, a given building roof may be 50ft AGL, and 1050ft AMSL; indicating that the ground the building sits on is at 1000ft AMSL.

Note2: Height and Vertical Distance are the same thing. There is a drawing in the answers which incorrectly shows the Vertical Distance as a sloped line between two points, however that sloped line is actually the "Slope Distance". "Vertical Distance" will always be the difference in height when considered from the center of the Earth. "Horizontal Distance" will be the distance between two locations (i.e. discrete coordinates) at a common elevation. "Slope Distance" will be the distance between those two locations at their respective elevations.