-1

i am doing one concept.but i have no idea to do that concept. plz nybody give an idea for that....

actually there is a site which have the registered restaurents on that site at the same another side user registration is there. now user login then automatically display distinct restaurents which is in that site. how to display distinct restaurents?

and next problem is administrator divided 3 jones . each jone having diffrent shipping charge. i mean the distance between restaurent and user address is equall to with in the one mile then charge one shipping charge. if there is a 2 miles distance between restaurent and user then charges another shipping charge?

how to do this...anybody give an idea for this problem...

thanks.


thanks to all for replys. first i have a small question. i want to create 2regions(region:1,shape:circle, distance:1km),(region:2,shape:circle, distance:2km) of origin.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
krishna
  • 923
  • 3
  • 15
  • 42
  • Please ask about one, specific, well described thing. I have no idea what are you trying to achieve really and it doesn't look like a programming question. – viraptor Jul 17 '10 at 13:57

2 Answers2

1

I answered a question possibly related to this one a while back: StackOverflow: Distance between two addresses

Community
  • 1
  • 1
Luke Stevenson
  • 10,357
  • 2
  • 26
  • 41
  • thanks for your reply. first i have a small question. i want to create 2regions(region:1,shape:circle, distance:1km),(region:2,shape:circle, distance:2km) of origin. – krishna Jul 19 '10 at 07:02
  • 1
    That is really alot of questions tied together. My solution (above) should allow you to determine the actual road distance between two addresses (which, from what I understand of your question, would be the best solution for you). To determine distances, as-the-crow-flies (that is, straight line distances), you can again use Google to turn Addresses into Lat/Long co-ords, and then use a calculation called "The Great Circle" to determine the distances between two addresses. There is an answer at http://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula for that. – Luke Stevenson Jul 19 '10 at 07:11
  • ok. actually i want to display restaurents which is in that region when registered user login. – krishna Jul 19 '10 at 10:22
  • In that case, you will want to use the Google API to get the Latitude/Longitude of each restaurant as you do your data entry (turning the address into that as you go). Then, when the visitor accesses the directory, turn their nominated address (again using the Google API) into a Latitude/Longitude. You would then use the equation from http://www.marketingtechblog.com/technology/calculate-distance/ to determine as-the-crow-flies distances between the Visitor and the Restaurant. (But be sure to limit the Query a bit - otherwise it is ALOT of processing to run on EVERY row.) – Luke Stevenson Jul 19 '10 at 15:37
  • when i divide work into tasks then each task will be looking tough. again i am looking for "how to draw two regions (jone1: 1mile,shape:circle)(jone2:2mile,shape:circle) of origin? – krishna Jul 20 '10 at 05:22
  • 1
    @muralikalpana: I do not know if I can make my suggested soloution any simpler. The article I linked to has the MySQL Equation to determine distance from one LatLong to another LatLong, and how to use MySQL to filter on that information. To block the results into <=1mile and >1mile & <=2mile would simply need the use of the MySQL `CEILING()` function. Regardless, I think this Question is kind of stretching outside of it's normal bounds - I am happy to discuss the details further via email luke@lucanos.com, after you read the articles I have provided links to. – Luke Stevenson Jul 20 '10 at 05:54
  • sure..you gave correct solutions.but client asking like this exactly http://meyerweb.com/eric/tools/gmap/hydesim.html. he(restaurents) wants to select regions like this from origin dynamically which they are willing to deliver to. when new user register in this account then automatically display restaurent names which is in that region – krishna Jul 20 '10 at 07:27
  • 1
    That is just a graphic representation of data you need to retrieve from the database - a simple task. Anyway - as said before, this is beyond the scope of the initial question. Happy to discuss via email, or subcontract for you. – Luke Stevenson Jul 20 '10 at 08:04
  • is this your email id.luke@lucanos.com? – krishna Jul 20 '10 at 10:02
0

I'm not sure if I got your question right, but I think you might find Google Maps API useful, specifically XML/JSON Web services.

Gray Fox
  • 673
  • 1
  • 8
  • 21