# Hack 19. Analyze Elevation Profiles for Wireless Community Networks

A web application and a few digital elevation models can significantly ease the pain of building wireless community networks in remote areas.

If you're trying to build wireless community networks out in the hills, like the NoCat Network has done in Sonoma County, California, the first thing you discover is that hills eat Wi-Fi signals for lunch. Modern wireless networking technologies, like 802.11b, need a line of sight to establish a connection, and any significant amount of intervening terrain, trees, or buildings between two points will quickly ruin your chances of setting up a long-distance, point-to-point wireless connection. In places where DSL and cable are unavailable, however, point-to-point community wireless links are often the only way that local residents can get high-speed Internet connectivity, so there's often a lot of motivation to find ways to work with the surrounding terrain.

Naturally, the first question a newbie asks when he shows up at a community network meeting is, "Can I get on the network?" The answer is, inevitably, "That depends. Where do you live?" Armed with the GPS coordinates of the newbie's house, you can do a certain amount of terrain analysis using digital elevation models (DEMs) in commercial software like TopoUSA or free software like GRASS. The downside to this is that, if you have 50 would-be participants in a community network, then the total number of possible links to evaluate is, apropos of nothing else, 50 x 49 2 = 1225. That's a lot of work to do by hand!

There had to be a better way. Our ambition was to create a tool that would allow a community member to get their house on the NoCat Network with nothing more than a compass and a Wi-Fi card with a high-gain antenna. We demonstrated that, using GRASS, we could extract elevations from 10-meter-resolution USGS DEMs along the line connecting two locations and use them to plot a contour profile with Perl and the GD::Graph module from the CPAN. If the elevation of the straight line in three dimensions between those two points is less than or equal to the elevation at any point along that line, then there's a hill in the way, and a link probably won't be feasible. If the elevation of the line of sight is above ground elevation along the whole distance, then a wireless connection might be possible (but see the caveats mentioned later in this hack).

We took the contour profiler from GRASS and combined it with a web-based network node database, so that any new locations would be automatically tested against all existing locations for link viability. Finally, we added a rudimentary address geocoder based on TIGER/Line for users who didn't know their GPS coordinates already. The result was NoCat Maps, which now lives at http://maps.nocat.net/.

Now, when people come to NoCat Network meetings and ask how they can get on the network, they're told to go to the web site and add themselves to the database. If they know their GPS coordinates, they can enter them there; otherwise, their address is looked up in the TIGER/Line database of Sonoma County. The application analyzes the elevation profile along the line of sight to every other possible node and then presents the user with a list of possible connections, as shown in Figure 2-16.

Figure 2-16. View likely point-to-point links at a glance

The listing of possible links comes sorted by clearance, approximately how much room a link has to spare, given the intervening terrain, ignoring Fresnel zones and so on. Antennas are assumed to be at least 5 meters off the ground, so the maximum possible clearance is about 16 feet. A negative clearance indicates the presence of a hill at least that high in the way. Additionally, since we know the latitude and longitude of both points, we can calculate the straight-line distance and true bearing for each possible link. This means that, if you know that there's a live antenna at a given node and NoCat Maps suggests that a link might be possible, you can go outside with a Wi-Fi card, your own high-gain antenna, and a compass and give it a shot, before you ever show up at a meeting.

The original contour profile has been preserved, as well. If you click the "View" link next to any pair of nodes in the node listing, you get a PNG file depicting the line of sight and the elevation profile between them. Figure 2-17 shows a potentially successful link, while Figure 2-18 shows one doomed to failure.

Figure 2-17. One possible point-to-point link

Figure 2-18. This is not the link you are looking formove along

What are the caveats of using such an application? First, the data takes no account whatsoever of ground clutteri.e., buildings, trees, etc. Realistically, it's difficult to do so, because these things change a bit from month to month and year to year. One approach, suggested by Jerritt Collord, might be to integrate the 30-meter-resolution Shuttle Radar Topography Mission (SRTM) data, which could be compared against a matching DEM to infer the presence of ground clutter.

However, even were we to correlate against SRTM data, we'd still run into the other general caveat of NoCat Maps, which is that the resolution of the DEMs isn't perfect for the task. Experience shows that 10 meters in one direction or another can easily be make-or-break for a wireless link, much less 30 meters. As a result, NoCat Maps does rate some proven, working wireless links as being impossible, and it calls some other links possible that later turn out not to be. The practical upshot is that NoCat Maps is intended to provide a rule of thumb, a starting point for planning community networks, rather than a definitive resource. If a link looks marginal, it's often worth trying anyway!

Creating an application like NoCat Maps has become much easier in the last three years. For starters, you no longer need to create your own custom geocoder to get the latitude and longitude of a particular street address; instead, you can use geocoder.us, as described in [Hack #79] and [Hack #80] . One can also lighten the load of the application quite a bit by using the Geo::GDAL Perl module from the CPAN to directly access DEM files, instead of having to integrate with GRASS. There are plans afoot to improve NoCat Maps and to publish a new version of the software under the GPL, so that anyone can download and implement a NoCat Map database for her own community network. We recommend checking http://maps.nocat.net/ for more details.

Mapping Hacks: Tips & Tools for Electronic Cartography
ISBN: 0596007035
EAN: 2147483647
Year: 2004
Pages: 172
Simiral book on Amazon