OxiGDAL Tile Server
WMS/WMTS tile server for serving geospatial raster data over HTTP, powered by OxiGDAL.
Features
-
WMS 1.3.0: Full Web Map Service support
- GetCapabilities
- GetMap
- GetFeatureInfo
-
WMTS 1.0.0: Web Map Tile Service
- GetCapabilities
- GetTile (KVP and RESTful)
- Multiple tile matrix sets (Web Mercator, WGS84)
-
XYZ Tiles: Simple tile serving
- Compatible with Leaflet, MapLibre, OpenLayers
- TileJSON support
-
High Performance
- Async/await with Tokio
- Multi-level caching (memory + disk)
- LRU cache eviction
- Configurable tile sizes
-
Pure Rust
- No C/C++ dependencies
- Memory safe
- Fast compilation
Installation
From Source
Using Cargo
Quick Start
1. Generate a Configuration File
2. Edit the Configuration
Edit config.toml to add your datasets:
[[]]
= "landsat"
= "/path/to/landsat.tif"
= ["png", "jpeg"]
= 256
3. Start the Server
The server will start on http://0.0.0.0:8080 by default.
Configuration
Server Settings
[]
= "0.0.0.0" # Bind address
= 8080 # Bind port
= 4 # Number of worker threads (0 = auto)
= true # Enable CORS
Cache Settings
[]
= 256 # In-memory cache size
= "/tmp/cache" # Optional disk cache
= 3600 # Cache TTL
Layer Configuration
[[]]
= "my-layer" # Layer identifier
= "My Layer" # Display name
= "/data/layer.tif" # Path to GeoTIFF
= ["png", "jpeg"] # Supported formats
= 256 # Tile size in pixels
= 0 # Minimum zoom level
= 18 # Maximum zoom level
API Endpoints
WMS
GET /wms?SERVICE=WMS&REQUEST=GetCapabilities
GET /wms?SERVICE=WMS&REQUEST=GetMap&LAYERS=landsat&BBOX=-180,-90,180,90&WIDTH=512&HEIGHT=512&FORMAT=image/png
GET /wms?SERVICE=WMS&REQUEST=GetFeatureInfo&...
WMTS
GET /wmts?SERVICE=WMTS&REQUEST=GetCapabilities
GET /wmts/1.0.0/{layer}/{tileMatrixSet}/{z}/{x}/{y}.png
XYZ Tiles
GET /tiles/{layer}/{z}/{x}/{y}.png
GET /tiles/{layer}/tilejson
Utility Endpoints
GET / # Landing page
GET /health # Health check
GET /stats # Cache statistics
Usage Examples
Leaflet
const map = .;
.;
MapLibre GL JS
const map = ;
QGIS
- Add WMS/WMTS connection
- URL:
http://localhost:8080/wmsorhttp://localhost:8080/wmts - Select layers to display
Command-Line Options
)
)
)
Environment Variables
OXIGDAL_HOST: Server host addressOXIGDAL_PORT: Server portOXIGDAL_WORKERS: Number of worker threadsOXIGDAL_LOG_LEVEL: Log level (trace, debug, info, warn, error)
Docker
Build
Run
Performance Tuning
Cache Size
Increase memory cache for better performance:
[]
= 1024 # 1 GB
Workers
Set workers based on your CPU:
[]
= 8 # Or use 0 for auto-detection
Disk Cache
Enable disk cache for persistence:
[]
= "/var/cache/oxigdal"
Monitoring
Cache Statistics
Returns cache hit/miss rates and memory usage.
Health Check
Returns server status.
Troubleshooting
Server won't start
- Check configuration file syntax
- Verify dataset paths exist
- Ensure port is not in use
- Check log output with
--log-level debug
Tiles not rendering
- Verify layer is enabled in config
- Check dataset format is supported
- Verify tile coordinates are valid
- Check server logs for errors
Performance issues
- Increase cache size
- Enable disk caching
- Adjust worker count
- Use appropriate tile sizes
Development
Building
Testing
Running locally
License
Apache-2.0
Contributing
Contributions are welcome! Please see the main OxiGDAL repository.
Authors
COOLJAPAN OU (Team Kitasan)