Actually, there is an easier way. :-)

Pseudo SQL:
"Select all service points where (service_radius + search_radius) <
distance_from_service_point_to_center_of_search"

--
Marcelo - http://maps.forum.nu
--




On Mar 6, 8:32 am, marcelo <[email protected]> wrote:
> This is not really a Google Maps API question, but purely SQL.
>
> The WHERE clause that you'd need is "if polygons overlap", the
> polygons being circles, one centered at the search location and the
> other at each service point.
> MySQL can only make such comparison using the polygon's MBR, (Minimum
> Bounding Rectangle), PostgreSQL with PostGIS can do it with the exact
> circle.
> To do it with MySQL you'd need to define a custom function, (or stored
> procedure), that checks if two polygons overlap and returns true or
> false.
>
> --
> Marcelo -http://maps.forum.nu
> --
>
> On Mar 6, 7:57 am, Asif <[email protected]> wrote:
>
> > Hi,
>
> > I am creating an application with Geo Proximity Search capability
> > using PHP as server scripting language and MySQL as Databse.
>
> > Consider a situation:
>
> > Where we have certain set of objects having latitude and longitude
> > positions assosciated with respective objects. On specifying location
> > details like country and/or city along with range/radius in KM we are
> > getting objects that are lying withing that radius/range using MySQL
> > query for example:
>
> > "SELECT [columns] FROM [column] WHERE 1=1 AND 3963.191 * ACOS((SIN(PI
> > () * [latitude] / 180) * SIN(PI() * [column].latitude / 180)) + (COS(PI
> > () * [latitude] /180) * cos(PI() * [column].latitude / 180) * COS(PI()
> > * [column].longitude / 180 - PI() * [longitude] / 180)) ) <= 10"
>
> > Above calculations will give the objects that are within the 10 KM
> > area from the country/city center point on earth.
>
> > Now suppose i have one object (with latitude and longitude) which is
> > not in this 10 KM area, but for example 15 KM from the country/city
> > center point on earth. This object has service range 10 KM (giving
> > service upto 10 KM area).
>
> > Now the question is if i am looking for the objects within the 10 KM
> > range from country/city center point then the object (15 KM apart from
> > country/city center point) having service range 10 KM should also be
> > included in search.
>
> > How can i make it possible? I have country/city center lat, long
> > coordinates,range/radius(in which we have to find out objects) and
> > object having delivery radius (for e.g.10 KM) and its corresponding
> > coordinates.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to