LogoLogo
HomeDocumentationLoginTry for free
  • CARTO Academy
  • Working with geospatial data
    • Geospatial data: the basics
      • What is location data?
      • Types of location data
      • Changing between types of geographical support
    • Optimizing your data for spatial analysis
    • Introduction to Spatial Indexes
      • Spatial Index support in CARTO
      • Create or enrich an index
      • Work with unique Spatial Index properties
      • Scaling common geoprocessing tasks with Spatial Indexes
      • Using Spatial Indexes for analysis
        • Calculating traffic accident rates
        • Which cell phone towers serve the most people?
    • The modern geospatial analysis stack
      • Spatial data management and analytics with CARTO QGIS Plugin
      • Using data from a REST API for real-time updates
  • Building interactive maps
    • Introduction to CARTO Builder
    • Data sources & map layers
    • Widgets & SQL Parameters
    • AI Agents
    • Data visualization
      • Build a dashboard with styled point locations
      • Style qualitative data using hex color codes
      • Create an animated visualization with time series
      • Visualize administrative regions by defined zoom levels
      • Build a dashboard to understand historic weather events
      • Customize your visualization with tailored-made basemaps
      • Visualize static geometries with attributes varying over time
      • Mapping the precipitation impact of Hurricane Milton with raster data
    • Data analysis
      • Filtering multiple data sources simultaneously with SQL Parameters
      • Generate a dynamic index based on user-defined weighted variables
      • Create a dashboard with user-defined analysis using SQL Parameters
      • Analyzing multiple drive-time catchment areas dynamically
      • Extract insights from your maps with AI Agents
    • Sharing and collaborating
      • Dynamically control your maps using URL parameters
      • Embedding maps in BI platforms
    • Solving geospatial use-cases
      • Build a store performance monitoring dashboard for retail stores in the USA
      • Analyzing Airbnb ratings in Los Angeles
      • Assessing the damages of La Palma Volcano
    • CARTO Map Gallery
  • Creating workflows
    • Introduction to CARTO Workflows
    • Step-by-step tutorials
      • Creating a composite score for fire risk
      • Spatial Scoring: Measuring merchant attractiveness and performance
      • Using crime data & spatial analysis to assess home insurance risk
      • Identify the best billboards and stores for a multi-channel product launch campaign
      • Estimate the population covered by LTE cells
      • A no-code approach to optimizing OOH advertising locations
      • Optimizing site selection for EV charging stations
      • How to optimize location planning for wind turbines
      • Calculate population living around top retail locations
      • Identifying customers potentially affected by an active fire in California
      • Finding stores in areas with weather risks
      • How to run scalable routing analysis the easy way
      • Geomarketing techniques for targeting sportswear consumers
      • How to use GenAI to optimize your spatial analysis
      • Analyzing origin and destination patterns
      • Understanding accident hotspots
      • Real-Time Flood Claims Analysis
      • Train a classification model to estimate customer churn
      • Space-time anomaly detection for real-time portfolio management
      • Identify buildings in areas with a deficit of cell network antennas
    • Workflow templates
      • Data Preparation
      • Data Enrichment
      • Spatial Indexes
      • Spatial Analysis
      • Generating new spatial data
      • Statistics
      • Retail and CPG
      • Telco
      • Insurance
      • Out Of Home Advertising
      • BigQuery ML
      • Snowflake ML
  • Advanced spatial analytics
    • Introduction to the Analytics Toolbox
    • Spatial Analytics for BigQuery
      • Step-by-step tutorials
        • How to create a composite score with your spatial data
        • Space-time hotspot analysis: Identifying traffic accident hotspots
        • Spacetime hotspot classification: Understanding collision patterns
        • Time series clustering: Identifying areas with similar traffic accident patterns
        • Detecting space-time anomalous regions to improve real estate portfolio management (quick start)
        • Detecting space-time anomalous regions to improve real estate portfolio management
        • Computing the spatial autocorrelation of POIs locations in Berlin
        • Identifying amenity hotspots in Stockholm
        • Applying GWR to understand Airbnb listings prices
        • Analyzing signal coverage with line-of-sight calculation and path loss estimation
        • Generating trade areas based on drive/walk-time isolines
        • Geocoding your address data
        • Find similar locations based on their trade areas
        • Calculating market penetration in CPG with merchant universe matching
        • Measuring merchant attractiveness and performance in CPG with spatial scores
        • Segmenting CPG merchants using trade areas characteristics
        • Store cannibalization: quantifying the effect of opening new stores on your existing network
        • Find Twin Areas of top-performing stores
        • Opening a new Pizza Hut location in Honolulu
        • An H3 grid of Starbucks locations and simple cannibalization analysis
        • Data enrichment using the Data Observatory
        • New police stations based on Chicago crime location clusters
        • Interpolating elevation along a road using kriging
        • Analyzing weather stations coverage using a Voronoi diagram
        • A NYC subway connection graph using Delaunay triangulation
        • Computing US airport connections and route interpolations
        • Identifying earthquake-prone areas in the state of California
        • Bikeshare stations within a San Francisco buffer
        • Census areas in the UK within tiles of multiple resolutions
        • Creating simple tilesets
        • Creating spatial index tilesets
        • Creating aggregation tilesets
        • Using raster and vector data to calculate total rooftop PV potential in the US
        • Using the routing module
      • About Analytics Toolbox regions
    • Spatial Analytics for Snowflake
      • Step-by-step tutorials
        • How to create a composite score with your spatial data
        • Space-time hotspot analysis: Identifying traffic accident hotspots
        • Computing the spatial autocorrelation of POIs locations in Berlin
        • Identifying amenity hotspots in Stockholm
        • Applying GWR to understand Airbnb listings prices
        • Opening a new Pizza Hut location in Honolulu
        • Generating trade areas based on drive/walk-time isolines
        • Geocoding your address data
        • Creating spatial index tilesets
        • A Quadkey grid of stores locations and simple cannibalization analysis
        • Minkowski distance to perform cannibalization analysis
        • Computing US airport connections and route interpolations
        • New supplier offices based on store locations clusters
        • Analyzing store location coverage using a Voronoi diagram
        • Enrichment of catchment areas for store characterization
        • Data enrichment using the Data Observatory
    • Spatial Analytics for Redshift
      • Step-by-step tutorials
        • Generating trade areas based on drive/walk-time isolines
        • Geocoding your address data
        • Creating spatial index tilesets
