Plot alocation
Warning
This library is under development, none of the presented solutions are available for download.
Allows the allocation of sampling plots with various types of sampling and plot formats. If you prefer a visual interface, consider using the QGIS module.
Class Parameters
PlotAlocation(shp_dir, epsg)
Parameters | Description |
---|---|
shp_dir | Directory of the shapefile defining the boundary of the area to be sampled. |
epsg | The EPSG code of the shapefile defining the boundary of the area to be sampled. |
Class Functions
functions and parameters
PlotAlocation.create_plots(distribution, plot_format, plot_area,
rectangle_size, sample_number, min_border_distance,
x_y_angle, save_buffer, show_plot, save_dir)
Parameter | Description |
---|---|
distribution |
Type of distribution or allocation that the plots should be subjected to. |
plot_format |
Format of the plot that will be installed. |
plot_area |
Area of the plot that will be installed. Not used when plot_format = 'rectangle' |
rectangle_size |
Used when plot_format = 'rectangle' .Tuple containing the sizes of X and Y of the rectangle (x,y) . |
sample_number |
Could be the number of plots or the percentage of the total area that will be sampled. If value < 1 it will be understood as a percentage. If value >= 1 it will be understood that you are setting the quantity of plots to allocate. |
min_border_distance |
Minimum distance in meters that the plots must be from the edge of the shapefile boundaries. |
x_y_angle |
Used when distribution = 'systematic custom' . Sets the distance in X and Y of each line in the grid of the systematic distribution and also the rotation angle in degrees (x,y,angle) . |
save_buffer |
If true , saves the buffer considering the plot size around the point. |
show_plot |
If true , displays a figure of the allocation performed. |
save_dir |
If not none , will be the directory where the buffer and points shapefiles will be saved. |
Available arguments
random
: Allocate the plots in a random distributionbest sampling
: (recommended) Allocate the plots in the best possible distribution for the area considering the established parameters.systematic
: Allocate the plots in a grid distribution, does not allow the definition ofsample_number
and alocate all possible plots.systematic custom
: Allocate the plots in a grid distribution with thex
andy
distances from the grid lines andgrid rotation angle
defined by the user.
round
: Consider that plots will have a rounded shape.squared
: Consider that plots will have a squared shape.rectangle
: Allows user to insert the X and Y sizes of the desired rectangle shape.
- In order to achieve the best precision in calculation, you must select the UTM zone that your area is in. Find your utm zone.
Example Usage
Random distribution
plot_alocation_example_1.py | |
---|---|
1 2 3 4 5 |
|
- Import
PlotAlocation
class. - Create the
plots
variable withPlotAlocation
class. Defines the boundary area shapefile path and the epsg. - Create the plots with
random
distribuition, with 25 sample points,plot area = 400 m²
, a minimum border distance of 20 meters and save the shapefile aspoints.shp
.
Systematic custom distribution
plot_alocation_example_2.py | |
---|---|
1 2 3 4 5 |
|
- Import
PlotAlocation
class. - Create the
plots
variable withPlotAlocation
class. Defines the boundary area shapefile path and the epsg. - Create the plots with
systematic custom
distribuition,plot area = 400 m²
, withx distance = 100 meters
,y distance = 50 meters
and 45º of grid rotation, with a minimum border distance of 20 meters and save the shapefile aspoints.shp
.
Rectangle plot format
plot_alocation_example_3.py | |
---|---|
1 2 3 4 5 |
|
- Import
PlotAlocation
class. - Create the
plots
variable withPlotAlocation
class. Defines the boundary area shapefile path and the epsg. - Create the plots with
best sampling
distribuition, arectangle width (x) = 20 meters
andheight (y) = 30 meters
, with a minimum border distance of 20 meters and save the shapefile aspoints.shp
.