6

Is there an easy way to show/connect a group of points on a multipoint shapefile layer as if they were a polygon?

I'm collecting points for a plant study, and some of the points are gathered as a patch of plants. I'd like to symbolize individual plants and patches differently.

  • There is likely an easy way, though it might not be the right way. Which is more important to you? – Vince May 14 at 20:18
  • 1
    "Concave hull" is one approach and you can find quite many old answers with that search term, one of those being gis.stackexchange.com/questions/158424/… – user30184 May 14 at 22:13
4

Given a multipoint layer like you describe, with some features as individual points, and some as multipoint, we can derive polygons for the patches in a couple steps, which could easily be combined into a custom model.

Note: this process assumes you have some sort of unique id field for your features.

Here's my points layer, color-coded to the feature ID to help show the multipoint patch in the center.

points layer with multipatch in center

  1. Run Multipart to single parts in the Vector geometry toolbox.

  2. Run Minimum bounding geometry, also in the Vector geometry toolbox.

    • Set Field parameter to unique_id
    • Set Geometry type to Convex Hull

For all features that were already single points, there will not be enough points to generate a convex hull. For your multipoint patches, you'll get results like these:

multipatch to polygon

That's it!

A model of the same would look like this:

points to patches model

6

Tested on QGIS 2.18 and QGIS 3.4

In terms of "an easy way" I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... However, @Vince is absolutely correct that " it might not be the right way".

This solution is also based on @JoshC's note: "you have some sort of unique id field for your features".

Let's assume we have seventeen features in "point_layer" with three groups of the patch of plants respectively, see image below. This is a trivial example because points are following certain point patterns, i.e. they are clustered.

Example

With the following Queries, it is possible to achieve several results.


Using a ConvexHull

SELECT p.Name,
       ConvexHull(AddPoint(MakeLine(p.geometry),StartPoint(MakeLine(p.geometry)))),
       COUNT(*) AS Elements
FROM point_layer AS p
GROUP BY p.Name

The output Virtual Layer will look like

Output_1


As polygon

p.s. keep in mind points order for each group

SELECT p.Name, 
       MakePolygon(AddPoint(MakeLine(p.geometry),StartPoint(MakeLine(p.geometry)))), 
       COUNT(*) AS Elements
FROM point_layer AS p
GROUP BY p.Name

The output Virtual Layer will look like

Output_2


As an envelope

SELECT p.Name,
       Envelope(AddPoint(MakeLine(p.geometry),StartPoint(MakeLine(p.geometry)))), 
       COUNT(*) AS Elements
FROM point_layer AS p
GROUP BY p.Name

The output Virtual Layer will look like

Output_4


As Voronoi diagram

SELECT p.Name, 
       VoronojDiagram(AddPoint(MakeLine(p.geometry),StartPoint(MakeLine(p.geometry)))), 
       COUNT(*) AS Elements
FROM point_layer AS p
GROUP BY p.Name

The output Virtual Layer will look like

Output_3


References:

0

If the patches are from the same species you could just change the symbology for each species. If the patches are from different species, you could try a concave hull on selected point features. You will have to select them manually or use v.distance to create a new point file with points inside a given radius

0

It depends a bit how exactly your data looks like. Good and accurate way would be for each patch to have unique id/name and all the points of a patch are collected in order around the patch having sequental numbers or timestamps.

If your data is collected in this way you should use "points to path" tool then "line to polygon" tool. Else @JoshC's answer is perfectly good solution, only keep in mind there will most likely be patches of irregular shapes that will not be generated as expected.

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.