1

I have shapefile with polylines representing a road network. Under the attribute table, there is a column called highway which specifies which each feature belongs to. i.e primary, secondary,tertiary etc. I want to delete all the polylines in the shapefile except the polylines belong to the "primary" category. Any ideas on how to do this?

ahmadhanb
41.8k5 gold badges55 silver badges110 bronze badges
asked Sep 3, 2019 at 9:13
1
  • 1
    Deleting a large number of features is much slower than selecting the features you want to keep, and writing those to a new dataset. Commented Sep 3, 2019 at 14:12

3 Answers 3

5

Simply use Select by Expression in the attribute table and write the following expression:

"FieldName" = 'primary' 

Where FieldName is the name of the field in your attribute table. Then use Export Selected Features as from Right-click of the RoadNetwork layer Export -> Export Selected Features As to create a new shapefile with only primary road.

This is much better than deleting the other roads of the existing shapefile.

answered Sep 3, 2019 at 9:23
1

The easiest way : you open the attribute table, choose your "sort attribute", click on the colum header to sort your features and manually (or using an expression) select all your "primary" category, you then invert the selection and delete them ...

answered Sep 3, 2019 at 9:18
0
1

Open the attribute table, choose select by expression (yellow square with an "E"), enter the following

"COLUMNNAME" NOT LIKE 'primary'

Obviously "columnname" has to be replaced by the name of the column which contains "primary, secondary, tertiary". Then this will select everything which is not a primary road.

Then turn on editing and delete all the features you do not need.

answered Sep 3, 2019 at 9:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.