Featured image of post Wigle to Google Earth

Wigle to Google Earth

How to show Wigle search results in Google Earth

To learn about Wigle basics, check this OSINTCurious blog post

Getting the Wigle data in JSON format

We will start by using Wigle API to download the data:

  1. Go to https://wigle.net/account and log to your account:

  1. Click show my tokens

  1. In new tab open https://api.wigle.net/swagger

  1. Click Authorize button on the right

  2. Copy the API Name and API Token from first tab into the username and password inputs (respectively) in the Basic Authentication dialog then click Authorize.

  1. Scroll down until you find “Network search and information” tools and click it

  1. Select /api/v2/network/search then Click Try it out button:

  1. Fill the search details:

    You can use https://wigle.net/mapsearch to find search and get specific address longitude and Latitude

  1. Click Execute

    The result per request is limited: Defaults to 25 for COMMAPI, 100 for site. Bounded at 1000 for COMMAPI, 100 for site.

    You can use searchAfter parameter to download multiple result pages.

  1. Click Download

Now You have the result in JSON format file and we need to convert it to KML/KMZ to use it in Google earth.


KML

KML is an acronym for Keyhole Markup Language developed by Google and Keyhole, Inc. KMZ is the zipped version of a KML file. 1

KML and KMZ are file extensions used in Google applications, specifically Google Earth and Google Maps. 2

The code below shows a minimal KML file:

<?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
      <Placemark>
        <name>New York City</name>
        <description>New York City</description>
        <Point>
          <coordinates>-74.006393,40.714172,0</coordinates>
        </Point>
      </Placemark>
    </Document>
    </kml>

Magic

To convert JSON to KML, we will convert each parameter as following:

  • ssid > name
  • trilat, trilong > coordinates
  • All the remaining details > description

Also we can add shared style to change the default icon for the placemark. I usually use https://www.iconfinder.com/ for icons as it’s easy to just copy icon URL .

Example of shared style code:

    <Style id="SharedStyle">
        <IconStyle>
            <Icon>
                <href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>
            </Icon>
        </IconStyle>
    </Style>

Method 1 :

  1. Convert JSON to CSV using this tool: http://convertcsv.com/json-to-csv.htm

  1. Copy or download the result (CSV) to use it in the next tool.

  2. Convert CSV to KMl using this tool: http://convertcsv.com/csv-to-kml.htm

    Enter fields number as following:

Method 2:

Using python module simplekml, I wrote a script to convert Wigle JSON to KML :

https://github.com/salaheldinaz/wiglejson2kml

Enjoy!


  1. https://en.wikipedia.org/wiki/Keyhole_Markup_Language ↩︎

  2. https://developers.google.com/kml/documentation ↩︎

Powered by 🐍 Python
Built with Hugo
Theme Stack designed by Jimmy