I brought in a vector shapefile with around a total of 20 different pressures. I want to make this vector into two different shapefiles. One for the property "Pressure" of lines that have under 20 pressure and another for the same property that has a pressure of 20 and over. I know of the Vector > Split Vector Layer
command but that splits the one shapefile into 20 different ones.
I would probably do the following:
Use the Field Calculator to create a new field and then use an expression like:
if( "Pressure" < 20, 0, 1 )
This will add a '0' to all features with a pressure value less than 20, otherwise will it will add a '1'.
- Run the
Vector > Data Management Tools > Split Vector Layer
tool and select the new field to produce two shapefiles.
-
Wouldn't I need to define what Pressure is? As in say [if ( attribute = Pressure < 20, 0, 1 )] – Shub Jun 15 '17 at 20:24
-
@Jhunt9 - No, in the field calculator you can just type the name of the field directly into the expression. Normally, field names are inside double quotes as in my post but no need to use
attribute = Pressure
, just"Pressure"
is enough :) – Joseph Jun 16 '17 at 9:07