Validates geometry, raising error if invalid.

def _validate_geometry(self, geometry):
        """Validates geometry, raising error if invalid."""

        if geometry is not None and geometry not in self.valid_geometries:
            raise InvalidParameterError("{} is not a valid geometry".format(geometry))

        return geometry