3

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.

  • st_intersects() is a PostGIS function (not QGIS). What software are you using? Can you give some more details about your data? – wiltomap Nov 19 '15 at 14:08
  • Thank you so much for your help. I am new to GIS. I have a file with the filename extension .gdb. Inside the .gdb file are many sets of files named like, a0000002b.GDB_8_WATERCOURS.ATX a0000002b.gdbtable a0000002b.gdbtablx a0000002b.spx a0000002b.freelist .a0000002b.atx a0000002b.gdbindexes There is a set of files named a0000002a with the filename extensions mentioned above, then another set of files named a0000002b, etc. =========== I am using QGIS and I just need to cut this huge area down to a tiny area. – RCtopo Nov 19 '15 at 14:50
5

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).

3

Just use the Vector>Geoprocessing menu and interset that way: this is what you should see on QGIS, outputting a shape file to location. If that's not the format you require, you cna always convert back.

enter image description here

  • I see that the Vector>Geoprocessing tools also have a "clip" tool. For both the Clip and Intersect tools, I don't understand where I specify the tiny portion that I want to cut out of the huge area. For example, in your screen shot, does that show the entire extent of the data or is it zoomed and you are only outputting a shape of the extent on the screen? If it is the full extent and I want only a small portion, how do I specify that? – RCtopo Nov 19 '15 at 15:45
  • I'm not sure of the correct terminology, so to explain what I am trying to do, for example, if my .gdb file contains data for the entire United States, but I only want to work with the portion of the data that represents Minnesota, how can I extract / crop / clip or whatever to either delete/remove all the data that is not Minnesota or somehow extract only the Minnesota data. – RCtopo Nov 19 '15 at 19:08
  • In that example, if your data subset is such small, you can select the wanted elements and 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). – wiltomap Nov 20 '15 at 7:02
  • @Hairy: I guess that there is only one layer in the question, so any spatial intersection is pointless... – wiltomap Nov 20 '15 at 7:27
  • The map is superfluous, it was just up as I was processing from an application; the pint is the tools are there; you will probably note you can't have the menu selected and dialogue open at the same time: it was fabricated. The OP was discussing a FGDB with multiple files. I assumed the larger one could be cut with another. However, it's also true that you can open your dataset up, create a polygon in memory and sue that as the 'clipper'. the point remains – Hairy Nov 20 '15 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.