Extracting gps data from PostgreSQL and save it to *.gpx file