Suppose you are given an image of the earth's surface and that it is stored in the database as a polygon defined by pairs of latitude / longitude of its angles.
Now suppose that millions of images cover the earth's surface, which are also stored similarly. What is a good strategy for finding images that intersect with your image?
I have a working basic algorithm based on the "bounding radius" of images. But this is not optimal and finds more images than should be returned.
I looked at the spatial features of MySQL GIS, but all the calculations that seem to be done in Euclidean geometry.
In fact, I just need a function that returns true or false depending on whether the two polygons intersect (on a sphere and given by lat / long points). Seems simple, but I haven't found an implementation yet. And the thought of understanding it myself is tiring.
source
share