I'm trying to create a database for storing coordinates
Lets say X has: Latitude 20°20’20.00’’ , Longitude 20°20’20.00’’E , with 1 mile range.
Y has: Latitude 20°21’21.00 , Longitude 20°21’21.00’’
I want to know whether Y location lies within X range.
I've been trying for days to find a way to manage that; I came across quad tree, k-d tree, but I could not find a way to represent it in a database.
I finally stumbled on PostGIS but I don't know how to create and manage simple latitude longitude interaction whit it.