parse pg spatial element to JSON

As I mentioned in the issue now I deliver the code. Let me know what you think about.
The changes are really simple so I don't have to explain.

Regards

Clemens Rudert