×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Longitude and Latitude Informations with point seperation

    hello,

    i have following problem... the symbian c++ framework sends the longitude and latitude informations with a "," seperation to our webserver...

    LT : 51,54056738130700 lg : 7,40964427552700

    but i need the informations with a "." seperation.. i mean like this:

    LT : 51.54056738130700 lg : 7.40964427552700


    here is the code i use to store the gps coordinates into a file before sending it to the webserver...

    rFile.Seek(ESeekEnd,pos);
    rFile.Write(iAppView->iLatitudebuf);
    rFile.Write(_L8(","));
    rFile.Write(iAppView->iLongitudebuf);
    rFile.Write(_L8("|"));
    rFile.Close();


    i hope someone can help me with this problem...

    best regards,

    nizar

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Longitude and Latitude Informations with point seperation

    You can just replaced it with the char you like

    for(TInt i = 0; i <buf.Length(); i++ )
    {
    if(buf[i] == ',')
    {
    buf[i] = '.';
    }
    }

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Re: Longitude and Latitude Informations with point seperation

    thanks for your quick reply... but i think i need again yourr help... i send you now the complete function:
    ------------------------------------------------------------------------------------------------

    void CSevenGPSAppUi::StartSendingGPSData()
    {
    iAppView->DoGetImeiData();
    iAppView->DoGetGpsData();
    iEikonEnv->InfoMsg(_L("timer expired"));

    User::LeaveIfError(iRepository->Get(KProEngActiveProfile,iProfileId));

    TBuf8<2000> positionBuf;
    positionBuf.Copy(_L8("addLocation.php"));
    positionBuf.Append(KQuestionMark);
    positionBuf.Append(KDeviceID);
    positionBuf.Append(KEqualSign);
    positionBuf.Append(iImei);
    positionBuf.Append(KAndPercent);
    positionBuf.Append(KLatitude);
    positionBuf.Append(KEqualSign);
    positionBuf.Append(iAppView->iLatitudebuf);
    positionBuf.Append(KAndPercent);
    positionBuf.Append(KLongitude);
    positionBuf.Append(KEqualSign);
    positionBuf.Append(iAppView->iLongitudebuf);

    if(iProfileId != 5)
    {
    iEngine->IssueHTTPGetL(positionBuf);

    }
    else
    {
    iEikonEnv->InfoMsg(_L("storing in file"));
    TInt pos(0);
    RFile rFile;
    TInt fileErr = rFile.Open(CCoeEnv::Static()->FsSession(),_L("c:\\Data\\storeLatLong.txt"),EFileWrite);
    if(fileErr != KErrNone)
    {
    rFile.Replace(CCoeEnv::Static()->FsSession(),_L("c:\\Data\\storeLatLong.txt"),EFileWrite);
    }


    rFile.Seek(ESeekEnd,pos);
    rFile.Write(iAppView->iLatitudebuf);
    rFile.Write(_L8(","));
    rFile.Write(iAppView->iLongitudebuf);
    rFile.Write(_L8("|"));
    rFile.Close();


    }

    }
    ------------------------------------------------------------------------------------------------------------------------

    how can i include your code into our code...

    can you help me in that case..

    thanks,

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Longitude and Latitude Informations with point seperation

    I suppose you would add it where ever you want to change the iLatitudebuf & iLongitudebuf.

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Longitude and Latitude Informations with point seperation

    After iLatitudebuf and iLongitudebuf you can use this modification function (2 times).

    for(TInt i = 0; i <iLatitudebuf .Length(); i++ )
    {
    if(iLatitudebuf [i] == ',')
    {
    iLatitudebuf [i] = '.';
    }
    }
    Probably you need to study a bit more C++, if not clear ask again.

Similar Threads

  1. getting latitude and longitude
    By arun09 in forum Symbian
    Replies: 1
    Last Post: 2009-06-13, 13:39
  2. Find longitude and latitude
    By kkrish in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-08-21, 22:21
  3. Latitude/Longitude on map
    By piterr1410 in forum Mobile Java General
    Replies: 10
    Last Post: 2008-07-08, 16:55
  4. converting latitude and longitude into x y
    By oyuky in forum Symbian
    Replies: 9
    Last Post: 2008-05-20, 14:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×