Skip to content

Visualize Data with Dekart

You can leverage Wherobots' scalable compute directly within Dekart, an open-source tool that creates rich, interactive map visualizations from large-scale spatial SQL queries.

This integration allows you to run Wherobots-powered analysis and visualize your results on a map within the Dekart platform.

Benefits

The Dekart Integration allows you to:

  • Directly Query Wherobots: Run spatial SQL queries on your data in Wherobots without leaving the Dekart interface.
  • Visualize Large Datasets: Render maps with hundreds of thousands or even millions of points and polygons.
  • Create Multi-Layer Maps: Combine results from multiple queries as distinct layers on a single map to discover spatial relationships.
  • Collaborate and Share: Securely share your interactive maps and insights with your team or make them public.

Before you start

Before using this feature, ensure that you have the following required resources:

  • An Account within Community, Professional, or Enterprise Create a Wherobots Account.
    • Both Admin and User roles have access to this integration.
  • A Wherobots API key.
  • A running workspace instance of Dekart. For more information or to create a Dekart Workspace, click Create Free Workspace on the Dekart Website.
    • You must be an Admin of your Dekart Workspace to add a Connection. However, both Admins and Editors can execute queries once the connection is established.

Connecting Dekart to Wherobots

To connect your Wherobots Organization to Dekart, do the following:

  1. In Dekart, go to Connections.
  2. Click Add connection.
  3. Select Wherobots from the list of data sources.
  4. In the connection dialog box, enter the following:
    • Connection Name: A descriptive name for your connection.
    • Host: This is pre-filled with the Wherobots API endpoint, api.cloud.wherobots.com.
    • API Key: Paste your Wherobots API Key.
    • Runtime: Select the desired compute runtime size. Community Edition Organizations only have access to the Tiny runtime.
    • Region: Select your AWS region.
  5. Click Test Connection to verify the details, then click Save.

    You can confirm the connection in the Connections section of Dekart.

Querying data and visualizing results

After saving the connection, you will be returned to the map view.

To write a query in Dekart, do the following:

  1. Click > New Map. Image
  2. Click on the Wherobots button in the right-hand panel to open the query editor.
  3. Write your spatial SQL query in the editor.

    To review an example query, see Example Query.

  4. Click the Execute button (play icon) at the bottom right of the query editor. The query status will show as pending, then running.

    Once the query is complete, the data is downloaded and will appear as a new layer on your map and in the Layers panel on the left.

Share your map

To share your new Dekart visualization, click the Share button at the top right of your map to configure sharing permissions and distribute your map.

Example query

This query finds all food and beverage establishments in San Francisco that were added to the dataset since January 1, 2023.

You can execute the following query in Dekart:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SELECT DISTINCT
  ST_AsBinary(p.geom) as geometry,
  p.name,
  p.fsq_category_labels,
  p.address
FROM
  wherobots_open_data.foursquare.places p
LATERAL VIEW
  explode(p.fsq_category_labels) t AS category_label
WHERE
  p.locality = 'San Francisco'
  AND p.date_created >= '2023-01-01'
  AND p.region = 'CA'
  AND t.category_label LIKE 'Dining and Drinking%'

You can use this query as a starting point. Paste it into Dekart and edit it to fit your business needs. 🚀

How it works

  • It filters for places in San Francisco, CA, established on or after January 1, 2023.
  • The LATERAL VIEW explode(...) combined with LIKE 'Dining and Drinking%' finds all businesses in the 'Dining and Drinking' category and its subcategories (like restaurants, bars, and cafés).

Best Practices for writing queries

To ensure your spatial SQL queries run efficiently and visualize correctly in Dekart, keep the following best practices in mind:

  • Review the Table Schema: Before writing a query, review the corresponding schema of your table in the Wherobots Spatial Catalog. This tells you the exact column names (e.g., fsq_category_labels, geom) and their data types (array, geometry).
  • Consult Official Category Lists: When filtering by category in Foursquare or Overture Maps, use their respective dataset documentation to find the correct names and understand the hierarchy. This is crucial for building accurate filters.
  • Use a geometry Column: While separate latitude and longitude columns are effective for mapping points, a single geometry column is required for visualizing other shapes like lines and polygons. Using a column formatted with a function like ST_AsBinary(p.geom) as geometry is a best practice, as it supports all spatial types.
  • Handle Hierarchies with LATERAL VIEW: To query hierarchical data stored in an array (e.g., finding all subcategories within a category), use the LATERAL VIEW explode() pattern combined with a LIKE 'Parent Category%' filter.
  • Use % for Wildcard Searches: Use the percent sign (%) as a wildcard in LIKE statements to match multiple characters.
  • Use Spatial Joins for Custom Areas: To filter data by a specific neighborhood, use a spatial join with functions like ST_Contains with a polygon boundary layer.

Visualize your own AWS S3 data

Wherobots allows you to connect to your S3 data, making your data queryable while ensuring that your data remains within your own environment.

Connect your private AWS S3 buckets to Wherobots using an S3 Integration to securely analyze your data directly from the source, with no need to move or copy it. After integrating your S3 bucket, you can query your table in Dekart with Wherobots compute.

Usage considerations

  • Initial Environment Spin-up: When you run your first query, Wherobots needs to spin up the compute environment. This initial startup can take up to two minutes. Subsequent queries will be much faster.