Cut by region extent

Author: Paulo van Breugel
Updated on: 2016-04-22

Issue

One of the great features of GRASS GIS is the concept of the region. In GRASS, a region refers to a geographic area with some defined boundaries, based on a specific map coordinate system and map projection and a specific spatial resolution. The region's boundaries are given as the northernmost, southernmost, easternmost, and westernmost points that define its extent.

Typically all raster and display modules are affected by the current region settings, but not vector modules. So what if you are working with a specific region, and you have a vector layer that extents beyond the region bounds, and you want to limit your vector layer to that region. In other words, how can you cut out a vector layer by the region extents?

Solution

The v.in.region function creates a vector polygon from the current region extent. You can subsequently use that newly created vector to cut out your areas of interest from the original vector layer. For example, if we have the map of the United States (e.g, from the Global Administrative Areas database) and we want to cut out the region defined by north=348000, south=-16000, west=124000 and east=964000 (for the curious, this is the extent of North Carolina in the NC sample database).