Fix #1213: remove circular references when we convert to JSON
Merge pull request #1215 from geoadmin/fix_circular

Fix #1213: remove circular references when we convert to JSON