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
//! # GeoJSON Tile Renderer
//!
//! A high-performance Rust library for converting GeoJSON features to PNG tile images
//! using Web Mercator projection (EPSG:3857).
//!
//! ## Features
//!
//! - Render GeoJSON features (Polygon, LineString, Point, and Multi* variants) to PNG tiles
//! - Web Mercator projection for standard web mapping compatibility
//! - Configurable tile size and styling
//! - Async/parallel tile generation support
//! - Zero-copy optimizations for performance
//!
//! ## Example
//!
//! ```no_run
//! use geojson_tile_renderer::{TileRenderer, TileCoordinate, Settings, BackgroundColor};
//!
//! # fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a renderer with custom settings
//! let renderer = TileRenderer::builder()
//! .settings(
//! Settings::builder()
//! .size(512)
//! .background_color(BackgroundColor::white())
//! .build()?
//! )
//! .build()?;
//!
//! // Load GeoJSON data
//! let geojson_str = r#"{"type":"FeatureCollection","features":[]}"#;
//! let feature_collection: geojson::FeatureCollection = geojson_str.parse()?;
//!
//! // Render a tile
//! let tile = TileCoordinate::new(10, 163, 395)?;
//! let png_data = renderer.render(&feature_collection, tile)?;
//!
//! // Save the PNG data to a file
//! std::fs::write("tile.png", png_data)?;
//! # Ok(())
//! # }
//! ```
// Re-export commonly used types
pub use ;
pub use ;
pub use ;