World Map Widget#

The World Map widget visualizes geographic data on a world map.

For this widget to work, the items need to be tagged with geographic coordinates.

The widget offers map view and satellite view along with zoom and search functionality.

Tip: Dragging and zooming the map causes the dashboard to filter by the markers visible on the widget.

Squirro provides powerful tools for map-based search visualizations within your projects.

Using the geo_point label type, you can attach coordinates to data you load into Squirro, allowing you to display the coordinates on a map or query the data using a geo-bounding box.

Region Maps#

Region Maps allow you to visualize data on a “geo heatmap”.

image1

Squirro provides the Region Map Widget widget, which packs over 20 default regions (such as the World by country, Europe by country, the US by state and more) which you can use to create geo heatmaps.

To use a Region Map, you need to tag your documents with an appropriate region code, then select that label in the Region Map widget.

Squirro supports the following codes by default;

  • ISO-A2 e.g. US, GB, DE, CH, CN

  • ISO-A3 e.g. USA, GBR, DEU, CHE, CHN

  • HASC

  • FIPS e.g. US, UK, GM, SZ, CH

Geo-Filtered Maps#

Using the geo_point label type, you can attach coordinates to data you load into Squirro, allowing you to display the coordinates on a map or query the data using a geo-bounding box.

Data Loading#

To use a field as a geo-location for filtering, in the labels mapping you need to define that field as “geo_point” type. The format of field is “latitude,longitude” (to remember, just follow alphabetic order: lat is before lon) for example: office_location: “47.37,8.54”

If you have multiple values for a location field then you can separate them by space, e.g. office_location:”47.37,2.17 41.38,8.54” and define the delimiter when loading the data. We allow to have multiple geo_point fields in an item, e.g home_location, office_location

Example of a geo_point label field:

"office_location" : {
    "name" : "office_location",
    "data_type" : "geo_point",
    "searchable" : true,
    "visible" : false,
    "typeahead" : false,
    "group_name" : "Location",
    "delimiter": " "
}

Working with Coordinates

Use this tool to check coordinate of a place: https://www.latlong.net/. If you have a coordinates pair (lat,lon), you can copy-pase to maps.google.com to see where it is.

Example: https://www.google.ch/maps/place/47.37,8.54

Visualization#

Once you have data loaded containing geo_point labels, you can use the Map widget type in your dashboard.

image21

Query Syntax#

To restrict the returned items to a specific geographic region, you can apply a field filter query.

This geo filter value can take three different forms:

  • lat,lon for searching on one spot,

  • lat,lon,radius to search within a circle (radius unit is kilometer), or

  • lat1,lon1,lat2,lon2 to search in an envelope.

For example:

To filter all items which have the field office_location is geo_point type, in the radius of 10km around coordinates 47.37,8.54: query=office_location:47.37,8.54,10

To filter all items in a bounding box 47.37,2.17 and 41.38,8.54 based on office_location field: query=office_location:47.37,2.17,41.38,8.54

To filter all items which have office_location or home_location in a radius 10km of given point: office_location:47.37,8.54,10 OR home_location:47.37,8.54,10

Order of Coordinates in a Bounding Box#

When doing geo filter query, e.g. location:lat1,lon1,lat2,lon2, we always confuse what are lat1,lon1,lat2,lon2? In elasticsearch, the order of envelope must be top_left,bottom_right.

Look at the example below, if you want to have an envelope (or bounding box) to filter all locations between Zurich (47.37,8.54) (NorthEast) and Barcelona (41.38,2.17) (SouthWest) then the bounding box should be: top,left,bottom,right=big_lat,small_lon,small_lat,big_lon=NorthEast.lat,SouthWest.lon,SouthWest.lat,NorthEast.lon=47.37,2.17,41.38,8.54

image22

Quick Tutorial#

  1. Create a new project like “Earthquakes”

  2. Load earthquakes.xlsx via the Excel dataloader

  3. Label configuration (see screenshot below)

    1. Configure the Geopoint field to be a label of type Geo_point

    2. Configure Datetime field as a label with the format %A, %B %d, %Y %H:%M:%S %Z

  4. Create a dashboard containing a Map widget and set it to use Geopoint as the label

image23