File size: 3,635 Bytes
b3709f8
 
cf04b43
ed3482e
 
b3709f8
cf04b43
b3709f8
 
 
 
a557eb6
 
 
 
972c66f
bbfa5b6
a557eb6
 
 
 
 
 
 
 
 
 
 
 
 
cf1870d
a557eb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf1870d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a557eb6
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
title: GeoSpatial-LiDAR-3D Point Cloud Visualizer
emoji: 🌎
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.2.0
app_file: app.py
pinned: false
---

# GeoSpatial-LiDAR-3D Point Cloud Visualizer

A web application for visualizing and analyzing LiDAR point cloud data in 3D.

![Python](https://img.shields.io/badge/Python-3.10+-blue)
![Gradio](https://img.shields.io/badge/Gradio-6.2.0-green)
![License](https://img.shields.io/badge/License-MIT-yellow)

## Features

- **LAS/LAZ Format Support**: Load and visualize LiDAR point cloud files
- **Multiple Color Modes**: RGB original colors, elevation-based colormaps, intensity visualization, and instance segmentation
- **Elevation Colormaps**: Choose from viridis, terrain, plasma, inferno, Spectral, and coolwarm
- **Instance Segmentation**: Visualize segmentation data with distinct colors for each instance
- **Interactive 3D Viewer**: Rotate, zoom, and pan through your point cloud data
- **Smart Subsampling**: Handle large datasets by limiting display points with customizable limits
- **Detailed Statistics**: View point counts, coordinate ranges, RGB presence, and segmentation information
- **Example Files**: Explore sample data with pre-loaded example point clouds
- **Public Sharing**: Generate and share live links to your visualizations
- **MCP Server Support**: Can run as an MCP (Model Context Protocol) server for integration with other tools and agents

## Supported Formats

| Format | Extension | Description |
|--------|-----------|-------------|
| LAS | `.las` | Standard uncompressed LiDAR format |
| LAZ | `.laz` | Compressed LiDAR format (recommended for large files) |

## Color Modes

- **RGB (Original)**: Display the original RGB colors from the point cloud file. Falls back to elevation colors if RGB data is unavailable
- **Instance Segmentation**: Color points based on their instance ID (PredInstance field). Assigns distinct colors to different instances
- **Elevation**: Color points by their height (Z coordinate) using your selected colormap
- **Intensity**: Display intensity values as grayscale, showing the reflectance properties of points

## Available Colormaps

The following colormaps are available for elevation and fallback visualization:

- **viridis**: Perceptually uniform colors that work well for colorblind viewers
- **terrain**: Classic elevation visualization with natural colors
- **plasma**: Warm colors from purple to yellow
- **inferno**: Dark to bright colors from black to yellow
- **Spectral**: Full rainbow spectrum for maximum contrast
- **coolwarm**: Cool to warm colors for intuitive interpretation

## Visualization Options

- **Max Points to Display**: Adjust the number of points displayed (50,000 to 2,000,000). Larger files are automatically subsampled for performance
- **Example Files**: Load pre-packaged sample files to quickly explore the visualizer's capabilities

## MCP Server Integration

This application can function as an MCP (Model Context Protocol) server, allowing it to be integrated with AI agents and other tools. 

To enable MCP server mode:

1. **Via launch parameter:**
```python
demo.launch(mcp_server=True)
```

2. **Via environment variable:**
```bash
GRADIO_MCP_SERVER=True python app.py
```

When running as an MCP server, each API endpoint becomes available as an MCP tool that can be called by compatible clients and AI agents.

## Contributing

We welcome contributions to improve this project. You can help by:
- Adding support for additional file formats
- Improving visualization performance
- Enhancing the user interface
- Adding more colormaps or visualization modes