Notices


Reply
Thread Tools
Posts: 9 | Thanked: 0 times | Joined on Apr 2006
#61
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.
Attached Files
File Type: deb maemo-mapper_0_1_fix_arm.deb (39.8 KB, 281 views)

Last edited by Demostenes; 2006-05-13 at 10:34.
 
Posts: 39 | Thanked: 2 times | Joined on Dec 2005
#62
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!
 
Posts: 9 | Thanked: 0 times | Joined on Apr 2006
#63
Gnuite :

This is the code I have added at your sources :

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.

Last edited by Demostenes; 2006-05-13 at 13:12.
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#64
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?
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#65
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.
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#66
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?
 
Posts: 182 | Thanked: 3 times | Joined on Mar 2006
#67
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!!
 
Posts: 9 | Thanked: 0 times | Joined on Apr 2006
#68
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
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#69
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
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#70
And here's the package with that patch applied.

Map URI prefix: http://kh.google.com/kh?n=404&v=6&t=%s
Attached Files
File Type: deb maemo-mapper_0.1mg1_arm.deb (40.0 KB, 264 views)
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:07.