Map location data with Axiom and Hex
This page exlains how to visualize geospatial log data from Axiom using Hex interactive maps.
Hex is a powerful collaborative data platform that allows you to create notebooks with Python/SQL code and interactive visualizations.
This page explains how to integrate Hex with Axiom to visualize geospatial data from your logs. You ingest location data into Axiom, query it using APL, and create interactive map visualizations in Hex.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to update the dataset you have created.
Send geospatial data to Axiom
Send your sample location data to Axiom using the API endpoint. For example, the following HTTP request sends sample robot location data with latitude, longitude, status, and satellite information.
- Replace
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable. - Replace
DATASET_NAME
with the name of the Axiom dataset where you want to send data.
- Replace
AXIOM_DOMAIN
withapi.axiom.co
if your organization uses the US region, and withapi.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Verify that your data has been ingested correctly by running an APL query in the Axiom UI.
Set up your Hex project
- Create a new Hex project. For more information, see the Hex documentation.
- Save your Axiom API token as a secret in Hex. This example uses the secret name
AXIOM_API_TOKEN
. For more information, see the Hex documentation.
Query data from Axiom
Write the Python code in your Hex notebook that retrieves data from Axiom. For example, customize the code below:
- Replace
AXIOM_DOMAIN
withapi.axiom.co
if your organization uses the US region, and withapi.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
- Replace
DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Create map visualisation
Create an interactive map visualization in Hex and customize it. For more information, see the Hex documentation.