Powered by GitBook
On this page
  • Context
  • Prepare Hurrican Milton raster dataset
  • Upload your raster data using CARTO Raster Loader
  • Using import interface
  • Using CARTO raster loader
  • Analyze impact of Hurricane Milton precipitation on Points of Interest
  • Create an interactive dashboard to visualize the impact

Was this helpful?

Export as PDF
  1. Building interactive maps
  2. Data visualization

Mapping the precipitation impact of Hurricane Milton with raster data

Last updated 1 month ago

Was this helpful?

Context

In this tutorial, you'll learn how to visualize and analyze raster precipitation data from Hurricane Milton in CARTO. We’ll guide you through the preparation, upload, and styling of raster data, helping you extract meaningful insights from the hurricane’s impact.

Hurricane Milton was a Category 3 storm that made landfall on October 9, 2024. At its peak, it was the fifth-most intense Atlantic hurricane on record, causing a tornado outbreak, heavy precipitation, and strong winds.

By the end of this tutorial, you’ll create an interactive dashboard in CARTO Builder, combining raster precipitation data with Points of Interest (POIs) and hurricane track to assess the storm’s impact.

In this guide, you'll learn to:

Prepare Hurrican Milton raster dataset

Before analyzing the storm's impact, we need to set up the environment and prepare the precipitation raster dataset from PRISM, recorded on November 10, 2024. This dataset provides critical insights into rainfall distribution, helping us assess the storm's intensity and affected areas.

Required raster data format

Before uploading raster data to your data warehouse, ensure it meets the following requirements::

  • Cloud Optimized GeoTiff (COG)

  • Google Maps Tiling Schema

  1. Set up your Python environment

To ensure a clean and controlled setup, use a Python virtual environment where we’ll execute the data preparation and upload process.

Check Python Installation

Ensure Python 3 is installed by running:

python3 --version

Create and Activate a Virtual Environment

Run the following command to create a virtual environment and activate it:

For Linux/macOS:

python3 -m venv carto_raster_env
source carto_raster_env/bin/activate

For Windows:

python3 -m venv carto_raster_env
carto_raster_env\Scripts\activate
  1. Install GDAL in the Virtual Environment

GDAL is required to process raster data. However, if GDAL is not installed in your virtual environment, you may need to install it manually.

