Statistical tests of significance rely on comparisons between observed and expected sets. If one wants to conduct statistical analyses on something spatial, then creating expected sets of spatial data is often necessary.
Here are some entries from the ArcGIS 10 Manual that are useful to review when setting out to create expected sets.
- Random points can be generated from the System Toolbox under Data Management Tools>Data Management Tools>Feature Class>Create Random Points. Define the path and location of the output. It is possible to define a constraining feature option. This useful for generating random points within a study area. One can select the number of points based on several options including an integer, a field, a minimum allowed distance. If the constraining feature has multiple records, random points will be generated for each feature. Read the tool help for more information.
- Uniform points can be created using the Grid Label option under Create Fishnet. This tool creates a fishnet of polylines or polygon tesselations or grid squares. The Grid Label option creates a point in the center of each fishnet cell.
- Polygon grid or quadrat array, that is known in ArcGIS as Create Fishnet. One can use the Grid Label option to generate a uniform distribution of points. In this case, the point is located in the center of the square.
- Creating new points along a line.
Generate Uniform Distribution of Points and Regular Grid of Polygons
- Using the "crop" DEM from the prior lab, generate a regular grid across the DEM.
- Open ArcMap and add in the crop DEM.
- Ensure that the Spatial Analyst extension is activated.
- Open the Create Fishnet tool.
- Output Feature Class = the name of the grid you will create.
- Template Extent = crop DEM
- Notice that the extent and Fishnet origin are all filled in. Often times it is preferable to have a grid corners on whole numbers rather than decimals. To have the grid corners on whole numbers, round the numbers for the Fishnet Origin Coordinates.
- Cell size width and height = in this fill in 100 for each. The uniform distribution of points will be spaced every 100m and the grid of cells will be composed of 100m x 100m squares.
- Number of Rows and Columns = in this case fill in 0 for each case. If the fishnet was based on the number of Rows and Columns then the Cell size and width would not be filled in.
- If using ArcGIS v10, set the Geometry Type to Polygon.
- The v9.3 Create Fishnet tool does not have an option for setting the output feature class. A fishnet of lines is always created. If a fishnet of polygons is needed, which is probably the case, then use the v9.3 Feature to Polygon tool. IMPORTANT NOTE: This tool is only available under an ArcINFO license. To convert a fishnet of lines into polygons under an ArcView license, one can use the Convert Polyline to Polygon tool, but this will need to be installed.
Generate Random Distribution
Now we will generate a random distribution of points. Often times a 20% sample is considered a good starting point. Let us make a 20% random sample of the space that is contained within the Crop DEM.Given that the DEM is composed of cells, we want to sample 20% of those cells.
- In the ArcGIS TOC, right click on the Crop DEM and bring up the properties.
- Click on the Source Tab and make note of the number of Columns and Rows.
- Click Ok and close the properties tool box.
- Based on the attributes of the grid, how many cells make up crop DEM and what is 20% of that value?
- Open the Create Random Points tool
- Leave the Output Location to default gdb or set the output to where you prefer.
- Output Point Feature Class = The name of the new random features.
- Constraining Feature Class = Blank
- Constraining Extent = Crop
- Number of Points = 1456, right?
- In this case, we just want a 20% sample of the DEM.
- Note that it is possible to include a field. This can be a field from the constraining features. The value of this field will determine how many random points to create for each polygon. That field could be populated quickly using the field calculator or by using some function of the polygon area.
- Minimum allowed distance = 31
- In this case we are trying to get a 20% sample of the DEM so we want to constrain the tool to only make points that will be slightly more dispersed than the raster spatial resolution.
- In other cases, it may be fine to have the minimum allowable distance set to 0 or alternatively it may be necessary to set this number higher.
- Click OK to run the tool.
Some Further Considerations
Once you have a 20% random sample, perhaps it would be useful to have a 20% uniform sample. Try generating a 20% uniform sample. This will be a uniform grid of 1456 cells. How might the random and uniform samples vary and what are possible causes?It should be possible to use the ZontalStats as Table tool to query the crop raster to obtain cell values at each point location.
It would also be interesting to think about using the Create Fishnet tool to generate sampling transects. While this isn't really in the domain of expected set creation, it is an aspect of sampling design for field data collection. Try making transects that are 100m tall and have a width that is equal to the horizontal extent of the Crop DEM.
Making Points Along a Line
For ArcGIS v 10
- Make a new line shapefile, import the projection information from the crop DEM, and name the line shapefile something descriptive. This line file will serve as the geometry along which the points will be distributed.
- Make a new point shapefile, import the projection information from the crop DEM, and name the point shapefile something descriptive. This point file will contain the newly created sample of points.
- Add the new line and point shapefiles to the TOC and start editing.
- Make the line shapefile the editing target and digitize a line that goes across the crop DEM.
- Stop editing and save edits.
- Start editing and then click Editor>Construct Points. One can either input the total number of points or specify the distance between the points
For ArcGIS v 9.3
- Follow the directions above up until step 6. At that point it is necessary to use the Create Points along Lines or Polygons tool to actually generate the points along the line.
- Save the script into Notepad as a .txt file. Then change the file type from .txt to .bas.
- Import the .bas file into the Visual Basic Editor, which you can open by going into the Tools menu, then Macros.
- Put your point shapefile to the top of the TOC, then select the line you want the points to be created on.
- Run the macro from the Macro menu. Set distance.