Add len() to coordinates

This pull request fixes #1761

A ``TypeError`` is raised if the coordinate object is a scalar.