Crate cartography

Crate cartography 

Source
Expand description

stable pipeline dev/1 pipeline docs crates.io

§cartography

This project provides a generic map rendering library. It is intended to have a simple design, and simple API, for ease of integration in existing rendering pipelines, and ease of maintenance.

cartography is meant to be simpler, less sophisticated than galileo and maplibre-rs, however both projects are unfinished, on life support and are rather complex. cartography has a much simpler design and API, which seem to be sufficient for my projects.

Development occurs in the dev/1 branch.

§Examples

To get started, look into our examples.

Example with egui World Viewer example of a world map shown with the egui integration.

Re-exports§

pub use geo;

Modules§

egui
Integration with egui.
geojson
geojson integration
utils
Utility module
vello
Vello renderer.

Macros§

composite_feature
Sometime it is desirable to compose different type of Feature in an enum. This macro allows to define such a composite feature. It will automatically generate an implementation of the Feature trait that dispatch to the values. as well as generate From and TryFrom traits.
try_from_feature
Convenient macro to generate the TryInto for references needed to cast a Feature to a child. For example:

Structs§

FeaturesVecLayer
Standard implementation of a Layer containing a vector of features
GeoImage
GeoImage is an image with meta geo meta information
ImageFeature
Alias to Image for implementing feature, to workaround rust limitation in term of generic trait implementation.
Map
Cartography map
MapBuilder
Cartography map builder
Projection
Represnt a CRS Projection
Rgba
Color
Style
Map Style, build using SyleBuilder.
StyleBuilder
Used for defining the style of the map
Symbol
Symbol on how to draw the feature
SymbolColor
Define color for symbols
Tile
Represent a tile in a tile map (such as coming from OSM tile server).
TilesClientBuilder
Client configuration
TilesLayer
Allow to use tile from a tile server in a rendered map.

Enums§

GeometryType
Enumerate of the different geometry type
ProjectionUnit
Unit for the values
RefOrValue
Represent a value that could be a reference or a value.

Traits§

Feature
Trait for features
GeometryRef
Trait that can be implemented for a feature that can return a reference to a geometry
ImageData
Base trait for image data.
IntoLayer
Trait for converting into a layer
Layer
Trait for Map Layers

Functions§

load_image_from_memory
Open an image with the image crate
open_image
Open an image with the image crate
rgb
Create a new Rgb color (with a = 1.0, fully opaque).
rgba
Create a new Rgba color
transform
Transform coordinate from one projection to an other

Type Aliases§

BoxedImageDataRef
Boxed reference to an image.
ImagesVecLayer
Layer for a vector of boxed images
Result
Result<T, Error>