A quick hack to select all multipart features in QGIS
Posted by: Gavin Fleming | in FOSSGIS, QGIS | 9 years, 10 months ago | 4 comments

Today we wanted to find all the multipart features in this layer:

Here is a quick hack I did in QGIS to find them:

Just make sure that a vector layer is active in the layer list, paste the above code into the python console and all multipart features will be highlighted for you.

Current rating: 2.8

Comments

Oertls Ninetyeight 8 years, 3 months ago

Tim,

Is there a similar way to find and highlight only segments belonging to a single stream network? (In a particular case, the Mississippi River.)

Thank you. (I've been following/enjoying/learning since linfiniti.)
-
Oert

Link | Reply
Currently unrated

Tim Sutton 8 years, 3 months ago

Hi

Have you tried using our Stream Feature Extractor plugin (in QGIS Plugins manager)?

http://changelog.qgis.org/en/stream-feature-extractor/version/1.0.0/

There is also the streamSelect (in experimental section of plugin manager)

Glad to know our articles are helpful!

Regards

Tim

Link | Reply
Currently unrated

Oertls Ninetyeight 8 years, 3 months ago

I had not seen it, but there it was, so I installed it.

I selected a vector layer composed of the National Atlas 1M streams data, and set SFEx to work on it, but I would have preferred to give it a better hint before I started it. It took a while, but finished in good time for such a large dataset.



I did not see a (sub)layer for "tributaries" as indicated on the link. However, the list of what was returned in my test did not match perfectly with the list on the link. For example, my sublayers contained "Intersection, Segment center, Branch, and Unseparated" which are not on the referenced link's list, and was missing "crossing and tributary" which are. (I can guess that Branch and tributary are the same thing, but that could well be wrong.)



I then filtered the dataset to the name of one river ("Rio Grande" in Texas) to see if that would focus the effort, but again, no tributaries, or branches. (I was afraid of that.)

Incidentally, I also today ran across the interactive USGS Streamer site (http://water.usgs.gov/streamer/web/) but there does not seem to be an option for downloading the traced stream as a shapefile for later inclusion into QGIS.



What I am hoping for is to find a way to choose all, and only, the tributaries of a selected waterway of interest.


Thank you for taking the time to reply.


Cheers!
--
Oert

Link | Reply
Currently unrated

Tim Sutton 8 years, 3 months ago

Hi. Could you share the dataset you are using with me? tim@kartoza.com

Also feel free to file issues and feature requests at:

https://github.com/kartoza/stream_feature_extractor/issues

We don't have anymore funding to work on the plugin but if it is a quick feature we can add it.

Regards

Tim

Link | Reply
Currently unrated

New Comment

required

required (not published)

optional

required

Have a question? Get in touch!