algorithm - Computing overlaps of grids -


Say I have two maps, each of which is shown as a 2D array. Each map contains many different characteristics (rock, grass, plants, trees, etc.). I know that two maps are of the same general area, but I have to find out: 1.) If they overlap and 2.) If so, then where is it overlap? Does anyone know any algorithms that will help me do this?

Each feature is completely contained within an array index, although it is possible to understand a rock (for example) from the grass patches, yet one rock can be seen from the other ( Or a patches of grass from the other) is not possible to understand.

When doing this in <1d, I will be in the first collection (actually a string) for each index, try to find the greatest match in the second collection. If the match goes to the end, I overlap (like work ion and ion beam).

  Match (A to B): For each in length (A): See that A [i ..] B matches [0 ..] If no match was found: Do the same for A and B.  

For 2D, you do the same thing, basically: A's 'edge' overlaps with the opposite edge of B. Only the edges are not 1D, but for 2D:

  Find a line yb in each point xa, ya in A: B. which is a match on B [yb] (A [ Or]] See if A [or ..] corresponds to [yb ..]  

You have to do this for each diagonal.

< / Html>

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -