Spatial Elliptical Fourier Descriptors

A pure python implementation of the elliptical Fourier analysis method described by Kuhl and Giardina (1982). This package is designed to allow the rapid analysis of spatial data stored as ESRI shapefiles, handling all of the geometric conversions. The code is built upon the pyefd module and it is hoped that this package will allow more geoscientists to apply this technique to analyze spatial data using the elliptical Fourier descriptor technique.

[Image of a drainage basin fitted fitted by the first 2,4,10,20 harmonics of its Fourier series]


  • Built-in geometry processing, just pass in a shapefile and get results quickly!
  • Fourier coefficient average and standard devation calculation
  • Handles spatial input data through the pyshp library
  • Compute an appropriate number of harmonics for a given polygon
  • Basic plotting for analysis and debugging through matplotlib


Install spatial_efd by running:

$ pip install spatial_efd


This package is developed on linux for python 2.7 and requires matplotlib, numpy and pyshp. These packages will all install automatically if spatial_efd is installed using pip.


A range of unit tests are included in the /spatial/tests/ directory. These can be run using nose or directly from

$ python test
$ nosetests


Here are examples of how to use the code.


I welcome contributions to the code, head to the issue tracker on github to get involved!

  • Issue Tracker:
  • Source Code:


If you find any bugs, have any questions or would like to see a feature in a new version, drop me a line:


The project is licensed under the MIT license.


Kuhl, FP and Giardina, CR (1982). Elliptic Fourier features of a closed contour. Computer graphics and image processing, 18(3), 236-258.


Click here for the module level documentation.

Indices and tables