Help needed in converting street address to latitude and longitudepair

This is a discussion on Help needed in converting street address to latitude and longitudepair within the PHP Language forums, part of the PHP Programming Forums category; Hi All, I am building a web site with PHP and MySql where i have to convert the residential address ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-18-2007
jaffy
 
Posts: n/a
Default Help needed in converting street address to latitude and longitudepair

Hi All,

I am building a web site with PHP and MySql where i have to convert
the residential address registered by user in to latitude and
longitude pair and also for addresses of hotels , hospitals etc,,,,
sitting in MySQL DB.Finally i have to calculate the distance between
the user's residential address and various places like hospital ,
hotels ,etc,, and sort the same in ascending order.

I need help in converting the street address in to latitude/longitude
pair.


Thanks & Regards
Noor Mohamed
Reply With Quote
  #2 (permalink)  
Old 12-18-2007
Rob
 
Posts: n/a
Default Re: Help needed in converting street address to latitude andlongitude pair

On Dec 18, 12:05 pm, jaffy <jaffersola...@gmail.com> wrote:
> Hi All,
>
> I am building a web site with PHP and MySql where i have to convert
> the residential address registered by user in to latitude and
> longitude pair and also for addresses of hotels , hospitals etc,,,,
> sitting in MySQL DB.Finally i have to calculate the distance between
> the user's residential address and various places like hospital ,
> hotels ,etc,, and sort the same in ascending order.
>
> I need help in converting the street address in to latitude/longitude
> pair.
>
> Thanks & Regards
> Noor Mohamed


The GoogleMap code below translates addresses into Lng/Lat based on
postcode.

There's probably something in the API (http://code.google.com/apis/
maps/documentation/reference.html) for calculating the distance as
well.



function GmapLoad() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.enableScrollWheelZoom();

geocoder = new GClientGeocoder();
showAddress("NW9 0HD","VITOW LTD<br>7 Carlisle
Road<br>Colindale<br>London&nbsp;&nbsp;&nbsp;&nbsp ;NW9 0HD");
window.focus();
}
}

function showAddress(address,info) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
alert("Could not find postcode " + address);
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(info);
}
}
);
}

Reply With Quote
  #3 (permalink)  
Old 12-18-2007
Rob
 
Posts: n/a
Default Re: Help needed in converting street address to latitude andlongitude pair

On Dec 18, 12:57 pm, Rob <ratkin...@tbs-ltd.co.uk> wrote:
> On Dec 18, 12:05 pm, jaffy <jaffersola...@gmail.com> wrote:
>
> > Hi All,

>
> > I am building a web site with PHP and MySql where i have to convert
> > the residential address registered by user in to latitude and
> > longitude pair and also for addresses of hotels , hospitals etc,,,,
> > sitting in MySQL DB.Finally i have to calculate the distance between
> > the user's residential address and various places like hospital ,
> > hotels ,etc,, and sort the same in ascending order.

>
> > I need help in converting the street address in to latitude/longitude
> > pair.

>
> > Thanks & Regards
> > Noor Mohamed

>
> The GoogleMap code below translates addresses into Lng/Lat based on
> postcode.
>
> There's probably something in the API (http://code.google.com/apis/
> maps/documentation/reference.html) for calculating the distance as
> well.
>
> function GmapLoad() {
> if (GBrowserIsCompatible()) {
> map = new GMap2(document.getElementById("map"));
> map.addControl(new GSmallMapControl());
> map.addControl(new GMapTypeControl());
> map.enableScrollWheelZoom();
>
> geocoder = new GClientGeocoder();
> showAddress("NW9 0HD","VITOW LTD<br>7 Carlisle
> Road<br>Colindale<br>London&nbsp;&nbsp;&nbsp;&nbsp ;NW9 0HD");
> window.focus();
> }
>
> }
>
> function showAddress(address,info) {
> geocoder.getLatLng(address,
> function(point) {
> if (!point) {
> alert("Could not find postcode " + address);
> } else {
> map.setCenter(point, 13);
> var marker = new GMarker(point);
> map.addOverlay(marker);
> marker.openInfoWindowHtml(info);
> }
> }
> );
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -



The Google API is -
http://code.google.com/apis/maps/doc...ml#GDirections,
which offers a getDistance() method.

This can only be called within the context of a visible map within the
browser, so you're probably going to have to resort to paying for this
info.

BTW, Google Maps API is not licenced for Commercial use, so be careful
what you plug it into.
Reply With Quote
  #4 (permalink)  
Old 12-18-2007
The Natural Philosopher
 
Posts: n/a
Default Re: Help needed in converting street address to latitude and longitudepair

Rob wrote:
> On Dec 18, 12:05 pm, jaffy <jaffersola...@gmail.com> wrote:
>> Hi All,
>>
>> I am building a web site with PHP and MySql where i have to convert
>> the residential address registered by user in to latitude and
>> longitude pair and also for addresses of hotels , hospitals etc,,,,
>> sitting in MySQL DB.Finally i have to calculate the distance between
>> the user's residential address and various places like hospital ,
>> hotels ,etc,, and sort the same in ascending order.
>>
>> I need help in converting the street address in to latitude/longitude
>> pair.
>>
>> Thanks & Regards
>> Noor Mohamed

>


Which country is this in?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:52 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0