iframe header
  • Join FlightAware (Why Join?)
  • Login
  • US Flag 
10:39PM EDT

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Weird Data Coming From Search
PostPosted: Mon Jul 30, 2012 3:46 pm 
Offline

Joined: Mon Sep 03, 2007 6:00 pm
Posts: 2
Hi,

When using the Search Operation to find flights in a Lat/Lon box, the flights that are returned are not inside that box. I am using the
Code:
-latlong "MINLAT MINLON MAXLAT MAXLON"


Here is the PHP/Soap code that I am using:

Code:
<?php

$options = array(
                 'trace' => true,
                 'exceptions' => 0,
                 'login' => 'XXX',
                 'password' => 'XXX',
                 );
$client = new SoapClient('http://flightxml.flightaware.com/soap/FlightXML2/wsdl', $options);

$query = "-latlon 36.897669 -79.03655 40.897669 -75.03655";
$result = $client->Search($query);
print_r($result);

?>


Here is one of the returned aircraft:
Code:
[faFlightID] => AAL1974-1343453138-airline-0306
                            [ident] => AAL1974
                            [prefix] =>
                            [type] => B738
                            [suffix] => Q
                            [origin] => KLAX
                            [destination] => KBNA
                            [timeout] => ok
                            [timestamp] => 1343680642
                            [departureTime] => 1343673540
                            [firstPositionTime] => 1343673600
                            [arrivalTime] => 0
                            [longitude] => -102.431999207
                            [latitude] => 38.188999176
                            [lowLongitude] => -118.599441528
                            [lowLatitude] => 33.8277778625
                            [highLongitude] => -102.431999207
                            [highLatitude] => 38.426109314
                            [groundspeed] => 473
                            [altitude] => 350
                            [heading] => 95
                            [altitudeStatus] =>
                            [updateType] => TA
                            [altitudeChange] =>

The Longitude is -102.431999207, which is not in my search box


When I switch it to find flights with an origin of KMIA/Miami, FL:
Code:
<?php

$options = array(
                 'trace' => true,
                 'exceptions' => 0,
                 'login' => 'XXX',
                 'password' => 'XXX',
                 );
$client = new SoapClient('http://flightxml.flightaware.com/soap/FlightXML2/wsdl', $options);

$query = "-origin KMIA";
$result = $client->Search($query);
print_r($result);


?>


I get:
Code:
[faFlightID] => DAL82-1343453196-airline-0268
                            [ident] => DAL82
                            [prefix] =>
                            [type] => B752
                            [suffix] => Q
                            [origin] => KLAX
                            [destination] => KJFK
                            [timeout] => ok
                            [timestamp] => 1343680942
                            [departureTime] => 1343664901
                            [firstPositionTime] => 1343664901
                            [arrivalTime] => 0
                            [longitude] => -74.1166000366
                            [latitude] => 40.904800415
                            [lowLongitude] => -118.57611084
                            [lowLatitude] => 33.8294448853
                            [highLongitude] => -74.1166000366
                            [highLatitude] => 42.6163902283
                            [groundspeed] => 356
                            [altitude] => 190
                            [heading] => 115
                            [altitudeStatus] =>
                            [updateType] => TA
                            [altitudeChange] =>

No other flights have KMIA as the origin.

Am I doing something wrong?

Thanks :D


Top
 Profile  
 
 Post subject: Re: Weird Data Coming From Search
PostPosted: Mon Jul 30, 2012 4:56 pm 
Offline
FlightAware Staff
bovineone - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 am
Posts: 234
Location: FlightAware WHQ
ahanmal wrote:

Here is the PHP/Soap code that I am using:

Code:
$query = "-latlon 36.897669 -79.03655 40.897669 -75.03655";




I believe the coordinates to -latlon have to be quoted together like this:

Code:
$query = "-latlon \"36.897669 -79.03655 40.897669 -75.03655\"";



Top
 Profile  
 
 Post subject: Re: Weird Data Coming From Search
PostPosted: Mon Jul 30, 2012 8:19 pm 
Offline

Joined: Mon Sep 03, 2007 6:00 pm
Posts: 2
bovineone wrote:
ahanmal wrote:

Here is the PHP/Soap code that I am using:

Code:
$query = "-latlon 36.897669 -79.03655 40.897669 -75.03655";




I believe the coordinates to -latlon have to be quoted together like this:

Code:
$query = "-latlon \"36.897669 -79.03655 40.897669 -75.03655\"";



Hi, Thanks for your response. When I ran the code with the extra quotes, I still get aircraft that were not in the Lat./Lon. box.

Here is one of the aircraft:
Code:
[faFlightID] => DLH573-1343453235-airline-0247
                            [ident] => DLH573
                            [prefix] =>
                            [type] => A388
                            [suffix] =>
                            [origin] => FAJS
                            [destination] => EDDF
                            [timeout] => ok
                            [timestamp] => 1343697030
                            [departureTime] => 1343668529
                            [firstPositionTime] => 1343668529
                            [arrivalTime] => 0
                            [longitude] => 14.406999588
                            [latitude] => 35.4469985962
                            [lowLongitude] => 14.406999588
                            [lowLatitude] => -26.1159992218
                            [highLongitude] => 28.2439994812
                            [highLatitude] => 35.4469985962
                            [groundspeed] => 455
                            [altitude] => 400
                            [heading] => 348
                            [altitudeStatus] =>
                            [updateType] => TA
                            [altitudeChange] =>
                            [waypoints] =>

Lon: 14.406999588
Lat: 35.4469985962

Is there another bug in my code?

Thanks :)


Top
 Profile  
 
 Post subject: Re: Weird Data Coming From Search
PostPosted: Wed Aug 01, 2012 3:38 pm 
Offline
FlightAware Staff
bovineone - FlightAware user avatar

Joined: Wed Jul 27, 2005 3:00 am
Posts: 234
Location: FlightAware WHQ
I think there is some error in how the PHP SOAP library is forming the request. I'll continue to run some tests on it and maybe do some server-side workaround later... In theory, this should be correct, but it doesn't work:

Code:
$query = array("query" => "-latlon \"36.897669 -79.03655 40.897669 -75.03655\"", "howMany" => 15, "offset" => 0);
$result = $client->Search($query);


However, as a workaround you can use SearchBirdseyeInFlight, which does seem to be working properly:

Code:
$query = array("query" => "{range lat 36.897669 40.897669} {range lon -79.03655 -75.03655}", "howMany" => 15, "offset" => 0);
$result = $client->SearchBirdseyeInFlight($query);


You might also be interested in trying the same query with SearchBirdseyePositions, which will let you detect if any position of a flight enters your lat/lon window and not just the most recent position:

Code:
$query = array("query" => "{range lat 36.897669 40.897669} {range lon -79.03655 -75.03655}", "howMany" => 15, "offset" => 0, "uniqueFlights" => 1);
$result = $client-> SearchBirdseyePositions($query);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
iframe sidebar


 

Airport Tracker/Info


-or-