Search locations within a range of a certain point based on latitude and longitude.
I got this working going through the list of points and calculate the distance to the point. Then i filter them by distance to find the locations within the range.
But now i want to find the zip codes near a point. Also based on latitude and longitude. But now we got almost 50.000 zip codes. I don't want to use the method above because i then have to go through all zip codes and calculate the distance. A process whats costs a lot of serverpower.
I'am wondering if there is way to pre select zipcodes who could be in the range. So i can first select the zipcodes where i can be useful to calculate the distance. Then i can run those zip codes through the way i described above.
Put zip code in groups based on 'logic of zipcode' or your own logic and choose zipcodes in the nearby groups.
Let's say you define 'square group', you can reduce to nine groups, the one where original zipcode is and the 8 around. You jsut have to define the length of a square and constuct these data one time.