Notices


Reply
Thread Tools
Posts: 6 | Thanked: 0 times | Joined on Feb 2006
#81
Hm.... interesting, very interesting... I have setup old firmware and all worked right away! But i am was litlle disappointed in precision. thx for help.
 
Posts: 9 | Thanked: 0 times | Joined on Apr 2006
#82
Originally Posted by mgedmin
Here's a patch that adds Google satellite map support to MaemoMapper:
http://mg.pov.lt/maemo-mapper-0.1-su...sat-maps.patch
I've tried your patch, and it works great!.

The problem is that I want to maintain both systems (maps and topo) and I have to change URI prefix and directory of maps every time. I am working in which it can be two different definitions for URI/directory (maps and topo) and we could exchange easily among them. I hope to have something for tomorrow (it depends how fast i can learn to programme in maemo ) . I already have something, but it crash when change each other for two times.

Greetings. Demostenes.

PS: Thanks for your explanation about atof and setlocale. I had no idea.
 
Posts: 182 | Thanked: 3 times | Joined on Mar 2006
#83
Originally Posted by ioan
for those who use windows at home, I made a windows application to help you download maps for maemo-mapper on your computer and transfer them on your nokia 770 when you need them. here is the link:
http://www.barghis.com/winmapper.htm
the app maps are comparible with maemo-mapper, I used qnuite's code (converted to delphi) to download the maps.
the source code is included

thanks,
-ioan
Thank you so much for this! I haven't used it yet, but I'll let you know how it goes when I get a chance!
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#84
Originally Posted by zApe
I have one problem when using maemo-mapper: I use Globalsat BT-338 as GPS receiver. Maemo-mapper can`t connect whith it. After enter MAC and "enable GPS" apears banner "Searching fo GPS receiver", after some time, when bt-338 connected to 770 banner start blinging. The GPS position be about Africa i point whith coordinates (1,1). I have waiting and i have`t right result. Can anybody help me?
I had this problem too. In my case it was caused by gpsdrive -- it switched my NaviLock/Globalsat BT-308 into Garmin-compatible binary mode and did not switch it back into NMEA mode.

I had to find the binary protocol description and write a Python script to switch it back into NMEA mode: http://mg.pov.lt/blog/maemo-mapper.html

(I suppose you can find some Windows program that would let you do that. I don't have Windows.)
 
Posts: 31 | Thanked: 2 times | Joined on Apr 2006 @ Vilnius, Lithuania
#85
Originally Posted by Demostenes
I've tried your patch, and it works great!.

The problem is that I want to maintain both systems (maps and topo) and I have to change URI prefix and directory of maps every time. I am working in which it can be two different definitions for URI/directory (maps and topo) and we could exchange easily among them. I hope to have something for tomorrow (it depends how fast i can learn to programme in maemo ) . I already have something, but it crash when change each other for two times.
That would be a nice feature to have.

In the meantime I've created two shell scripts that let me switch between street maps and sat maps while Maemo Mapper is not running. These scripts do two things: (1) change a symlink to the map directory and (2) change the map url with gconftool-2.

Code:
#!/bin/sh
# Ask Maemo Mapper to use satellite maps from Google
gconftool-2 -s /apps/maemo-mapper/map_uri_format -t string 'http://kh.google.com/kh?n=404&v=6&t=%s'
ln -sf /media/mmc1/maps/sat /home/user/apps/maemo-mapper
Code:
#!/bin/sh
# Ask Maemo Mapper to use street maps from Google
gconftool-2 -s /apps/maemo-mapper/map_uri_format -t string 'http://mt.google.com/mt?n=404&v=w2.11&x=%d&y=%d&zoom=%d'
ln -sf /media/mmc1/maps/street /home/user/apps/maemo-mapper
 
Posts: 191 | Thanked: 10 times | Joined on Feb 2006
#86
Originally Posted by ioan
for those who use windows at home, I made a windows application to help you download maps for maemo-mapper on your computer and transfer them on your nokia 770 when you need them. here is the link:
http://www.barghis.com/winmapper.htm
the app maps are comparible with maemo-mapper, I used qnuite's code (converted to delphi) to download the maps.
the source code is included

thanks,
-ioan
great tool!

but there's a slight problem with the lat/log parsing, if the decimal seperator in the system/locale is not "." (ie. if it's ",") then you have to fix the coordinates (replace "."'s with ","'s) or it won't parse them.
 
Posts: 61 | Thanked: 36 times | Joined on Feb 2006 @ Harpenden
#87
And here's a (very)quick and (very)dirty Python script to scrape maps.

Code:
#!/usr/bin/env python
import sys,os
from math import *
from optparse import OptionParser
from urllib import urlretrieve

MERCATOR_SPAN=(-6.28318377773622)
MERCATOR_TOP=(3.14159188886811)
WORLD_SIZE_UNITS=(1 << 26)

