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? – BradHards Jan 21 '14 at 09:45
-
Do you mean intersection? if not, then what do you mean by 'intercept' and 'interception'? – Devdatta Tengshe Jan 21 '14 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) – simpleuser001 Jan 21 '14 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 Sousa Jan 31 '14 at 08: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.
- 3,935
- 1
- 29
- 61
-
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. – user26024 Jan 31 '14 at 02: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. – Luís de Sousa Jan 31 '14 at 08: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
- 3,271
- 18
- 24