Putting a label on a custom polygon is a little complicated as you can’t just label the polygon itself – it’s really a construct of many vertex points and you don’t want to label them. What you really want to do is label the centroid of the polygon. To do this you must create a dual-axis map. The first axis plots the polygon vertices and the second axis plots the polygon centroid. You then label the secondary axis mark.
How you define the centroid will determine how well the mark works as a labelling point. There are many ways to do this but the perhaps the simplest is to take the average lat and long values for all the vertices. However, as the following image shows this approach can be skewed if the polygons have areas of high vertex density like a coastline.
Another approach that I think yields better results in many cases is to take the midpoint of the lat and long values for all the vertices i.e. (min(x) + max(x)) /2
Again this isn’t perfect as the midpoint can be pulled away from an ideal placement if there are offshore islands (as there are in some of the above LGAs) or if the polygon is concave.
The best way is to have the optimal centroid point included in the source data e.g. pre-calculated using a more robust best-fit algorithm. Using this approach you can plot the centroid exactly where you want it. To do this you need a particular format for your data where the vertices and the centroids are in the same data source – the technique is outlined in an earlier blog post of mine.
The three techniques are compared below:
You can download a TWBX that shows these techniques from here.