Struct street_index::gridconfig::Grid [−][src]
pub struct Grid { pub bbox: Bbox, pub config: GridConfig, // some fields omitted }
The Grid is your street-name grid. Right now there is no support for curved / rotated / translated grids.
Usually you'll want to initialize this from the page boundaries of your final map, i.e. if you have a map that is (on paper) 290 x 210 mm wide.
The config
is for future use to be extended - right now
it only stores how big the cells should be. In normal
cartography, grids are usually 5 x 5 centimeters (i.e. 50 x 50 mm).
Fields
bbox: Bbox
config: GridConfig
Methods
impl Grid
[src]
impl Grid
pub fn new(bbox: Bbox, config: GridConfig) -> Self
[src]
pub fn new(bbox: Bbox, config: GridConfig) -> Self
Initializes an empty grid from a bounding box + configuration
pub fn insert_street(&mut self, rect: StreetNameRect)
[src]
pub fn insert_street(&mut self, rect: StreetNameRect)
Inserts a street and assigns a GridPosition
(such as "A2" or "B4") to the
road. Note that a StreetNameRect
may span more than one rectangle, in which
case the road name will be duplicated
pub fn street_names(&self) -> Vec<InputStreetValue>
[src]
pub fn street_names(&self) -> Vec<InputStreetValue>
Returns all the fonts in the grid that were added previously
Trait Implementations
impl Debug for Grid
[src]
impl Debug for Grid
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Grid
[src]
impl Clone for Grid