Show WiGLE-data in Google Earth (WiGLE to KML)

Suggestions for WiGLE/JiGLE/DiGLE

8 posts • Page 1 of 1
I started an experimental project to fetch and parse WiGLE-data into a KML using Google Earth's "Network Link"-feature.

-PHP5 with SQLite3 support (via PDO)
(code was tested with Server2go)

here (ca. 1 MiB)

Put everything on a server meeting the requirements. In Google Earth add a "Network Link" to the wigle.php. On the first use, you'll be asked for a username and password - enter your WiGLE-credentials there. (The project is prepared for multi-user-use.) The PHP will check whether the needed area is already in the SQLite-cache or it will request the data from

For now there's no expiration of cached data. So to force it to reload a specific area, you have to use an SQLite-db-tool (such as SQLite Spy) and manually delete the desired area from the wigleareas table (using a DELETE FROM-statement).

The file CachedWigle.file.class.php is NOT working. It was meant to store everything in separate files but then I decided that SQLite is a bit easier and better to implement.

If you change the class CachedWiGLE in wigle.php to just WiGLE, you'll deactivate caching and all requests will be made directly to the server. But note that the server will block you after some few requests.

The file MAC_OUI.bin contains a MAC-address to company-mapping. You can update it by putting the files iab.txt and oui.txt from the IEEE-homepage into the directory. They will get parsed automatically and the file MAC_OUI.bin will get updated.

Have phun!


Postby jvisser » Mon Mar 24, 2008 9:33 am


Creating a KML file is something I have been trying to do for a while. I have had a play around with some of the kismet to kml scripts, but having one created using the network link feature I think would be great....

Only issue is when I just tryed loading up your pages and database it seems to fail... in google earth I get the error:

error at line 1, column 0:

File has missing or bad root element.

Im afraid I have little to no experience with this kinda feature in google earth, but have a bit with PHP and sql type applications.. and I cant see a problem on that side, all files and folders have write permissions, and it isnt throwing any warnings or errors.

I am running Ubuntu Gusty with a Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 setup (sqlite3 installed with php modules).

If you need anything else let me know, it would be great if you could help me to get this to work.. or point me in the right direction.


Postby riddick » Mon Mar 24, 2008 9:58 am

Only issue is when I just tryed loading up your pages and database it seems to fail... in google earth I get the error:

error at line 1, column 0:

File has missing or bad root element.
This sounds as if there is no KML returned. If there's really no PHP error occurring, it may be because of missing auth data. Do you get a box asking for a username and password for "WiGLE2KML"?

You may also try opening the wigle.php in a browser window directly to see what the output looks like.

Append a bounding box with coordinates like the following:

http://someserver/somepath/wigle.php?BB ... 3.50,52.09

The order is: west, south, east, north border of viewing box. Negative values are Western/Southern hemisphere, positive values are Eastern/Northern hemisphere.

If you get the auth window there and after entering credentials you get something XML-like (see page source), it really is because of Google Earth not showing the auth window.

In that case, try setting the credentials manually in the file wigle.php. Delete the block:

Code: Select all

if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="' . $kml->name . '"'); header('HTTP/1.0 401 Unauthorized'); echo $kml->throwError('Please authenticate first!'); exit; }
and set the following two lines to your WiGLE-username and -password.


Postby jvisser » Mon Mar 24, 2008 1:59 pm

G'Day again,

I feel like a bit of an idiot now... turns out there was a problem with the way i had my pecl_http module loading... so I was actually getting an error on the http_post_fields() command....

Its all fixed now and is working like a charm. I would be interested in seeing any further updates you make, and I was having a bit of a play to try and getting the info boxes to show some other information as well (like encryption mode) and other generic information.

Thanks for this great package.


Postby evyncke » Fri Apr 04, 2008 6:33 am

Very interesting work, just a couple of gotchas:
- LOG_FILE should not be in the current directory but rather /tmp/wigle.log (specially on Linux systems)
- database file wigle.db3 should be owned by www-data or apache or whatever userid apache runs on
- pecl install pecl_http, pecl install pdo, and on Linux PHP_PDO_SHARED=1 pecl install PDO_SQLITE are really your friends

Alas, nothing is displayed on my google earth (see my other post about the wigle API error message).

But, great work! Thanks

Postby themacuser » Tue Apr 22, 2008 7:47 am

Nice work.

I had something half-written to do this in Python already, but never quite finished it. Guess I should.

Postby mparker37 » Fri May 30, 2008 2:39 pm

I tried this at ... 3.50,52.08 but just get an empty file returned.

Any ideas?

I don't really understand php, so please excuse me if I'm being slow


I've tried to copy this project because the links are super old like this topic.


It all works if i pass a lat and long. I just cannot get Google Earth to send what I want.

If someone could explain the BBOX that'd be great or if you can upload the files again.

8 posts • Page 1 of 1

Return to “WiGLE Project Suggestions”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests