When a spatial query is executed using Studio, a Spatial Map view
displays the search results in graphical form.
The spatial map view is added only for dynamic
It is not added when spatial queries are executed over indexes.
A spatial query can define geographic regions shaped like circles or polygons and relate the search to these regions.
These regions can be displayed in the spatial map view, in addition to the document results.
Spatial Queries locate documents by geographic location, indicated by Latitude and Longitude coordinates.
An employee profile, for example, may include and be searched by spatial data.
Figure 1. Spatlal Data
You can name Coordinates' fields freely (not necessarily by the names "Latitude" and "Longitude").
Running a Dynamic Spatial Query
Figure 2. The Query Section
Open the Indexes section.
Figure 3. Running a Query
1. Query Box
Type your query in this area.
spatial.circle(20,47.623473, -122.3060097, 'miles')
Use spatial.point to specify the document field names containing the spatial data.
The Latitude field is always chosen first, and the Longitude field second.
2. Play Button
Click this button to execute the query.
The above query searches for documents whose Latitude and Longitude are within the specified circle.
Figure 4. Textual Results View
Spatial Map View
Figure 5. Spatial Map View
1. Spatial Map
If there are any resulting documents that match the spatial query, a Spatial Map tab is added
to the results view.
Click the tab to view the resulting documents in their geographical locations on the map.
2. Expand Results
Click to expand the spatial map.
Figure 6. Zoom and Drag
1. Zoom Control
Click +/- or roll your mouse wheel to zoom in and out.
Click anywhere in the map area and drag to move the map.
Figure 7. Region and Points
Figure 8. Same Points, Zoomed In
The region (a circle in this case) that was defined in the query.
2. Location Markers
A red marker locates a single document result.
Hovering over the marker pops up the document's name.
Clicking the marker pops up the document's contents.
A green marker gathers two or more neighboring red markers (documents).
Zooming in will reveal the individual locations.
The number on the green marker represents the number of documents gathered by this marker.
If a green marker gathers at least three document locations, hovering over it
would display a crude scheme of these locations on the map.
Clicking a green marker zooms in to reveal the locations it gathers.
Figure 12. Viewing-Options Tooltip
1. Viewing-Options Toggler
Hovering over the toggler will open the viewing options.
2. Viewing Options
The map view options.
3. Map View
Select Streets or Topography map.
4. Point Fields
When checked, the documents that contain these fields will be visible as marker points on the map.
Show or Hide circular/polygonal search regions.
Circular Region Example
The following query locates companies in two separate circular regions.
spatial.circle(200, 45.5137863, -122.675375, 'miles')
spatial.circle(200, 37.7774357, -122.418, 'miles')
Figure 13. Multiple Regions
Circular Region Syntax
A circular region can be defined using two different syntaxes,
spatial.circle and spatial.wkt.
spatial.circle(20, 47.623473, -122.3060097, 'miles')
spatial.wkt('CIRCLE(-122.3060097 47.623473 d=20)')
The search coordinates are provided in a different order for the two syntaxes.
For spatial.circle, provide the Longitude first and the Latitude second.
For spatial.wkt, provide the Latitude first and the Longitude second.
When multiple regions are defined, they are given different colors in the spatial map view.
Polygonal Region Example
The following query searches for companies within the boundaries of a polygonal (polygon-shaped) region.
This query searches for companies at the intersection of
a circular region and a polygonal region.
Though additional companies are located in each region,
only companies located in both regions are retrieved.
spatial.wkt('CIRCLE(-119.5 45.5137863 d=400)')