Algorithm 3.
SparkGIS Spatial Containment
| 1: | procedure NativeSpatialContainment(tile, region) |
| 2: | /* Use global index */ |
| 3: | if region contains tile then |
| 4: | append all objects in tile to result |
| 5: | else |
| 6: | if region intersects tile then |
| 7: | for each qualifying object in tile do |
| 8: | if region contains object then |
| 9: | append object to result |
| 10: | end if |
| 11: | end for |
| 12: | end if |
| 13: | end if |
| 14: | end procedure |