use same code for converting attributes to json for point