First, install system dependencies:

On macOS (via Homebrew):

brew install gdal

On Ubuntu/Debian:

sudo apt update && sudo apt install gdal-bin libgdal-dev

On Windows: If you're using OSGeo4W, install GDAL from there. Alternatively, you can use conda:

conda install -c conda-forge gdal

Now, install GDAL inside your virtual environment:

pip install GDAL

If GDAL fails to install inside the virtual environment, you might need to specify the correct version matching your system dependencies.

  1. Extract Metadata from the Precipitation Raster

Inspect the raster file’s metadata using GDAL:

gdalinfo usa_precipitation_10102024.tif

This command provides details such as:

  • Projection and coordinate system

  • Pixel resolution

  • Band information

  • NoData values (if any)

Understanding this metadata is crucial before performing reprojection, resampling, or further transformations.

  1. Convert GeoTIFF to Cloud Optimize GeoTIFF (COG)

To ensure compatibility with CARTO, convert the GeoTIFF into a Cloud Optimized GeoTIFF (COG) with Google Maps Tiling Schema:

gdalwarp -of COG \
-co TILING_SCHEME=GoogleMapsCompatible \
-co COMPRESS=DEFLATE \
-co OVERVIEWS=IGNORE_EXISTING \
-co ADD_ALPHA=NO \
-co RESAMPLING=NEAREST \
-co BLOCKSIZE=512 \
usa_precipitation_10102024.tif usa_precipitation_10102024_cog.tif

Your raster data is now ready for uploading to CARTO.


Upload your raster data using CARTO Raster Loader

There're two options to upload your raster COG to your data warahouse:

Using import interface

Navigate to Data Explorer → Click "Import data" (top right). Upload your COG raster file and store it in CARTO Data Warehouse > Shared Dataset for compatibility with other demo datasets.

Once your raster has been successfully uploaded, you'll be able to inspect the raster source in the Map Preview as well as inspecting its metadata and details.

Using CARTO raster loader

  1. Install CARTO Raster Loader

The raster-loader library can be installed from pip; installing it in the virtual environment we created earlier.

pip install raster-loader
  1. Authenticate to Google Cloud

In order to create raster tables in BigQuery using Raster Loader, you will need to be authenticated in Google Cloud. Run this command:

gcloud auth application-default login
  1. Execute the uploading process to BigQuery

The basic command to upload a COG to BigQuery as a CARTO raster table is:

carto bigquery upload \
  --file_path usa_precipitation_10102024_cog.tif \
  --project your_project \
  --dataset your_dataset \
  --table usa_precipitation_10102024_cog \
  --overwrite

Once the upload process has been successful, you'll be able to visualize and analyze it directly from CARTO.


Analyze impact of Hurricane Milton precipitation on Points of Interest

We’ll use CARTO Workflows to analyze which POIs were impacted by extreme precipitation during Hurricane Milton.

  1. Go to Workflows page, and select "Create workflow". Choose the CARTO Data Warehouse connection, as we'll be working with sample data available there.

  1. Now, let's add OSM POIs for the USA, available in CARTO Data Warehouse > demo_tables > osm_pois_usa from the Sources panel by dragging the source into the canvas.

  1. Set a name for your Workflows, we'll call it "Analyzing Hurricane Milton impact".

  2. Now, we want to identify the POIs that fall within the Hurricane Milton track on the 10th of November, 2024. To do so, we'll use the Spatial Filter component using the "Intersects" method. When configured, click "Run".

CARTO Workflows contains Raster components to perform analysis between vector and raster sources. In our case, we're interested on retrieving the precipitation values from our raster source to enrich the POIs dataset. To do so, we want to convert first our points to polygons so we can use the Extract and aggregate raster component.

  1. Using the ST Buffer component, set a buffer of around 10 meters from the POIs point location.

  1. Now, let's add our raster source into the canvas, that should be saved in the Shared folder of our CARTO Data Warehouse. You can use the Map Preview to visualize the raster data in Workflows.

  1. Add the Extract and aggregate raster Component and connect both the buffered POIs and the raster precipitation source. Set the aggregated band_1 with the operation AVG, and use the osm_id as the column to group by. This will ensure that every POI is enriched with the raster avg precipitation on the intersecting pixel.

  1. As we want the enriched POIs for visualization purpose, we'll need to join these stats back with the original OSM spatial column. To do so, we'll first use the SELECT component to retrieve just the spatial column and the identifier from the original source.

