Hey guys,
Having a really weird problem.
We have an Taxi application which uses coordinates of existing locations and such. But really sometimes we have a small error (I didn't make the project, but I have to fix it ), so basically, after some testing of what our client sended to us, the thing is, if you type in a street to google, you send those coordinates to google & save it, and when u need the details, you will send to google maps API again, so basically, when you get this BACK, it goes wrong..
Google Maps API sends back a JSON, which contains latitude & longitude of a point, when you want to convert that to a CLLOcationCoordinate2D it goes wrong.
As you can see here, i just posted a tiny bitsy of the code, so we get the result back from Google, and then try to get the DoubleValue of those 2 keys. Then I log them, the log basically says this.
As you can see, it's just a teensy bit different, which would be okay, but if you use these coordinates to get the street again from the API, it will give you a little bit different adress. like 2 houses further, but that could be just another street on a corner, and that causes confusion. So basically, i'm a bit stuck of how to solve it, write my own mapper?
Greets, Thijs
Having a really weird problem.
We have an Taxi application which uses coordinates of existing locations and such. But really sometimes we have a small error (I didn't make the project, but I have to fix it ), so basically, after some testing of what our client sended to us, the thing is, if you type in a street to google, you send those coordinates to google & save it, and when u need the details, you will send to google maps API again, so basically, when you get this BACK, it goes wrong..
Google Maps API sends back a JSON, which contains latitude & longitude of a point, when you want to convert that to a CLLOcationCoordinate2D it goes wrong.
Code:
- (void) handleResponseForAddressSearch: (NSDictionary *)result
{
CLLocationCoordinate2D location = CLLocationCoordinate2DMake([[result objectForKey:@"latitude"] doubleValue], [[result objectForKey:@"longitude"] doubleValue]);
NSLog(@" result latitude & longitude: %@ & %@", [result objectForKey:@"latitude"], [result objectForKey:@"longitude"]);
NSLog(@"latitude: %f & longitude: %f", location.latitude, location.longitude);
As you can see here, i just posted a tiny bitsy of the code, so we get the result back from Google, and then try to get the DoubleValue of those 2 keys. Then I log them, the log basically says this.
Code:
2012-06-14 09:06:56.573 Dispatch! DEV[7840:707] result latitude & longitude: 52.3358326 & 4.7787182
2012-06-14 09:06:56.575 Dispatch! DEV[7840:707] latitude: 52.335833 & longitude: 4.778718
As you can see, it's just a teensy bit different, which would be okay, but if you use these coordinates to get the street again from the API, it will give you a little bit different adress. like 2 houses further, but that could be just another street on a corner, and that causes confusion. So basically, i'm a bit stuck of how to solve it, write my own mapper?
Greets, Thijs