0

find Latitude and Longitude Php

I want to find the latitude and longitude from the address through the php scrip.

i m using the following code. can any one help me , or if you have another some good script then can you send me?

<?php



//$req = 'http://api.local.yahoo.com/MapsService/V1/geocode?appid=xrJBTwPIkY_3AUAhj1bNvtoZ1Zvz6N1v&street=RingRd&city=surat&state=india&output=php';

$req = 'http://api.local.yahoo.com/MapsService/V1/geocode?
appid=xrJBTwPIkY_3AUAhj1bNvtoZ1Zvz6N1v&street=1807+Hendricks+Avenue&
city=Jacksonville&state=FL&output=php';

$phpserialized = file_get_contents($req);
$phparray = unserialize($phpserialized);

$resultset = $phparray[ResultSet];

$result = $resultset[Result];

$Latitude = $result[Latitude];
$Longitude = $result[Longitude];

echo $Latitude.'-'.$Longitude;


?>

mellow.gif

by
3 Replies
  • QUOTE (jignesh @ Dec 12 2009, 12:14 AM) <{POST_SNAPBACK}>
    I want to find the latitude and longitude from the address through the php scrip.

    i m using the following code. can any one help me , or if you have another some good script then can you send me?

    <?php



    //$req = 'http://api.local.yahoo.com/MapsService/V1/geocode?appid=xrJBTwPIkY_3AUAhj1bNvtoZ1Zvz6N1v&street=RingRd&city=surat&state=india&output=php';

    $req = 'http://api.local.yahoo.com/MapsService/V1/geocode?
    appid=xrJBTwPIkY_3AUAhj1bNvtoZ1Zvz6N1v&street=1807+Hendricks+Avenue&
    city=Jacksonville&state=FL&output=php';

    $phpserialized = file_get_contents($req);
    $phparray = unserialize($phpserialized);

    $resultset = $phparray[ResultSet];

    $result = $resultset[Result];

    $Latitude = $result[Latitude];
    $Longitude = $result[Longitude];

    echo $Latitude.'-'.$Longitude;


    ?>

    :mmast9327@gmail.com
    0
  • What is the issue you are seeing? Are the lat / lon not returning correctly?

    - Jon
    0
  • QUOTE (Jonathan LeBlanc @ Dec 22 2009, 08:24 AM) <{POST_SNAPBACK}>
    What is the issue you are seeing? Are the lat / lon not returning correctly?

    - Jon


    it is not showing perfect latitude and longitude comparing to google ..

    Regards,
    Jignesh
    0
  • How far off is the result? I'm running test on address locations that I know the placement of on the street and it is running at a very accurate level.

    - Jon
    0

Recent Posts

in General Discussion at YDN