Centroids, convex hulls and merging layers
Create centre points of polygons, outline groups of points with convex hulls, and combine several layers of the same kind into one.
You will learn
- Create centroids and points on surface.
- Build convex hulls per group.
- Merge layers and keep track of their origin.
Prerequisites
Data for this tutorial
Wards (synthetic) Download wards.geojson
- Format
- GeoJSON
- Geometry
- Polygon
- CRS
- EPSG:32643 (WGS 84 / UTM zone 43N)
- Content
- 84 wards (31 peri-urban, 19 rural, 34 urban), 333,497 residents
- In Orbis
- Browser panel ▸ Tutorial sample data (synthetic) ▸ Wards, or Load complete tutorial pack.
Fields used in the tutorials
| Field | Type | Description |
|---|---|---|
ward_id | text | Ward code W01 to W84. |
ward_name | text | Ward name. |
zone | text | urban, peri-urban or rural. |
population | integer | Residents. |
households | integer | Households. |
area_km2 | real | Ellipsoidal area in km². |
density_km2 | real | Persons per km². |
literacy_rate | real | Literate share, per cent. |
Facilities (synthetic) Download facilities.geojson
- Format
- GeoJSON
- Geometry
- Point
- CRS
- EPSG:32643 (WGS 84 / UTM zone 43N)
- Content
- 97 points: 3 hospitals, 6 health centres, 26 clinics, 58 schools, 4 colleges
- In Orbis
- Browser panel ▸ Tutorial sample data (synthetic) ▸ Facilities, or Load complete tutorial pack.
Fields used in the tutorials
| Field | Type | Description |
|---|---|---|
facility_id | text | F001 to F097. |
name | text | Facility name. |
category | text | health or education. |
type | text | hospital, health_centre, clinic, school or college. |
ownership | text | public or private. |
capacity | integer | Beds or students. |
opened | integer | Year opened. |
Land use 2019 and 2024 (synthetic) Download landuse_2024.geojson
- Format
- GeoJSON (also landuse_2019.geojson)
- Geometry
- Polygon
- CRS
- EPSG:32643 (WGS 84 / UTM zone 43N)
- Content
- 61 polygons (2024), 50 polygons (2019)
- In Orbis
- Browser panel ▸ Tutorial sample data (synthetic) ▸ Land use 2024, or Load complete tutorial pack.
Fields used in the tutorials
| Field | Type | Description |
|---|---|---|
lu_id | text | Polygon identifier. |
class | text | built-up, cropland, forest, water or scrub. |
code | integer | Class code 1 to 5. |
year | integer | 2019 or 2024. |
area_ha | real | Ellipsoidal area in hectares. |
Licence: CC0 1.0. All tutorial data is synthetic and generated by Orbis. About the datasets
The task
You need one point per ward for labelling, an outline around each type of facility, and the land-use layers of 2019 and 2024 in a single layer.
Steps
- Add Wards, Facilities, Land use 2019 and Land use 2024 from the tutorial data.
- In the Toolbox, open Centroids and run it on the wards. You get 84 points with the ward attributes, at the area-weighted centre of each ward. For odd shapes the centroid can lie outside the polygon; Point on surface always gives a point inside.
Open Convex hull. Choose Facilities (synthetic), One hull per field value as Mode and
typeas Group field. Run it. Each of the five facility types gets the smallest convex polygon around its points, with acountfield (3 hospitals, 6 health centres, 26 clinics, 58 schools, 4 colleges).
One convex hull per facility type.
- Open Merge vector layers, tick both land-use layers under Layers to merge and run it. The merged layer has the features of both, with a
layerfield that names the source layer, so you can still tell the years apart.
Expected result
A centroid layer of 84 points, five convex hulls and one land-use layer with the 50 polygons of 2019 and the 61 of 2024.
Common mistakes
- Merging different geometry types. Merging points with polygons creates a mixed layer that many formats (such as shapefiles) cannot store in one file.
- Using centroids for area statistics. A centroid summarises a polygon by one point; use a spatial join with the polygons themselves when containment matters.
Troubleshooting
- Fields are missing after a merge. Fields that exist in only one layer are kept and are NULL for the features of the other.