A friend of mine asked me a really interesting question, and I'm a little stumped. She's trying to determine from a given flight plan, which countries a plane will fly over. I was thinking the flight plan could be described as a linestring of (long, lat) points and then I could use STIntersect to see if they actually intersect. (I even found some code that shows some of this...)
DECLARE @g geometry;
DECLARE @h geometry;
--SET @g = geometry::STGeomFromText('LINESTRING(0 2, 2 0, 4 2)', 0);
SET @g = geometry::STGeomFromText('LINESTRING(0 1, 0 3, 0 4)',0);
SET @h = geometry::STGeomFromText('POINT(0 2)', 0);
The part I don't understand how to do is to eliminate as many "landmarks"/countries that are too far away. Do I just add a buffer value to the long/lat values so that instead of a series of lines, I get a series of rectangles? (Or should I have all of my landmarks stored in a table, and filter the table on as many attributes as necessary to reduce the set of points/polygons to something manageable?
(Or do I need to read up on spatial indexes?)
Sorry for the thinking out loud, but I haven't done a lot with geography data types in forever. If there are any useful resources for this, feel free to point them out.
- This topic was modified 6 months, 3 weeks ago by pietlinden.