SELECT osm_id, geom
  1. Now, use the JOIN component to add the spatial column into our enriched POIs using the osm_id in both sources and the Left method.

  1. Finally, we'll save the resulting outputs that we want to use in Builder as tables. For that, add one Save as table component for the Hurricane Milton track and another one for the enriched POIs, saving both in CARTO Data Warehouse > Shared.

Once you're buildings have been enriched by the avg precipitation from Hurrican Milton, we're able to visualize the impact using CARTO Builder, our map making tool where you can easily create interactive dashboards visualizing both vector and raster sources.


Create an interactive dashboard to visualize the impact

  1. Go to maps, and click on "Create a map" option.

  1. A Builder map opens in a new tab. Rename the Builder map "Analyzing Hurricane Milton impact".

  2. Using the "Add sources from" button, load the enriched POIs, the Hurricane Milton track and the raster precipitation sources into the map:

  • CARTO Data Warehouse > Shared > hurricane_milton_pois

  • CARTO Data Warehouse > Shared > hurricane_milton_track

  • CARTO Data Warehouse > Shared > usa_precipitation_101024

  1. Rename the layers to the following, ensuring they keep the below order from top to bottom:

a. POIs (hurricane_milton_pois)

b. Hurricane Milton track (hurricane_milton_track)

c. Precipitation (usa_precipitation_10102024)

  1. Let's style the layers following the below configuration:

POIs Layer:

  • Visualization:

    • Zoom visibility: from 5 to 21

  • Simbol:

    • Radius:

      • Fixed: 3 px

  • Fill color:

    • Colored by band_1_avg

    • Palette: 4 Steps using ColorBrewer PuBu-4

    • Color scale: Quantile

  • Stroke

    • Stroke color:

      • Simple: #0d1b33

    • Stroke width:

      • Fixed: 0.5 px

Hurricane Milton track Layer:

  • Fill color:

    • Simple: #c1d2f9

    • Opacity: 1%

  • Stroke color:

    • Simple: #2168d8

    • Stroke width:

      • Fixed: 3.7 px

Precipitation:

  • Layer opacity: 10%

  • Palette: 7 Steps and SunsetDark @CARTOColors

Your map layers should look similar to this:

Formula widget

  • Title: Affected POIs

  • Operation: COUNT

  • Format: 12.3k

Histogram Widget

  • Title: POIs distribution by Avg Precipitation

  • Property: band_1_avg

  • Format: 12.3

Category Widget 1

  • Title: POIs by Max Precipitation

  • Operation: MAX

  • Group by property: name

  • Aggregation column: band_1_avg

Table Widget:

  • Title: Table View

  • Properties:

    • osm_id as Id

    • name as Name

    • group_name as Group name

    • subgroup_name as Subgroup name

    • band_1_avg as Avg Precipitation

Your map should look similar to this:

  1. Now, we'll enable Interactions by adding properties to both the POIs and raster layers so users can retrieving insights by clicking on the map.

  1. Customize the Legend by setting the right label for your properties.

  2. Access the Map settings for viewers and activate the tools you want end-users to access.

  1. Then, go to Preview mode and check that the map looks as desired. Once your map is ready, you can share it with specific users, SSO groups or the entire organization.

Congrats, you're done! Your map should look similar to this:

If not installed, download it from .

Once the environment is set up, download the PRISM precipitation raster file available in this and store it in the same project directory where your virtual environment is located.

: Recommended for small files (<1GB) that don’t require advanced settings.

: Ideal for larger files (>1GB) or when you need more control (e.g., chunk size, compression).

The is a Python utility that can import a COG raster file to Google BigQuery, Snowflake and Databricks as a CARTO raster table. In our case, we'll be importing data to BigQuery.

To identify the impacted POIs we'll use the Hurricane Milton Track boundary. To import this dataset, use the Import from URL component including this in the Source URL parameter.

Now let's add some linked to the POIs to allow users retreiving insights. We'll add the following widgets:

Python.org
bucket
CARTO Raster Loader
URL
Widgets
Prepare Hurricane Milton raster dataset
Upload your raster data using CARTO Raster Loader
Analyze impact of Hurricane Milton precipitation on Points of Interest
Create an interactive dashboard to visualize the impact
Using import interface
Using CARTO raster loader
Intermediate difficulty banner