Triangulation of a position from three known points

Category: sql server spatial

Question

DJ Matt on Fri, 10 Oct 2014 21:48:02


Let's say I have three records in a database table with a known location in a geography column.

For ease of explanation let's say they're Houston, Seattle and New York.

Within the table is a field which has an integer distance value and the distance is miles from, say, Las Vegas.

Las Vegas isn't a known point in the database.  Is there a way I can triangulate the coordinate of Las Vegas from the three known coordinates and their distance values?

Replies

DJ Matt on Fri, 10 Oct 2014 22:01:05


Let's say I have three records in a database table with a known location in a geography column.

For ease of explanation let's say they're Houston, Seattle and New York.

Within the table is a field which has an integer distance value and the distance is miles from, say, Las Vegas.

Las Vegas isn't a known point in the database.  Is there a way I can triangulate the coordinate of Las Vegas from the three known coordinates and their distance values?

Cheer08 on Mon, 13 Oct 2014 12:44:18


I don't think the LasVegas's coordinate  can be reached from the three known coordinates and their distance values.

Bob Beauchemin on Mon, 13 Oct 2014 21:48:32


Your description of the problem defines it as trilateration (http://en.wikipedia.org/wiki/Trilateration ) rather than triangulation. Based on that description/diagram, you should be able to accomplish this by:

1. Using STBuffer or BufferWithCurves to buffer each point using its appropriate distance in meters.
2. Use STIntersection to find the intersection of the buffers (A/B, B/C, A/C).
3. Find the intersection of the three geography instances described in step 2.
4. Use EnvelopeCenter to get a "center" point of the geography instance from step 3.

Don't forget, when you use buffer against a geography type (step 1), the distance need to be specified in meters, not miles. Meters is the unit of measure unless you're using a strange SRID (consult sys.spatial_reference_systems for your SRID).

Hope this helps, Bob

 

DJ Matt on Wed, 15 Oct 2014 15:42:29


Bob,

This has been very useful.  Many thanks.