I am trying to automate generating maps with Atlas using points only. As the snapshot shows the data points for each village is shown by a color. Every four villages fall under one health area. There are more than 100 health areas in my dataset. I am trying to create one map per health area. Is that possible? I know that there is one way doing this by constructing a polygon for each health area, but I rather not to do it because there is no specific border between some villages and they overlap in some areas.
One possible way is that you create a polygon covering each group of your points based on the field in the attribute table that defines the health areas.
To create a polygon shapefile that covers points, you can use concave hull plugin which will exist in the processing toolbox after installing the plugin.
For example, I have a point shapefile in which a new ID was given for each zone. The new ID field is named
NEW_ID2 (in your case select the field that represents health areas).
Processing toolbox -> Concave hull by k-nearest neighbors plugin, select the
Concave hull k-nearest neighbors highlighted in blue color above and open the tool:
- Input file: select the point layer (health area points)
- Under field: select the field that represents the health areas (in this example
- Method: select
Create concave hulls based on field
- Give the output polygon shapefile a name
Run the tool
This is the output:
Use this output polygon shapefile as a coverage area in the atlas. The output from the concave hull tool creates a new field that defines each polygon in the attibute table of the polygon shapefile. Use that field to define the page name in the atlas:
Here is the atlas output:
You can hide the polygon by selecting
Hidden coverage layer as you can see in the above atlas tool image. In the exercise, I am showing the polygon so you can clearly see the coverage.
The standard way to do this is to create a layer with one feature for each health area. Use this layer as the Atlas coverage area.
The usual way would be to use a polygon layer, but if you prefer you can use a point layer, with the point in the center of each health area.
In either case, you don't have to see the coverage layer in your final output. Just check the box for "Hidden coverage layer."
If for some reason you don't want to create a separate layer, you can use the existing point layer for the coverage layer.
Select one point from each health area. The map for that area will be centered on this point, so choose a point in the middle of the area.
Use the Field Calculator to create a field called "atlaspage" and fill it with the name of the health area for the selected features only.
In this example the layer has a field called "healtharea."
Set up your atlas with the field "atlaspage" as the page name, and with a filter like
"atlaspage" is not null.