A modern geospatial analysis platform for tracking changes in Brazilian CAR (Cadastro Ambiental Rural) property boundaries over time and their relationship to PRODES deforestation data. Built with Docker microservices architecture for scalable spatial analysis and interactive visualization.
Untitled.video.-.Made.with.Clipchamp.1.mp4
- Docker & Docker Compose (required)
- npm (for web development)
- Git (for repository management)
git clone <repository-url>
cd CCCA_CAR_Analysis
# Install dependencies and start services
make setup# Ingest CAR and PRODES data
make ingest-data
# Load data into PostGIS and run analysis
make load-data analyze
# Or run the full pipeline
make run-all# Start development web server
make web
# Web interface available at http://localhost:5173The platform consists of four main services:
- PostgreSQL/PostGIS (
:5432) - Spatial database for CAR and PRODES data - FastAPI Backend (
:8000) - RESTful API for data access and search - Martin Tile Server (
:3000) - High-performance vector tile serving - React Frontend (
:5173) - Interactive web interface with search and visualization
- Temporal Analysis: Compare CAR boundaries across multiple years
- Spatial Search: Trigram-based fuzzy search for property codes
- Interactive Maps: MapLibre GL-based visualization with vector tiles
- Change Detection: Identify geometry changes and PRODES intersections
- Performance Optimized: Spatial indexing and async operations
# Service Management
make start # Start all Docker services
make stop # Stop all services
make logs # View service logs
# Data Pipeline
make ingest-data # Download/ingest raw data
make load-data # Load data into PostGIS
make analyze # Run spatial analysis
make run-all # Complete pipeline
# Web Development
make web-install # Install npm dependencies
make web-dev # Start development server
make web-build # Build for production
# Database Access
make psql # Access PostgreSQL CLI
make clean # Remove all data and containers├── src/ # Python source code
│ ├── ingestion/ # Data ingestion scripts
│ └── processing/ # Analysis and database loading
├── web/ # React frontend application
├── docker/ # Docker configuration
├── docs/ # Detailed documentation
├── db/ # Database migrations and SQL
├── data/ # Raw data storage
└── Makefile # Automation commands
Place your data in the following structure:
data/
├── SICAR/
│ ├── 2023/ # CAR data for 2023
│ ├── 2024/ # CAR data for 2024
│ └── 2025/ # Latest year with state folders
│ ├── AC/ # Acre state data
│ ├── AM/ # Amazonas state data
│ └── ...
└── PRODES/
└── prodes_amazonia_nb.gpkg # PRODES deforestation data
- Installation Guide - Detailed setup and system requirements
- Development Guide - Development environment and workflow
- Architecture Overview - Technical system architecture
- Data Pipeline - Data ingestion and processing workflow
- Makefile Reference - Complete command reference
The platform includes advanced search capabilities:
- Property Code Search: Fuzzy search using PostgreSQL trigrams
- Spatial Navigation: Navigate to properties with geometry bounds
- Year Comparison: Toggle between different years for temporal analysis
- Real-time Suggestions: Debounced search with instant suggestions
- Coordinate System: SIRGAS 2000 (EPSG:4674)
- Coverage: Amazon region of Brazil
- Data Sources: SICAR (CAR registry), PRODES (deforestation alerts)
- Spatial Operations: PostGIS-powered geometric analysis
# Start development environment
make setup
# Run web development server with hot reload
make web-dev
# Access database for debugging
make psql
# View all service logs
make logs- Vector Tiles: Efficient map rendering with Martin tile server
- Spatial Indexing: GIST indexes for fast geometric queries
- Connection Pooling: Optimized database connections
- Async Operations: Non-blocking FastAPI endpoints
- Fork the repository
- Create a feature branch
- Set up development environment with
make setup - Make your changes
- Test with
make run-all - Submit a pull request
For a system design diagram, see the System Architecture documentation.