Showing posts with label sampling. Show all posts
Showing posts with label sampling. Show all posts

Wednesday, October 19, 2016

Creating non-spatial and "not quite true" spatial figures in GIS

I recently was tasked with creating figures to show some variables collected along a trapping grid. The problem with these data were that the trapping locations were very close to one another yet the distance among the trapping grids was not.  As a result, it was very nearly impossible to show meaningful differences at the scale of the entire study. In the figure on the right you can see the location of the trapping grids.  Each grid had 64 stations arrayed in 16 columns and 4 rows. I've removed any geographic information that may suggest the location of this study for the sake of privacy.

The solution?  What I call a "not quite true" spatial map.  In the figure below we see that each bold box shows a trapping grid  and each smaller box is a trapping station. The colors represent the intensity of some value.  It may be the number of animals caught in the traps at the locations or some habitat variable having to do with plant cover or soil type. The reason why it is "not quite true" spatial is that distances among trapping grids is much larger than they are in real life and distances between individual traps isn't always exactly even. Nonetheless it shows spatial patterns in a succinct and compact form.

To make this map all I had to do was create relative row and column X and Y coordinates. That table was then imported into ArcMap as X and Y data. In this example there were a total of 36 rows and 48 columns. Although this workflow could have taken place using R or python I found that it was quite easy to accomplish in ArcMap.

This is a nice reminder of how GIS can be a powerful tool for all sorts of visualizations, not just for maps. Using GIS we can very easily change color schemes using different kinds of classification s (i.e. natural breaks, quantiles, equal intervals, etc.), edit individual lines and polygons, convert from raster to vector formats.  Some of this stuff is tedious to do in other types of software.

We're probably all familiar with some examples of "not quite true" spatial maps.  Subway maps are a  prime example.  They are designed to show relative space, but distance isn't always accurate in the true geographic sense.  However, we can also take raster GIS outside of the realm of normal geographic space and actually use GIS for displaying things like time series or even data space.  More on that later.

Thursday, April 28, 2016

Improvements to Sampling Grid Tools

A neat thing  happened this week.  A while back I created a new tool called Create Regular Sampling Grid and posted it online HERE . The tool is designed to help guide field workers in systematic grid around user-defined points. The tool is useful for validating coarse-resolution imagery, such as Landsat or MODIS, or for sampling systematically within polygons. Earlier this week I got a message from Duncan Hornby, a long time ArcGIS programmer from the UK, with a slew of awesome suggestions for ways to improve this tool.  His suggestions ended up dramatically improving the speed and user interface of the Create Regular Sampling Grid Tool resulting in version 2.  The lesson that I learned is that good things can happen with a second pair of eyes, and posting code online is a great idea.  I also learned a fair bit about improving the user experience and anticipating and troubleshooting potential problems.  Thanks Duncan.


Friday, February 12, 2016

New tool - Create Sampling Grid from Points for ArcGIS v. 1.0


With the advent of high-precision GPS spatially-explicit sampling designs have taken on an increasing importance in ecology and natural resource management. Spatially-explicit sampling regimes are useful for understanding processes such as attraction and repulsion that can be described using point pattern processes. This tool also opens up the possibility of random sampling within a larger grid. For example, users may want to collect field data to scale up to Landsat or MODIS pixels. It may be infeasible to collect data for an entire pixel, so some random sampling of the pixel may be necessary. Similarly there may be vegetation polygons or agricultural fields that the researcher wishes to sample in a random or a systematic manner. Finally, even if the researcher wishes to sample the entire grid having the ability to load center points or corner points onto a GPS and navigate to them may expedite field sampling. The creation of this tool was inspired by the needs of a current ongoing pygmy rabbit research project here in Nevada, Oregon, and Idaho.


This tool allows for the creation of polygons and centroids of polygons based on known points. The known points can be random locations, centroids of features of interest (e.g. polygons of agricultural fields or vegetation polygons), or regular gridded points across a landscape. This tool differs from existing tools, such as the Fishnet tools in ArcGIS, because it does not create a single grid for the entire landscape, but rather creates a local grid centered on each point in the input shapefile. It uses the following formula to achieve this:
(-1*(d/2) - 0.5) + i where d is the dimensions parameter and i is the iteration number. The two images below illustrate a grid with an even number of dimensions (6 on the left) and one with an odd number of dimensions (7 on the right). Both sampling grids are centered on points provided by the user, but the the one on the left has the original point (green) falling on a grid corner. The one on the right has the original point (provided by the user, in green) falling in the center of an individual grid tile.  The maroon points were created using the 'Feature Vertices to Points' tool, a standard ArcGIS tool with the advanced license.


Wednesday, January 28, 2015

New tool - Create quadrats along transects tool

I got a request from a student recently who was interested in creating points so that he could visualize his quadrats on a map. With the advent of high resolution imagery it is now easy to get a sense of the layout of someone's field site. Overlaying quadrat and transect locations may also help find errors in the data. For example, if a forested plot shows more trees than are visible in an aerial photo this might serve as a red flag that there has been an error in data entry. By overlaying quadrats and transects on aerial photographs you may also be able to understand whether your random/stratified random/regular points/lines are representative of the site as a whole. I encourage field ecologists to take the extra steps to make their data spatially-explicit. This can be as simple recording a single set of XY coordinates + transect line distance + bearing and the distance of start/stop locations (quadrats) along the line. Consider also building map books so that you can quickly visualize what your field site looks like from a bird's eye perspective.

The new tool is called Split Straight Lines at Irregular Distances and runs in ArcGIS 10.1 (should work for other versions of ArcGIS as well). The tool also goes by the name Create Plots along Transects. To run this tool you'll need the following: 1) A point shapefile representing the start end of the transect attributed with XY coordinates, line distance, bearing (polar coodinates in degrees from north), and a unique ID field (FID will do). Make sure that you've declinated the bearing to account for the difference between magentic and true north.
2) A table with unique IDs for each line and distances along the line where points will be generated.

The tool was created in ArcGIS ModelBuilder and is fairly simple. The first step joins the tabular data to the point shapefile. Then the Bearing Distance to Line tool (standard tool in ArcMap - ArcToolbox - Data Management - Features - Bearing Distance to Lines) creates the lines. Finally the end points of those lines are converted to polygons. The end result is that you get a lien shapefile representing your transects and a point shapefile representing quadrats. Other GIS tools are also available on our lab's website.