# Connect Nodes, Centroids and Voronoi Cells to POI

July 26, 2021

Beginner

10 min.

Learn how you can enhance a table with POI's by adding columns that hold Voronoi cells, Centroids and Node references that can be used for calculating shortest paths between POI's.

#### You will learn

- How to assign
cells to nodes of a transportation network`Voronoi`

- How to assign a centroid to a Point of Interest
- How to add a node reference to a POI table

## Prerequisites

- You have completed the tutorial Visualize a
cell using a Scalable Vector Graphic.`Voronoi`

- You have access to the sample spatial data used in this tutorial group.
- Make sure your database instance is
**running**before you start.

In your dataset, you have points of interest (table `LONDON_POI`

) as well as nodes of the transportation network (table `LONDON_VERTICES`

). Of course, there is a spatial relation between both (e.g. distance measured by `ST_Distance`

). In this tutorial, you will learn how to assign each POI to its closest node in the transportation network. You can think of example- assigning a bar to its closest street corner.

This way, you will later be able to calculate shortest paths between points of interest. These are the steps involved:

- Assign
`Voronoi`

cells to all Nodes - Assign a centroid to each Point of Interest
- Enhance the POI table with node reference

Step 1: Assign Voronoi cells to all nodes

Step 2: Assign a centroid to each Point of Interest

Step 3: Enhance the POI table with node reference

Step 4: Test yourself