def latlon2unit(lat, lon):
	unitx = (lon + 180.0) * (WORLD_SIZE_UNITS / 360.0) + 0.5
	tmp = sin(lat * (pi / 180.0))
	unity = 0.50 + (WORLD_SIZE_UNITS / MERCATOR_SPAN) * (log((1.0 + tmp) / (1.0 - tmp)) * 0.50 - MERCATOR_TOP);
	return (unitx,unity)

def tile2zunit(tile, zoom):
	return ((tile) << (8 + zoom))

def unit2ztile(munit, zoom):
	return ((int)(munit) >> (8 + zoom))

def loadImage(x,y,zoom):
	url = "http://mt.google.com/mt?n=404&v=w2.11&x="+str(x)+"&y="+str(y)+"&zoom="+str(zoom)
	destination = dirpath+"/"+str(y)+".jpg"
	if(os.access(destination,os.R_OK) == False):
		print "Downloading "+url+" to "+destination
	else:
		print "Already got " + destination
	urlretrieve(url,destination)
	

parser = OptionParser()
parser.add_option("-t", "--start-lat", dest="startlat",help="start latitude",type="float")
parser.add_option("-l", "--start-long",dest="startlong",help="start longitude",type="float")
parser.add_option("-b", "--end-lat", dest="endlat",help="end latitude",type="float")
parser.add_option("-r", "--end-long",dest="endlong",help="end longitude",type="float")
parser.add_option("-z", "--zoom",dest="zoom",help="zoom level",type="int")

(options, args) = parser.parse_args()

(sux,suy) = latlon2unit(options.startlat,options.startlong)
(eux,euy) = latlon2unit(options.endlat,options.endlong)

if eux < sux:
	x = eux
	eux = sux
	sux = x

if euy < suy:
	y = euy
	euy = suy
	suy = y

start_tilex = unit2ztile(sux, options.zoom + 1);

start_tiley = unit2ztile(suy, options.zoom + 1);

end_tilex = unit2ztile(eux, options.zoom + 1);

end_tiley = unit2ztile(euy, options.zoom + 1);


numMaps=(end_tilex-start_tilex)*(end_tiley-start_tiley)

print "About to retrieve "+str(numMaps)+" maps"

for x in range(start_tilex,end_tilex):
	dirpath="maps/"+str(options.zoom)+"/"+str(x)
	if(os.access(dirpath,os.W_OK) == False):
		os.makedirs(dirpath)
	for y in range(start_tiley,end_tiley):
		loadImage(x,y,options.zoom)
Code:
./getMaps.py -h
usage: getMaps.py [options]

options:
  -h, --help            show this help message and exit
  -t STARTLAT, --start-lat=STARTLAT
                        start latitude
  -l STARTLONG, --start-long=STARTLONG
                        start longitude
  -b ENDLAT, --end-lat=ENDLAT
                        end latitude
  -r ENDLONG, --end-long=ENDLONG
                        end longitude
  -z ZOOM, --zoom=ZOOM  zoom level
use it like
Code:
 ./getMaps.py -t 51.82 -l -0.3 -b 51.49 -r 0 -z 4
 
Posts: 481 | Thanked: 190 times | Joined on Feb 2006 @ Salem, OR
#88
Originally Posted by disq
great tool!
but there's a slight problem with the lat/log parsing, if the decimal seperator in the system/locale is not "." (ie. if it's ",") then you have to fix the coordinates (replace "."'s with ","'s) or it won't parse them.
you mean when you read from the .kml file? I knew from the moment I wrote the code that that will be a problem, but I have no idea what char they use to separate the two coordinates (what char from regional settings). if the decimal symbol is a "," will the coordinates be separated by "." ? :-) post here an example of a kml file, with your regional settings and I will fix it.

-i
 
Posts: 191 | Thanked: 10 times | Joined on Feb 2006
#89
Originally Posted by ioan
you mean when you read from the .kml file? I knew from the moment I wrote the code that that will be a problem, but I have no idea what char they use to separate the two coordinates (what char from regional settings). if the decimal symbol is a "," will the coordinates be separated by "." ? :-) post here an example of a kml file, with your regional settings and I will fix it.

-i
the coords in the .kml file are correct (with "." as the dec seperator) and are loaded OK, but when you hit "download" delphi throws out an exception saying that it can't parse the float. you edit the coords (replacing the "." with ",") and hit download again, it works.

regional stuff in the control panel are Turkish/Turkey.
 
Posts: 481 | Thanked: 190 times | Joined on Feb 2006 @ Salem, OR
#90
Originally Posted by disq
the coords in the .kml file are correct (with "." as the dec seperator) and are loaded OK, but when you hit "download" delphi throws out an exception saying that it can't parse the float. you edit the coords (replacing the "." with ",") and hit download again, it works.

regional stuff in the control panel are Turkish/Turkey.
fixed, please try now and let me know
 
Reply

Thread Tools

 
Forum Jump


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