c# - System.Data.Entity.Spatial.DbGeography Distance with elevation -
i'm want find distance between 2 points on planet (using wgs84) , system.data.entity.spatial.dbgeography seemed shout, i'm not getting expected result distance function when points have elevation:
var geoga = dbgeography.pointfromtext("point(179.04 89.77 100)", 4326); var geogb = dbgeography.pointfromtext("point(179.04 89.77 200)", 4326); var distance = geoga.distance(geogb); //distance 0, not 100
i expecting distance able take elevation account - missing obvious here?
i'm sure must trivial, know little maths behind all, i'm not qualified make statement.
my intuition tells me, use pythagoras here, i'm not 100% sure that's correct.
in sql server libraries z (elevation) more tag or pure user defined property.
so not used in calculations. makes similar m has meaning specific dataset.
if elevation matters math perspective have add/minus after geography distance results. take care subtract higher elevation.
you adding 2 numbers (distance on surface) + (elevation delta). if use pythagoreans theorem have take account lot of subtle logic geography libraries doing you.
Comments
Post a Comment