Android Question SqLite query to sort several lat & lon

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

I'm looking to sort several latitudes and longitudes with an SqLite query. Can you show me the correct query to sort these example latitudes and longitudes so I can use them in trip planning?

B4X:
Lat                      Lon
--------------           ---------
51.6916667               11.3375
82.8298349               8.8282
41.2398458               10.8345
38.9834722               14.2352

Thanks.
 

rleiman

Well-Known Member
Licensed User
Longtime User
Ascending order with the first one closest to my location. I'm assuming I will need to use a B4A library to get the latitude and longitude closest to my location first. Can you also tell me what library I would need?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached a small project calculating the distance of cities and sorting the closest to a given point in a given radius.
In reality, in the SQLite query I calculate the square of the distance because there is no square root function in SQLite.
The program uses the Table class and needs the ScrollView2D library.
 

Attachments

  • CityList.zip
    33.7 KB · Views: 223
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Attached a small project calculating the distance of cities and sorting the closest to a given point in a given radius.
In reality, in the SQLite query I calculate the square of the distance because there is no square root function in SQLite.
The program uses the Table class and needs the ScrollView2D library.
Hi Klaus,

Thanks. :)

I don't see the attachment. How do I download it?
 
Upvote 0
Top