bordado.pad_region#
- bordado.pad_region(region, pad)[source]#
Extend the borders of a region by the given amount.
- Parameters:
- region
tuple
= (W
,E
,S
,N
, …) The boundaries of a given region in Cartesian or geographic coordinates. Should have a lower and an upper boundary for each dimension of the coordinate system.
- pad
float
ortuple
= (pad_WE
,pad_SN
, …) The amount of padding to add to the region. If it’s a single number, add this to all boundaries of region equally. If it’s a tuple of numbers, then will add different padding to each dimension of the region respectively. If a tuple, the number of elements should be half of the number of elements in region.
- region
- Returns:
- padded_region
tuple
= (W
,E
,S
,N
, …) The padded region.
- padded_region
Examples
>>> pad_region((0, 1, -5, -3), 1) (-1, 2, -6, -2) >>> pad_region((0, 1, -5, -3, 6, 7), 1) (-1, 2, -6, -2, 5, 8) >>> pad_region((0, 1, -5, -3), (2, 3)) (-2, 3, -8, 0) >>> pad_region((0, 1, -5, -3, 6, 7), (2, 3, 1)) (-2, 3, -8, 0, 5, 8)