# How to install and use plot layout generator for Plot Stand Count

<i class="fa-circle-exclamation">:circle-exclamation:</i> <mark style="color:$primary;background-color:yellow;">**Install process requires an internet connection**</mark>

<i class="fa-triangle-exclamation">:triangle-exclamation:</i> <mark style="background-color:red;">In order to do Plot Stand Count you need to have a contract with Sentera. If you do not have a contract for this please contact</mark> [<mark style="background-color:red;">support</mark>](mailto:support@sentera.com)<mark style="background-color:red;">.</mark>

### Installation Instructions

1. Install QGIS (<https://qgis.org/en/site/index.html>)
   1. Download the latest "Long term release"
2. Download and unzip Plot Layout Generator found in the folder with this guide
   1. Make sure that the unzipped folder is on your C drive
3. Open OSgeo shell as "Admin"
   1. Go to "C:\Program Files\QGIS"
   2. Right click OSGeo4W\.bat and select "Run as Administrator"
   3. Click "Yes"
4. In Plot Layout Generator folder:
   1. When installing the python libraries QGIS cannot be open during the process as it locks access to the QGIS python folder.
   2. Hold shift key and right-click "setup.bat" file and select "Copy as Path"
   3. Paste path in osgeo shell and hit enter

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FsXyxLXBZNufyG9WIlNkM%2Fimage.png?alt=media&#x26;token=62557ab8-462e-403a-9347-34a4510e7c6f" alt=""><figcaption></figcaption></figure>

&#x20;   d. This will install the necessary python packages. The batch file will change permissions on the QGIS program files folders and then install the python packages. This will take several minutes and may pause and continue as it installs multiple packages, wait for the entire installation process to complete.

&#x20;   e. Close the OSGeo4W window

5. Open QGIS
6. On the top bar click "Plugins -> Manage and Install"
7. Click "Install from ZIP"
8. Browse to the Plot Layout Generator folder and select the "plot\_layout\_generator.zip" file
9. Press "Install Plugin" button
10. Click on the "Installed" tab and check the Plot Layout Generator if it is not checked
11. Close the plugin window
12. The Plot layout Generator is available to open from the toolbar <img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FdkmiVsPJK6iR519ngLV7%2Fimage.png?alt=media&#x26;token=7aa49d21-78cd-4c2d-ac1d-bfe8ff6423e2" alt="" data-size="line">
13. Press the icon to launch the Plot Layout Generator.

<div align="left"><figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FyzB9rG5nC1btJ7GqOVQl%2Fimage.png?alt=media&#x26;token=4f59165f-4b4d-47f9-a7bd-eeb3d35833ca" alt=""><figcaption></figcaption></figure></div>

### Instructions on how to use

1. Open QGIS
2. Drag a mosaic into QGIS to set the QGIS project coordinate system or set the project coordinate system by clicking on the EPSG code in the bottom right corner of QGIS.

<div align="left"><figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2F0w4qP57bf6WmDlcE7HdI%2Fimage.png?alt=media&#x26;token=b34f3278-7b1e-4cfa-846a-dfac4a59da6a" alt=""><figcaption></figcaption></figure></div>

3. Open the "Plot Layout Generator" in QGIS <img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FJo9FdRksbB3hsSaTv7Jr%2Fimage.png?alt=media&#x26;token=f3c42325-7f8c-4644-bae9-505901ddb075" alt="" data-size="line">
4. If plots are evenly spaced, choose "1 Point" option and continue with step 4. If plots are not evenly spaced choose "4 Points" option and skip to step 7. Evenly spaced rows may be hard to notice right away. If 1-point option does not fit the number of rows per plot, switch to 4-point option.&#x20;

<i class="fa-square-info">:square-info:</i> <mark style="background-color:blue;">Note: The 4-point option will be optimal when gaps between plots are not at a perfect 90 degree angle or plots are staggered.</mark>

3. Select Origin Corner:
   1. Origin corner is the corner that the origin of the plot layout will start from in cardinal directions. If the origin corner is southwest, the plots will generate north and east.
4. Select Planting Direction:
   1. Planting direction is determines by the orientation of the crop rows. Planting direction only affects the plot ID numbering, planting direction will not affect the polygons
      1. North-South
      2. East-West
5. Select Origin Point (1 Point):
   1. Place origin on the corner of the first plot. The point should be between the first row of the plot and the next row outside of the plot if there are buffer rows.

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2F8Rf4uYl47vIZWSAsue6y%2Fimage.png?alt=media&#x26;token=f225355a-be98-4c22-9810-a021b3eb0d30" alt=""><figcaption></figcaption></figure>

8. Set Corner Points (4 Point)

   1. With the 4-point option, points will be placed in the center of the plot.
   2. Origin Point: First plot
   3. Row Point: Last plot in the direction of the crop rows
   4. Range Point: Last plot in the opposite direction of thhe crop rows
   5. Opposite Point: Corner opposite of the Origin point

   <figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FhUCm3NlYBIgRI4oB3Ffe%2Fimage.png?alt=media&#x26;token=81a62bd5-d3bc-4a66-9674-74ad798c0680" alt=""><figcaption></figcaption></figure>

9. Set Jog/Step(4-point)(Staggered plots)
   1. For staggered plots, the 4-point option can set an offset in plots.
   2. Step: Number or rows to stagger, will set offset for every x rows.
   3. Jog: Offset distance
   4. Start: Row to start offset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  &#x20;

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FJOdnldsgMQj9TAxIeKgI%2Fimage.png?alt=media&#x26;token=04c35360-c01b-41f2-a0d3-2ea6a3b13e6d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FX2iTAyQyfo7mUT2300Pb%2Fimage.png?alt=media&#x26;token=237b9a57-d603-4e79-97c3-63d7e8df4e24" alt=""><figcaption></figcaption></figure>

10. Set Trail Name.
    1. trial\_id attribute will be set for all plots using this string.
11. Set Plot Counts as needed.
12. Set Plot Sizes as needed.
13. Set Crop rows/plot. This will add the num\_rows attribute required for Sentera processing.
14. Set rotation if obviously needed, otherwise edit rotation after first generation.
15. (1-Point Only) Set alley distances if needed, this will add a gap in whichever direction between the plots.
16. Add Attribute Data:
    1. Additional attribute data can be added from a CSV file
    2. Drag a CSV file into QGIS
    3. CSV file must contain plot\_id values matching Sentera plot ID format (Range\*1000 + Row, e.g., "1001 = range 1, row 1" "1011 = range 1, row 11"). Additional attributes will be added to the associated plots.
    4. Check "Add Attribute Data"
    5. Select attribute data layer
17. Click "Generate Plots"
18. Review generated Plots, if plots do not align well, change sizes and rotation until acceptable fit. In cases where plots are not evenly planted it may be necessary to use the QGIS move tool to fix plots.

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2Fcjjh2AoqP2bZn9xHxyPe%2Fimage.png?alt=media&#x26;token=2770c30b-26e5-4b97-89ab-d099b0e2b588" alt=""><figcaption></figcaption></figure>

19. Click "Save Plots".
    1. Plots output file can be saved as a shapefile or geojson.
    2. Additionally, an xml file will be saved with the settings used to generate the plot layout. Settings files can be imported for easy reprocessing.
20. Export/Import:
    1. Export PLG Settings will create an xml file containing all the selected options in the tool.
    2. Import PLG Settings allows the individual to load settings from an xml file. After importing the settings click Generate plots to reproduce the previously created plot layout.

### Importing plot into FA Desktop

1. Once done with everything go into FieldAgent Desktop.
2. Click on the field that you want to do the plot stand count.
3. Then click on "Document View" tab on the top left.

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2FO1PilpaaZoh3EjfI4F8r%2Fimage.png?alt=media&#x26;token=ab8e1c2a-1e20-4902-bbf2-108df8ad8a5d" alt=""><figcaption></figcaption></figure>

4. Click on "Add File" button.
5. Add the shapefile or geojson of the plot that you generated.

### Ordering Plot Stand Count

1. Click into field that you want to order plot stand count
2. Select the Survey
3. Click on beaker icon <img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2F7vwKjZwRKxW3K0rXPFzk%2Fimage.png?alt=media&#x26;token=05cee6ca-13b0-4290-946e-f0c2ae45a8a6" alt="" data-size="line"> top middle.
4. Click on Plot on the on the left pane and then click on the type dropdown and select stand count. Then select Stand Count and click on submit button.

<figure><img src="https://1827205515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsPOYY19dQnuyPXFXGPWK%2Fuploads%2Fu56ZLiTHe3XJDkhBfT3e%2Fimage.png?alt=media&#x26;token=0378a048-e08c-4b3f-a959-11c934fb36f0" alt=""><figcaption></figcaption></figure>
