Circularity Calculations with the CircularityCalculator

Sydney Dombowsky
Sydney Dombowsky
  • Updated

Introduction

The circularity of an area feature indicates how compact or elongated the feature is. A value of 1 indicates that the feature is a perfect circle (compact), and 0 indicates that it is a line (elongated).

In FME, circularity is measured with the CircularityCalculator transformer using the formula:

4 × π × Area / (Perimeter²)

In this tutorial, we will use this transformer to calculate the circularity of polygons representing political boundaries. The theory is that citizens are better represented when they live in a political riding that is more compact than elongated. This is because access to their elected representative is more equal, and the representative has equal access to any area of the riding.

The source data is a vector polygon dataset in GML (Geography Markup Language) format representing political boundaries. The data and workspace for this tutorial can be downloaded from the Files section. 

 

Video

This video was recorded using FME 2016.0. The interface may be different, but the concepts are the same. 

 

Step-by-Step Instructions

1. Start FME Workbench and Add Data

Start FME Workbench, and click on New to open a blank workspace.

To add a source dataset, click the Reader button from the Toolbar. In the Add Reader dialog, enter the following:

  • Format: OGC GML (Geography Markup Language)
  • Dataset: /PoliticalBoundaries.gml
    • Click on the ellipsis (blank document icon for macOS) and browse to the dataset

Then click OK.

A Select Feature Types dialog will come up. Select only the VotingDivisions layer, then click OK.

 

2. Add a CircularityCalculator Transformer

Type CircularityCalculator on the canvas, then press Enter on your keyboard to add the transformer to your workspace. This transformer will calculate how compact (circular) or elongated the features are.

Connect the VotingDivisions reader feature type to the CircularityCalculator Input port:

Double-click the transformer to open the parameters dialog and set the following:

  • Calculation Geometry: Feature Boundary

This will ensure the circularity of the feature is calculated using the actual geometry outline. A new attribute called _circularity that stores the calculated values will be added to the output.

 

3. Add a Tester Transformer

We only want to see polygons that are more elongated than compact, so we will use a Tester transformer to filter results based on criteria.

Add a Tester transformer and connect the CircularityCalculator Output port to the Tester Input port. 

Open the parameters and enter the following: 

  • Left Value: _circularity
    • Use the drop-down arrow, then hover over Attribute Value to locate the _circularity attribute
  • Operator: >=
  • Right Value: 0.5

This will test for records where _circularity is greater than or equal to 0.5 (more compact).

 

4. Add a Writer

We want to write out the data to a new GML file so they can be passed onto the elections officer for boundary readjustment consideration.

Click the Writer button in the Toolbar and set the following parameters:

  • Format: OGC GML (Geography Markup Language)
  • Dataset: /VotingDivisionsElongated.gml
    • Select an output folder for your data to be written to

Click OK and a Feature Type window will appear. Set the Feature Type Name:

  • Feature Type Name: VotingDivisionsElongated

Connect the Tester Failed port to the VotingDivisionsElongated writer feature type. This will write all the voting divisions with a circularity value of less than 0.5 (more elongated than compact) to a GML file.

5. Run the Workspace and View Output

Ensure the Enable Data Caching is selected in the Run menu, then run the workspace.

Once the translation is complete, click the View Written Data button on the VotingDivisionsElongated writer feature type to view the output in Data Preview:

You can remove columns from the table view by clicking the Columns… button in the Table Data Preview window and deselecting available columns in the Table View Schema window.

Twelve (12) features will fail the test as being more elongated than circular. You can pass these results on to the elections officer to consider adjusting the boundaries.

You can view both the Passed and Failed data in the Data Preview Graphics window by clicking on the Tester transformer. This will show the voting divisions symbolized by more elongated features and more compact features:

Additional Resources

CircularityCalculator Transformer Documentation

 

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.