I created a database in SQL locally on my phone for an app and then information is uploaded to a database on a server in the same format. In the tables I have GPS coordinates structured as a string with a tab between latitude and longitude. Looking back it makes more sense to have the database structured so that latitude and longitude are in two separate columns as type doubles (seems like it would perform better for searching and sorting).
Would it be much faster for sorting if I turned the string into two Doubles latitude and longitude columns? Is it even possible to search GPS coordinates in this format: “x.xxxx y.yyyy”? Is there a better way to sort/store GPS coordinates in SQL tables for searching?
Looking back, I wish I had planned this out more carefully. I know planning saves you lots of time down the road. Well, I suppose that applies here.
Yes, you should use separate columns for lat/lon.
Floating point representation may or may not be a good idea; when searching for exact coordinates this would not work too well. When looking for a range of values float will be just fine.
Depending on the size of your table and query patterns you may consider creating indexes for performance.