
1 The Zones Algorithm for Finding Points-Near-a-Point or Cross-Matching Spatial Datasets Jim Gray, María A. Nieto-Santisteban, Alexander S. Szalay M
10 3. Summary Zones partition an N-Dimensional Euclidian or metric space to efficiently support points-near-a-point queries, either within a dataset
11 A. Appendix A.1. Defining and Populating The Sample Database ------------------------------------------------------------------------------- -- Sa
12 A.2. Define and Populate the Zone Indices ------------------------------------------------------------------------------- -- Create an populate th
13 ------------------------------------------------------------------------------- -- Procedure to populate the zone index. -- If you want to change
14 ----------------------------------------------------------------------- -- ZoneZone table maps each zone to zones which may have a cross m
15 A.3. Define And Use Points-Near-Point Function ------------------------------------------------------------------------------- -- GetNearbyObjects
16 go ------------------------------------------------------------------ -- Three test cases: declare @lat float , @lon float, @theta float s
17 A.4. Cross Match Places with Stations and Places with Places ------------------------------------------------------------------------------- -- CR
18 ------------------------------------------------------------------------------- -- SELF-MATCH EXAMPLE -------------------------------------------
2 2. Zone idea All index mechanisms use a coarse index to produce candidate objects which are then filtered by some predicate (see Figure 1.) Zon
3 If looking for all objects within a certain radius (θ) of point (ra, dec) then one need only look in certain zones, and only in certain parts of e
4 Figure 3: The search range of a zone expands near the poles. The diagram shows the need for α =180° if the pole is included and α ~90° very near
5 Equation (13) can be used to find the maximum value for tan α in equation (8). First refractor (8) to isolate the φ terms by dividing the nominato
6 2.2. Handling margins if there is wrap-around Given a zone table for all cities, if we ask for places within 10 arc minutes of Greenwich, UK (lat,
7 With margins added to the ZoneIndex table, the original query works correctly near the prime meridian. select objID
8 So, cross-match of a zone with itself is: select Z1.objID as ObjID1, Z2.objID as ObjID2 -- get object pairs into #answer
9 Unfortunately, the SQL Server optimizer is not smart enough to recognize that it can optimize this plan – it scans all objects in all qualifying zo
Komentáře k této Příručce