Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6383459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:39:06+00:00 2026-05-25T02:39:06+00:00

Using http://maps.google.com/maps/geo?q= …. return latitude and longitude like those : 48.8616441,2.3448885 in a return

  • 0

Using http://maps.google.com/maps/geo?q=…. return latitude and longitude like those :
48.8616441,2.3448885

in a return string like this one :
200,8,48.8616441,2.3448885

When parsed a into a function that returns a CLLocationCoordinate2D :

    NSArray* listItems = [locationString componentsSeparatedByString:@","];

    CLLocationDegrees latitude = kInexistantLatitude;
    CLLocationDegrees longitude = kInexistantLongitude;

    if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) {
        latitude = [[listItems objectAtIndex:2] doubleValue];
        longitude = [[listItems objectAtIndex:3] doubleValue];
    }

    CLLocationCoordinate2D location;
    location.latitude = latitude;
    location.longitude = longitude;

    return location;

it gives into the debugger :

latitude = 48.861644099999999
longitude = 2.3448885000000002

I store many items like this one into an array, and at the end, I parse the array to write them into a plist file as dictionary items ( tag) (I use a NSString appendFormat that gives, like a NSLog) :

NSLog(@"%f %f", location.latitude, location.longitude);

48.861644 2.344889

At some moment, I will load that dictionary, and I will store that read stuff into a CLLocationCoordinate2D to display it on a MKMapView.

So I have 2 problems :

1) How may I store the returned value given by the http request without loosing a digit, and keeping my function ?

2) If I acheiev to do so, how may I read the stuff and store it into a CLLocationCoordinate2D without loosing again a digit ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:39:07+00:00Added an answer on May 25, 2026 at 2:39 am

    You are not losing a digit of precision. When you use

    NSLog(@"%f %f", location.latitude, location.longitude);
    

    If you do not specify a precision, %f automatically truncates your number to 6 decimal places as per the ANSI C standard.

    Try

    NSLog(@"%.8f %.8f", location.latitude, location.longitude);
    

    This should return the same number as the return string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using http://maps.google.com/maps/api/js?sensor=false to retrieve latitude and longitude for address. While retrieving the
I'm using http://maps.google.com/maps/geo ? web service to geocode some addresses. The problem I have
I'm getting my longitude and lattitude from google: http://maps.google.com/maps/geo?q=Sliedrecht,%20Netherlands&output=csv&oe=utf8&sensor=false I want to add a
I am using geo location api http://maps.google.com/maps/api/geocode/json?address=ADDRESS&sensor=false But the problem is I have above
When I am searching Rudy barber Shop, New York string in http://maps.google.com , google
I'm using Google Static Maps, which loads an image map: <img src=http://maps.google.com/maps/api/....&someparameter&someparameter&scale=1> Notice the
I'm using the following code to embed a Google map into my page: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Chicago+IL&z=15&iwloc=A&output=embed
Using WatiN, I'm loading up http://maps.google.com/ All I want to do is right click
I try to get my device coordinates using google maps api by http request,
I'm using Infostrat's WPF wrapper for the Bing maps 3d control (blog here http://blogs.msdn.com/virtualearth3d/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.