Showing posts with label polygon. Show all posts
Showing posts with label polygon. Show all posts

Thursday, October 7, 2021

New tool - Toolbox to Create Squish Maps

 I've got a new tool to create "squish maps" which are maps in which the location of polygons have been moved around in order to improve the map scale.  You can download this tool by clicking HERE.

Creates squish maps to better show detail in rasters that are seperated by geographic space (see the example in which I "squished" the Hawaiian Islands together in the documentation). Two polygon shapefiles are needed. One has the original true location and the second the edited cartographic locations. The tool then takes a raster and shifts the cells to match the new polygon's location.

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.

Tuesday, March 3, 2015

Common question - How to combine raster and vector data and deal with NoData

This one is probably the most common question I get.  It goes something along the line of  "I've got some polygon/line data that I want to combine with a raster layer, but how do I deal with the NoData outside the polygon?". Other situations that this apply to include other raster outputs that use NoData as their background, such as outputs from Brownian Bridges, or remote sensing images in which part of the image may be masked. Hence, nearly everyone who works with ArcMap in a natural resource context is likely to encounter this problem at least once (if not nearly daily in my case).

Here is a hypothetical example and solution. In the picture to the right we've got a habitat model (raster) and buffered roads which are not suitable habitat for our hypothetical species. We wish to combine the two layers to yield a habitat model in which all areas near roads are not suitable habitat (value = 0).

In ArcGIS the first step would be to convert the polygon to raster. We might do this using the Polygon to Raster Tool.  It doesn't matter what the Value Field is set to but you probably want to set the Cellsize to the same as the habitat model layer (see the picture to the right).

Then use the IsNull tool  to convert all areas that are NoData to 1.  The IsNull tool is in the Spatial Analyst toolbox and is also available as Map Algebra in the Raster Calculator tool. IsNull is a really simple, but also one of the most powerful tools in ArcMap.

The final step involves the use of the Con tool in Spatial Analyst to combine the IsNull output with the original raster (see below). The input conditional raster should be the output from the IsNull tool. The expression selects all cells with a value of 0 (i.e. in this case they are within the road buffer). The true value is set to 0 to indicate that areas near roads are unsuitable habitat. The false value uses the original habitat suitability raster to indicate that for area not near roads the habitat is the same as the habitat model.

The final result  is map that looks like the one below. Areas near roads all have a value set to zero. You can also combine IsNull and Con in raster calculator using the following type of statement: Con(IsNull[Raster],0,[Raster]) or use ModelBuilder to streamline the process.