Lat and Long issue

hprider
06-25-2007, 12:33 PM
Hello,

I have the lat and longs for certain airports and I'm trying to map them. I pass the lat and long to a method with the following Java code:

ArrayOfLocation loc = findService.getLocationInfo(myLatLong, dataSource, gio);
Location[] locations = loc.getLocation();
Location myLocation = locations[0];

For most of the airports it works fine, but for some it throws an NullPointerException at the last line. It seems as though the web service doesn't find the location at all. When I go to About.com and do a mappoint search using the lat and long the map comes for them with no problem.

Can it have something to do with my using staging urls for testing? If not, does anyone have any possible solutions?

Thanks,

Howard

NewEast
06-30-2007, 03:16 PM
How can it not find the location when you are passing the specific lat/lon? Sorry I'm not sure I follow the question.

hprider
07-03-2007, 10:16 AM
Hello,

What I mean is that I pass the lat and long for an airport as the FROM location and the address of the property I'm mapping as the TO location. For most of the properties it works fine, I get the map and directions as requested. But some do not work at all. For example, Atlanta-Jackson International Airport has lat: 33.636719 and long: -84.428067. When I pass them into the code I get the forementioned error. When I pass the lat and long of another airport, for example Fort Lauderdale-Hollywood International Airport lat: 26.072583 long: -80.15275 it works fine for the same address I used before. When I go to Google Maps and enter the same lat and long I used for the Atlanta airport the map comes up correctly so I know the lat and long are correct. (Got them from the airport website anyway).

I just don't understand why some lat/long coords work fine and some don't, event though the coords are verified as correct.

Thanks,

Howard

 
Web mp2kmag.com
mapforums.com