I need to determine the WGS84 coordinates for a point that is defined by the interception of two segments represented by two sets of WGS84 coordinates each (lat1-long1, lat2-long2) and (lat3-long3, lat4-long4). Is there a free application that I might be able to use or even an excel formula?
-
Welcome to gis.SE. Are you expecting the results to be on the surface of the earth, or inside it?– BradHardsCommented Jan 21, 2014 at 9:45
-
Do you mean intersection? if not, then what do you mean by 'intercept' and 'interception'?– Devdatta TengsheCommented Jan 21, 2014 at 11:00
-
i would just do query into postgis server like : SELECT ST_Intersection(st_GeomFromtext('LINESTRING(x1 y1, x2, y1)',4326) , st_GeomFromtext('LINESTRING(x3 y3, x4, y4)',4326)– simpleuser001Commented Jan 21, 2014 at 13:16
-
ST_Intersection calculates the intersection along loxodromes, but only if both geographies fall in the same UTM zone. Otherwise it will calculate the intersection in a LAEA plannar space, which result is meaningless in this context.– Luís de SousaCommented Jan 31, 2014 at 8:47
2 Answers
If you are speaking of the loxodromes defined by these two pairs of coordinates then the easiest way is to project these coordinates with Mercator and then calculate the intersection in the Cartographic plane. You can then apply the inverse projection to get Geographic coordinates again.
If instead you are speaking of orthodromes then things aren't that simple. Spheres is the only software I am aware of that implements such calculation. You'll find some code snippets for Mathlab and Python on the web, but be careful trusting them.
-
Yes, I meant intersection on the surface of the earth. I have an airspace layout map and have a route that goes from a point inside this airspace into an adjacent airspace. I need to calculate the geographic coordinates in WGS84 format of the point where this route intersects the boundary line between the two adjacent airspaces. Commented Jan 31, 2014 at 2:46
-
Then you just need to decide if those lines are orthodromes or lexodromes. In a relatively small area the results are approximate and the simplest calculation with laxodromes may be feasible. Commented Jan 31, 2014 at 8:42
You can solve the geodesic intersection problem using the ellipsoidal gnomonic projection. The method is described in §8 of my paper, Algorithms for geodesics, and code to implement the solution using GeographicLib is available here