Look around their site; everything's pretty clear. http://www.opencellid.org/ requires you to register to update the database, but not to query it. The api is at http://www.opencellid.org/api . The raw data is at http://www.opencellid.org/data/
The script appears below, but it's a hack at the moment. I couldn't find an FSO method to get the cell tower id, so I'm tailing the log to get it instead. Also, I'm using the agps-onlinec app from the wiki to actually seed the AGPS. This writes directly to /dev/ttySAC1, which really is not the right way to do it in FSO-land. Still seems to work, though. You also need an account with u-blox to get the ephemeris and almanac data. These are free and instructions are on the wiki. dima On Sun, 11 Jan 2009 01:05:09 +0100 Stefan Schmidt <ste...@openmoko.org> wrote: > Hello. > > On Sat, 2009-01-10 at 07:48, Dima Kogan wrote: > > There are several free databases of GSM tower locations. I wrote a > > perl script that I run on my gta02 to query > > http://www.opencellid.org/ for the approximate tower location, and > > then initialize the AGPS with this data. Works great. The database > > is built from user submissions, so it's not complete, but it will > > grow. > > Haven't found this one yet, looks interesting. > > As you already used it you may could answer some questions the > website did not cover. What is the actual license? They write > creative commans and the link points to the project side. Is it by-sa > mentioned on the website or is this for the website content? > > Are there dumps of the db or is it only available via a http query? I > ask because I would prefer to have it directly on the phone, without > internet connection. > > As I said, looks like the most promising candidate so far. :) > > Any chance to share your script? > > regards > Stefan Schmidt > > _______________________________________________ > devel mailing list > devel@lists.openmoko.org > https://lists.openmoko.org/mailman/listinfo/devel #!/usr/bin/perl -w use strict; my username $ublox_username = BLAH; $ublox_password = BLAH; open(FSOLOG, "grep cid /var/log/frameworkd.log | tail -n 1 |"); my $regline = <FSOLOG>; defined $regline && length($regline) or die("couldn't grab log line\n"); close(FSOLOG); # keep only the data inside {} $regline =~ s/.*{(.*)}.*/$1/; my ($mcc, $mnc, $lac, $cid); while($regline =~ /'([\S]+)':\s+([\S]+),/g) { my ($key, $value) = ($1, $2); $value =~ s/.*'(.*)'.*/$1/; if($key eq 'code') { $value =~ /^[0-9]+$/ or die("code not numerical\n"); ($mcc, $mnc) = $value =~ /^([0-9]{3})([0-9]*)/; } elsif($key eq 'cid') { $value =~ /^[0-9a-fA-F]+$/ or die("cid not hex\n"); $cid = hex($value); } elsif($key eq 'lac') { $value =~ /^[0-9a-fA-F]+$/ or die("lac not hex\n"); $lac = hex($value); } } my $celldataHeader = qr{<rsp stat="ok">}; my $celldataFooter = qr{</rsp>}; my ($lat, $lon, $pac); my $url = "http://www.opencellid.org/cell/get?mnc=$mnc&mcc=$mcc&lac=$lac&cellid=$cid"; print "$url\n"; open(CELLDATA, "wget -q -O - '$url' |"); while(<CELLDATA>) { next unless /$celldataHeader/ .. /$celldataFooter/; # only leave header, footer, everything inbetween next if /$celldataHeader/ || /$celldataFooter/; # toss header and footer ($lat) = /lat="([\d\-\.]+)"/ or die("couldn't parse latitude\n"); ($lon) = /lon="([\d\-\.]+)"/ or die("couldn't parse longitude\n"); ($pac) = /range="([\d\-\.]+)"/; if(!defined($pac) || $pac > 100) { $pac = 20000; } else { $pac = 2000; } } close(CELLDATA); defined $lat && defined $lon && defined $pac or die("lat, long, pac not all defined\n"); my $cmd = "~/agps-onlinec -c full -u $ublox_username -k $ublox_password -la $lat -lo $lon -p $pac"; print "$cmd\n"; system($cmd); _______________________________________________ devel mailing list devel@lists.openmoko.org https://lists.openmoko.org/mailman/listinfo/devel