Spatial Analysis in 2025: Key Trends Report
| Download Now
CARTO
Platform
Overview
Visualization
Analytics
App Development
Data Enrichment
AI Agents
Enterprise & Security
Pricing
CARTO for
Google Cloud
AWS
Azure
Snowflake
Databricks
Oracle
Solutions
By Industry
By Use Case
By Role
Telecoms
Icon/indus/Insurance-menu
Icon/indus/Insurance-menu-mobile
Insurance
Logistics
Real Estate
Financial Services
Retail
Marketing & Advertising
Mobility
All industries
Network Deployment
Catastrophe Modeling
Fraud Detection
Market Analysis
Environmental Management
Site Selection
Geomarketing
Data Monetization
IoT Analytics
Supply Chain Optimization
Healthcare Analytics
Territory Planning
All use cases
Data Analyst
Data Scientist
GIS Professional
Developer
Customers
Resources
Learn
Documentation
CARTO Academy
Blog
Reports
Glossary
Connect
Events
Partners
Webinars
Log inRequest a demo
Try for free
2050-01-01
1990-01-01
"ES", "GB"

This content applies to a previous version of CARTO

In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com

Back to Help Center

Symbology Challenge

Overview

This tutorial uses data with 4 duplicate points at each location, where each point represents a category. The goal is to separate these points in an orderly way while ensuring each category remains in the same relative position across all cities.

The key techniques involve using two marker-transform properties: rotate() and translate().

Step 1: Rotation

Determine the number of categories and divide 360 degrees among them for placement around the center point.

Method One: Database Field

Add a degree field and calculate rotation for each category:

UPDATE mamataakella.symbol_flowers
SET degrees = CASE
WHEN category = 'a' THEN 360
WHEN category = 'b' THEN 90
WHEN category = 'c' THEN 180
WHEN category = 'd' THEN 270
ELSE null
END

Method Two: CartoCSS Conditions

Write rotation directly into the CartoCSS if you have predetermined placement preferences.

Step 2: Choose an Image File

Select or upload a marker icon for your visualization.

Step 3: Symbolize Each Point

Apply colors to each category:

#layer {
  marker-width: 40;
  marker-fill: ramp([category], (#5F4690, #E65176, #38A6A5,#FF710F), ("a", "b", "c", "d"), "=");
  marker-fill-opacity: 0.9;
  marker-allow-overlap: true;
  marker-line-width: 1;
  marker-line-color: #FFF;
  marker-line-opacity: 1;
  marker-file: url('https://s3.amazonaws.com/com.cartodb.users-assets.production/maki-icons/marker-18.svg');
}

Step 4: Marker Transform - Rotate

Add rotation using your calculated degree field:

#layer {
  marker-width: 40;
  marker-fill: ramp([category], (#5F4690, #E65176, #38A6A5,#FF710F), ("a", "b", "c", "d"), "=");
  marker-fill-opacity: 0.9;
  marker-allow-overlap: true;
  marker-line-width: 1;
  marker-line-color: #FFF;
  marker-line-opacity: 1;
  marker-file: url('https://s3.amazonaws.com/com.cartodb.users-assets.production/maki-icons/marker-18.svg');
  marker-transform: rotate([degrees]);
}

Step 5: Marker Transform - Translate

Separate the rotated points using the translate property. Use approximately half your symbol size as a starting value:

#layer {
  marker-width: 40;
  marker-fill: ramp([category], (#5F4690, #E65176, #38A6A5,#FF710F), ("a", "b", "c", "d"), "=");
  marker-fill-opacity: 0.9;
  marker-allow-overlap: true;
  marker-line-width: 1;
  marker-line-color: #FFF;
  marker-line-opacity: 1;
  marker-file: url('https://s3.amazonaws.com/com.cartodb.users-assets.production/maki-icons/marker-18.svg');
  marker-transform: rotate([degrees]),translate(0,20);
}

Step 6: Adjustments

  • Reverse the translation direction to create an inward-facing flower effect: translate(0,-20)
  • Fine-tune the separation value based on your marker choice
  • The final map used translate(0,-13)
CARTO
carto-logo
  • Platform

  • Overview

  • Visualization

  • Analytics

  • App Development

  • Data Enrichment

  • Security & Governance

  • Gen AI

  • Pricing

  • Solutions

  • Data Analyst

  • Developer

  • Data Scientist

  • GIS Professional

  • By Industry

  • By Use Case

  • Resources

  • Customer Stories

  • Blog

  • Glossary

  • Documentation

  • Academy

  • Reports

  • Events

  • Webinars

  • Partners

  • Company

  • About us

  • Newsroom

  • Careers

  • Brand

  • Grants

Unlock the power of spatial analysis.

youtube logofacebook logotwitter logolinkedin logo

© CARTO 2024

Terms

Privacy Notice

Whistleblower Form