[GIS] Clipping subpart of data in QGIS

clipextentsqgis

I have a geodatabase that I am adding to a QGIS project. I read the documentation (below) but I don't understand what parameters I use for "a.the_geom" and "b.geom". Is there a way to clip with a bounding box? Or, what is the best way to reduce my huge data to just the small portion that I need?

16.5.9. Clipping
To clip a subpart of your data you can use the ST_INTERSECT() function. To avoid empty geometries, use:

where not st_isempty(st_intersection(a.the_geom, b.the_geom))

I am using QGIS 2.8.2-Wien, a portable version. I'm running QGIS from an external hard drive connected via USB.
I've been opening a new project and then using Layer > Add Layer > Add Vector Layer > Source Type File — and adding some of the files files that are in a .gdb geodatabase file.

It sounds like I can use the Select Features by Area or Single Click tool to select a rectangle and then I should be able to right-click or somehow save the selected area as a shapefile. However, when I select an area, as soon as I let go of the mouse button, I get the crash dump shown in the image below and QGIS shuts down. I will try using an older more stable version of QGIS.

enter image description here

The method I ended up using is probably only one of many ways to cut/crop/clip a small portion of data from a large data set.
The first thing I did was switch to an older, stable, version of portable QGIS – 2.4.0-Chugiak.
In the Layers Panel, I right-clicked on the layer, clicked Save-As… a "Save vector layer as…" window popped up which let me choose which format to save as from a drop-down menu at the top and there is a checkbox for Extent which allowed me to put in bounding box coordinates. I ended up with a shapefile with only the area that I wanted.

Best Answer

Intersecting and clipping operations need at least 2 layers... I think you only have one layer and wish to save a subset in a new layer, am I right? If so, the process is:

  1. Select subset features
  2. Save selected features in a new layer

To achieve (1), two possible ways:

  1. Select graphically the desired features manually on the map with one of the selection tools available (in a polygon, a rectangle, etc.)

  2. Select desired features with attributes. For instance, you need to select features for which attribute name is London. Open the attributes table (right-click on the layer > Open Attributes Table) and filter on field namein order to select London. The London feature is then selected on the map as in option (1).

Eventually, to save your selection into a new layer: richt-click on the layer, then Save As... and save your selection in a new shapefile (don't forget to turn on the Save Only selected features option inside the Save As window).

Related Question