Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Maemo Mapper: GPS for the Nokia 770

    Reply
    Page 7 of 27 | Prev |   5     6   7   8     9   17 | Next | Last
    Demostenes | # 61 | 2006-05-13, 10:03 | Report

    This is the full .deb I modified.

    Sorry for no upload before, I have no discovered that i can upload files til now .


    I hope it be useful.

    Cheers,
    Demostenes

    Edit: I don't know why is not possible to directly install .deb from the navigator (file type : unknown). Any ideas?. Try to save adding '.deb' to filename and install manually.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: deb maemo-mapper_0_1_fix_arm.deb (39.8 KB, 274 views)

    Last edited by Demostenes; 2006-05-13 at 10:34.

     
    HardCoder | # 62 | 2006-05-13, 11:09 | Report

    Originally Posted by Demostenes
    This is the full .deb I modified.

    Sorry for no upload before, I have no discovered that i can upload files til now .


    I hope it be useful.

    Cheers,
    Demostenes

    Edit: I don't know why is not possible to directly install .deb from the navigator (file type : unknown). Any ideas?. Try to save adding '.deb' to filename and install manually.
    I've just tried your fix, and it seems to work great! Have you sent a patch to Gnuite so he can add the fix to his next release?

    And thanks a bunch for the fix!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Demostenes | # 63 | 2006-05-13, 13:09 | Report

    Gnuite :

    This is the code I have added at your sources :

    Originally Posted by
    static gfloat strtofloat(gchar *num)
    /* Function to convert string to float number
    ***Note I have no check for errors in string***
    */
    {
    gfloat ret = 0.f;
    gchar *pchar;
    gfloat n;
    gfloat dec = 0.f;

    pchar = num;
    while(*pchar != '\0' && *pchar !=' ') {
    if (*pchar == '.')
    dec = 10.f;
    else {
    if (dec) {
    n = ((gfloat) (*pchar - '0')) / dec;
    dec *= 10.f;
    }
    else {
    n = (gfloat) (*pchar - '0');
    ret *= 10.f;
    }

    ret += n;
    }
    pchar++;
    }

    return(ret);
    }
    and I have changed all references to 'atof' for 'strtofloat'.

    Great code, great work, I have no problems to follow it.

    Thanks. Demostenes.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Demostenes; 2006-05-13 at 13:12.

     
    mgedmin | # 64 | 2006-05-13, 15:44 | Report

    Could it be that the atof function pays attention to the system locale, specifically, to the decimal separator? Demosthenes, if you open language/region in the control panel, what is the decimal separator set to?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mgedmin | # 65 | 2006-05-13, 15:52 | Report

    Originally Posted by gnuite
    Even the topo maps would be pretty hard to integrate into Maemo Mapper now, as they are based on a completely different map identifier scheme (not X/Y; instead more quadtree-esque). Doable, but since I prefer the street data, I don't think I'll be tackling that problem at the moment.
    I'm very interested in topo maps since the Google street maps do not cover Lithuania.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mgedmin | # 66 | 2006-05-13, 17:17 | Report

    Here's a function to convert the google street map coordinates (x, y, zoomlevel) to the quadtree index string used by the google satellite maps (http://kh0.google.com/kh?n=404&v=6&t=%s).
    Code:
    void convert(int x, int y, int zoomlevel, char * buffer)
    {
        char * quadrant = "qrts";
        char * ptr = buffer;
        int n;
        *ptr++ = 't';
        for (n = 16-zoomlevel; n >= 0; n--) {
            int xbit = (x >> n) & 1;
            int ybit = (y >> n) & 1;
            *ptr++ = quadrant[xbit + 2 * ybit];
        }
        *ptr++ = '\0';
    }
    Here's a set of unit tests for this function.
    Code:
    #include <stdio.h>
    #include <string.h>
    
    int test(int x, int y, int zoomlevel, char * expected)
    {
        char buffer[19];
        convert(x, y, zoomlevel, buffer);
        if (strcmp(buffer, expected) != 0) {
            printf("failure with (%d, %d, %d): expected \"%s\", got \"%s\".\n",
                   x, y, zoomlevel, expected, buffer);
            return 1;
        }
        return 0;
    }
    
    int main()
    {
        int failures = 0;
        failures += test(0, 0, 17, "t");
        failures += test(0, 0, 16, "tq");
        failures += test(1, 0, 16, "tr");
        failures += test(1, 1, 16, "ts");
        failures += test(0, 1, 16, "tt");
        failures += test(0, 0, 15, "tqq");
        failures += test(1, 0, 15, "tqr");
        failures += test(2, 0, 15, "trq");
        failures += test(3, 0, 15, "trr");
        failures += test(2335, 1295, 5, "trtqsqqqrssss");
        if (!failures) {
            printf("All tests passed.\n");
            return 0;
        } else {
            return 1;
        }
    }
    Did I mention that I would be very happy to see Google satellite map support in MaemoMapper?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    kutibah | # 67 | 2006-05-13, 17:27 | Report

    Ok, this morning I was able to try the app w/voice on my way to a store. Let me say it is EXCELLENT! There is only one thing that would make it better. There should be a setting in which the user can change how far away to make the voice command. In my experience, the commands were said a little too early (I was far away from the intersection when they were said.) If I were going to a place I didn't know, it may be a problem remembering the command by the time I approached the street. Thank you once again for a fantastic app!!

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Demostenes | # 68 | 2006-05-13, 18:13 | Report

    Originally Posted by mgedmin
    Could it be that the atof function pays attention to the system locale, specifically, to the decimal separator? Demosthenes, if you open language/region in the control panel, what is the decimal separator set to?
    Yes, it could be. I have selected 'spanish' and yes, the decimal separator is comma (How do you have deduced that I am not english? My fluent english, maybe? )

    Really is 'c' funtion 'atof' in linux language dependant? I have been a windows/dos programmer for long time and never base functions in c have been language dependant. If that's true, I have to take care for future developments in linux .

    Cheers. Demostenes

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mgedmin | # 69 | 2006-05-13, 19:46 | Report

    Originally Posted by
    Did I mention that I would be very happy to see Google satellite map support in MaemoMapper?
    Here's a patch that adds Google satellite map support to MaemoMapper:
    http://mg.pov.lt/maemo-mapper-0.1-su...sat-maps.patch

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mgedmin | # 70 | 2006-05-13, 19:48 | Report

    And here's the package with that patch applied.

    Map URI prefix: http://kh.google.com/kh?n=404&v=6&t=%s

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: deb maemo-mapper_0.1mg1_arm.deb (40.0 KB, 258 views)

     
    Page 7 of 27 | Prev |   5     6   7   8     9   17 | Next | Last
vBulletin® Version 3.8.8
Normal Logout