Childhood, partly revisited

If you’re of similar vintage as myself, you’ll remember a television program called “Reading Rainbow”.

Well there’s one episode that has forever stayed with me. It will be of no surprise that the topic is airplanes. It originally aired March 24, 1990 – when I would have been just about six. Life’s been quite crazy lately, and when I found this a couple weeks ago it was a lot of fun to go back and see again.

It starts with a crazy tale of two kids who build a working airplane by tearing apart all sorts of things around the house, fly it around, get caught, and put everything back together by dinnertime.

My how many homebuilders wish it could be that easy.

Then there’s a historical look through flying, a look at the airlines, and then at 14:51 begins a flight lesson for the host – LeVar Burton.

There are things in that episode that I always remembered – steering with your feet, not your hands. Testing fuel for water.

But there were things I never remembered – like the fact the plane used was a Cherokee (Cherokee Six to be exact, I’m not sure why such a big plane was used.)

If you remember it too (or even don’t) – check it out sometime.

First Flights: A review

I wrote this several years ago, and never got around to publishing it. Now that this and another of Jill’s books (Oshkosh Memories) are available for the Kindle, it’s time to set it loose. -Adam

An unscientific survey yielded an answer I already knew to begin with – on a pilot’s list of favorite things to do, the activity immediately below flying itself is to talk about flying.

Capitalizing on that is a book compiled by Jill Rutan Hoffman (yes, that Rutan. Jill is a pilot (Dick’s daughter, Burt’s niece) and no stranger to flying or the aviator’s way of life).  First Flights documents various first experiences from the perspectives of the pilots who flew them.  There are stories from the Rutan family (including Jill’s husband Lars’ first flight in a U2), stories from people you’ve heard of from EAA, and stories from people you’ve not heard of.

The stories will put you in 40+ right seats for 20 bucks. (2012 edit: now $4 on Kindle!) You’ll learn, you’ll laugh, you may even shed a tear (but in that same way I
can’t make it through the reverse jib shot over the kid riding a pedal plane down the mini-runway of the observation area in Brian Terwilliger’s documentary “One Six Right”), and I’m certain First Flights is one book you’d never want your money back on.  And in regards to money, every penny that doesn’t pay for the paper it’s printed on goes to support aviation as well as space programs for kids.  The stories, artwork, and Jill’s time gathering and publishing were all donated.

So sit back on your favorite airport bench off the active, and experience the stories: the guy so passionate about flight he took five Cessna-sponsored $5 introductory flights before getting caught; the farmer who jumped off his tractor to first flight a stranger’s homebuilt; the world speed record for a glide from FL380 to 0; riding a UAV like a horse; the first dock with Mir; and dozens of others. I read it straight through on the first sitting, and I bet you’ll want to also.

Operation: 28 Huge Success

To quote Portal “This was a triumph / I’m making a note here / huge success / it’s hard to overstate my satisfaction”.

Goal 1: Have fun in the airplane: absolutely attained.

Goal 2: 28 takeoffs and landings at different airports in a single day: not so much. I gave up on that one pretty quick with everywhere within 150nm forecasted (and the forecasts were right as we watched through the day) crosswinds gusting to 28 knots. First route idea? Scrapped. Second? Scrapped. So everything I’d done detailed was out the window, we were going to have to make it up as we went. We preflighted, checked the map one last time and the winds were far more reasonable East, by the time you hit St. Louis – so we pointed the nose that way. Nathan had the idea of following the Missouri river, so that’s what we did, leading to an interesting ATC conversation.

“65 hotel, confirm destination is 1H0?”
“Affirmative, we’re taking the scenic route along the Missouri river banks.”
“OH! That route’s better anyway.”

I was joined by Nathan (the guy who got me into flying small airplanes) and his girlfriend Jenne Lou. We’re all three pilots, and hopefully Nathan and I didn’t teach her any bad habits from the midwest – but there’s no question she’s good at flying airplanes. After training and flying in Boston, “eehhhhhh just follow the river” and controllers that strike up short conversations with you was completely new to her. They use airplanes for lots of “freedom” things up there but out in this simpler airspace the term takes on a whole new meaning. This was their first experience flying the G1000 and my first experience really taking it away from home. The situational awareness it brings to the party is really something else. XM weather was nice to check on a couple things, and for making the airshow TFR at Columbia big and yellow. I’m a believer in the extra safety it brings to the party, and we didn’t even have the MFD (multi-function display) for most of the flight (we duplicated the PFD (primary flight display) onto it.)

With flight following to get us through the KC class Bravo (wow the frequencies in central MO were quiet) we made it to Washington, MO KFYG after deciding we didn’t need to go as far as planned. Winds there were something like 4 knots. Nothing like when we left (and it actually WAS gusting 28-30 at Lawrence) It was a great airport to stop at anyway – reasonable fuel, and they have a large covered pavilion with picnic tables. We chose to break into the packed sandwiches inside the air conditioned terminal, hung out there for a couple hours and started planning. We had several reasonable options staying in Eastern Missouri with reasonable / comfortable winds.

After finding the key to the airplane (I “lost” in the door lock) South to St. Clair, Southwest to Sullivan, Southwest to Cuba, Southwest to Rolla and then to Jefferson City whose primary runway was 12 – it was actually the worst crosswind of the day but by this point we were getting quite hot (unlike the trip out, this was all low altitude with 20ish miles between stops with outside air temperatures in the high 90s and small airplanes are usually ovens down low) and really needed a break. On landing at Jefferson City the FBO pointed us to the free ice cream in the freezer by the pilot lounge. They didn’t have to tell us twice – that and more rest / water helped a lot.

We cut a couple more airports that would require backtracking out of the route for the trip back and made Jefferson City to Boonville, Marshall and Higginsville where we planned to stop for fuel and head home. But self-serve fuel wasn’t working, and one of the local pilots wasn’t sure who to call.

So we climbed back in the airplane, and make the 26nm trip to Warrensburg where Nathan went to college and fueled up, got a group photo and launched for home through the KC Bravo again.

We got back into Lawrence about 30 minutes before the FBO closed and the plane was due back, though it took most of that time to get everything gathered back up and clean the airplane out a bit.

I fly single pilot (or in a situation with an instructor who’s trying to keep my workload high) a very large majority of the time and I cannot express how incredible it was to have three pilots in the plane. I didn’t have to look at a chart all day – just a quick request for whatever information I needed and I had field elevation / frequencies from the back seat with flying help from the right while I reset avionics, briefed through and got ready for the next landing. If I’d tried this solo it would not have been nearly as fun and probably just a huge frustration. The flight was not a success on the back of any of us individually – it was 100% team. We were totally exhausted by the time we got back and probably couldn’t have done much more without being at an unsafe level of fatigue.

At Warrensburg I found out between takeoffs / landings / touch and goes and go-arounds we were at 26 loggable operations. Make it to Lawrence it’d be 28. It’s not 28 airports in a day, but the weather just did not cooperate with those goals. We flew 565.2 miles in the day, put 6.1 hours on the Hobbs meter (and  and I don’t think the fun meter goes high enough for any reading other than “pegged”.

Thanks Nathan and Jenne Lou for coming down from Boston and helping make this dream / goal reality.

I believe this was on the 5th landing? I was busy at the time :)

I don’t think words can describe how much I love the wind computer on the G1000. This was actually on short final – ground winds were 10kts but a few hundred feet up was a different story. No gusts, super easy to correct for.

Jenne Lou trimming the plane out for better speed (we trued at 120kias a decent amount. The 172 really impressed me.)

Nathan flies and checks out the Android EFB options. (editorially, I am not impressed even though they are a lot cheaper. They’re so clunky. iPad + ForeFlight 4 life!)

No clue where this was. I’ve got a few runway shots we tried to get when we remembered.

I think this was Marshall – they had some pretty awesome house locations (for those who like airplane noise.)

The worst crosswind of the day at Jefferson City. The airport is really picturesque, especially with the state capitol on the other side of the river.

Higginsville I think.

No idea here either.

How do YOU celebrate a birthday? I’m going flying.

After some scheming, some brainstorming, and some encouragement, this weekend is going to be a memorable one.

I’ve been kicking around for months the idea of hitting 28 airports in a day as I turn 28. It’s a challenge that only gets harder as I grow older (though the Wichita man who did 50 for his 50th boggles my mind) and after some encouragement from my family, it’s time to do it.

With any luck, I’m headed tomorrow on a trip that should be a lot of fun.

After much planning I eliminated my first choice of aircraft, the 162 SkyCatcher. I’m not going to judge the airplane yet, but there wasn’t enough time to finish transition training, and I could tell this much time in that airplane would leave me pretty uncomfortable physically. The 152 dropped off the list because of lack of equipment, comfort, and just not being fast enough.

So the mighty 172 it is! While my flying club figures out what our next airplane is I’m utilizing the fact I stay checked out in the fleet here in Lawrence to grab one of their birds for the day. I’ll be taking N2465H, a 2005 172SP with a fuel-injected 180hp Lycoming and Garmin G1000 glass panel. While I have hours in the G1000, I’m looking forward to really learning what it can do cross-country.

But now I had weight to spare, and a long trip for it. So I sent a random email to my friend Nathan who pushed me over the edge into learning to fly. We’ve had a few adventures, including a trip out to the Beaumont hotel. Taxi across main street on your way to lunch? Yes please.

Man, I miss that plane…

And I got the weirdest answer back, because I knew it was a long shot of long shots. “could be able to work something out.” Well the details worked out and he and his girlfriend (also a pilot) are coming in from Boston to help out.

It’s going to be a lot of fun and a definite challenge.

Obviously with something like this safety is a big deal. I will not let a number goal compromise safety. There’s a number of weather or fatigue factors that can come into play so officially the goal is to have fun. If I make the landings goal, fantastic. The best I can tell from my logbook 15 is my most in one day, from back during the solo phase of my primary training. Since then 8 in a day isn’t all that special so both those numbers can be goals. But this is Kansas – known for its winds. I don’t know the route yet, we’ll see what the weather says. I have a few routes sketched out – one West all the way to Colorado and back and one South to the Joplin area stopping at a bunch of fields sentimental to Nathan and myself from training in the area.

But it’s going to be a LOT of fun.

Sometimes you don’t get to fly.

Sometimes planes just do NOT want to fly. And it’s our responsibility as pilots to determine when that is and act accordingly.

Remember, as Jason Miller always says on The Finer Points, be surprised when the airplane works, and know what you’re going to do when it doesn’t.

This weekend falls into that classification quite well.

Friday I decided to use my last vacation day of the year to go flying and have some fun. The clouds were low overcast when I woke up and didn’t clear until around noon, so I headed to the airport, preflighted, and got ready to go flying. After starting up I taxied through the ramps surrounding the hangars to “the contact point”, a large black circle painted on the ramp with “CONTACT TOWER 121.6″ in big letters. I made my normal callup, which for this day was “Joplin Ground, Cherokee 9203 juliet at the contact point with alpha, ready to taxi”. I got my usual response for Joplin, where south winds prevail and it’s rare you get anything other than runway 18. “Cherokee 9203 juliet, taxi to runway 18 via delta, cross one three three one.” and I read back the clearance, released the parking brake and started moving. And got a startled controller frantically requesting I read back the clearance I had been issued. So I did. And he asked again…something’s not right here. Then he called for a radio check, and I responded loud and clear and requested one myself. Nothing.

So I turn right, into the area that’s normally transient tiedown parking and start triple-checking EVERYTHING. Intercom knobs, switches, buttons on the audio panel, knobs and buttons on the radio, everything looks exactly like it should. So I reverse course and taxi back to our hangar, where my handheld radio is in the car trunk. (yes, fail on my part. It wasn’t in my flight bag as it was supposed to be, and more importantly it had not been charged in a couple months. I replaced the original battery with a lithium version at Oshkosh this year, and had even brought the charger home with me but didn’t connect the two before now)

I fiddled with the handheld and the radio in the plane and was, with the volume WAAAY up, was able to hear myself in both places. So I figured I’d try it again, and taxied back over, attempted to call up, and of course no response to radio checks or other communication. So I taxied back to the hangar, shut down and called it a day – the handheld takes 8ish hours to charge fully, so it just wasn’t going to happen now.

I opened the cargo door and connected a battery charger – 2 amp rate. It was almost definitely not a case I’ve seen before where low battery voltage was causing lower power transmitted signal.

Another member had reserved the plane for a trip to see family Christmas day, but they cancelled after hearing of the radio trouble and I started thinking – I did have a handheld after all, which was reliable when charged. I could use it to get out of and back into our class delta airspace and do all my airwork in uncontrolled airspace. I printed out light gun signals, reread no radio procedures, and worked out mental plans on how this was going to come together. So I went to the airport, preflighted, locked the door and called tower on my cell phone.

I told him about the installed radio issues and that I intended to use a handheld. He was concerned, but quizzed me over all the various requirements about light gun signals and gave me a general warning that if he was unable at any time to make two-way communication, he would have to declare an emergency on my behalf. After all, there’s no way for him to know that it was a radio failure versus a cockpit fire. The good news is a wing-rock or flashed landing light from me is enough to acknowledge what I’ve been told via radio or light gun.

I fired up, let the oil temperatures come up, and taxi out. When I get to the contact point I key up on the handheld and make my callup, with an additional “how read” at the end. He gives me a clearance, says “loud and clear”, I read back and all is well. This is going to work!

I taxi out to the end of runway 18, receiving an additional transmission from tower while I’m enroute advising me that my handheld radio was actually clearer than a lot of the panel mount units other planes have. I start to turn and apply the parking brake so I can run up the plane. But the brake lever in my hand comes ALL the way up. Something is not right. I’ve applied parking brake twice this morning – once before starting the engine and as it warmed up. once when I reached the contact point and everything behaved nominally. But not this time.

Well now I have a decision to make. I don’t have a parking brake, but things feel alright at my feet, what am I going to do? It doesn’t take more than a couple microseconds to acknowledge I am in no way comfortable with this situation. I’ve looked at the braking system a bit before and I don’t know if it’s a “cotter pin” or some other fastener that let loose and now this lever is disconnected, or if the problem is upstream. And I’m not going to figure it out holding short of a runway, or even back at the hangar. Calls like this I’m not qualified to make about safety. (after looking at the system I assure you there are no cotter pins. You’d likely not find one on an aircraft anyway, but I was just thinking generally in terms of how a mechanical linkage might be done)

The last thing I want to do is cause a fuss, so I pull my phone out of airplane mode, re-dial the tower and advise him I’m not comfortable with how my parking brake is locking and that I’m going to request to return to the hangar via radio but don’t want to make a stir broadcasting it. He asks if I need any assistance and I decline. Hang up, pick up the handheld radio and I call that I’m holding short of 18 but need to go back to the hangar, but don’t have enough room to turn around so I’d like to pull on the runway and exit the first available taxiway. I’m cleared as requested, and as I start to roll I start assessing the situation. My left toe brake is very, very soft. In fact, it’s just not working at all. I assessed the situation wrong when I was parked and I’m down to one brake.

The taxi back was uneventful, aside from it being more difficult to maneuver when brakes are only applied at one wheel. I shut down, and crawled out on the wing and under the panel to see if I could see anything wrong. All linkages were intact, and there was no fluid in the cockpit. But as I jumped off the wing and crossed the plane, there’s a big old puddle of red. Brake fluid. I suppose we know what’s happening now.

So the plane’s down. It’s due for annual in December anyway, and was scheduled to be done on Monday and Tuesday, so perhaps this issue would have been found when going through all those checks. But I’m very glad it happened in a context like this and not after my flight. Losing one wheel braking on landing isn’t something I’ve given a lot of thought to, partly because you don’t really want to simulate it. But I promise you I’ll be thinking about it now.

Being a pilot is all about experience, and having memories of them in your bag of tricks to draw from. I’m glad that both some “near” no radio procedures and this brake issue are now in mine, and that nothing was damaged in the process.

A trip to Raptor country – the rollout of S/N 195, the final F-22

“Congratulations,” the email started, “you have been selected to attend our first Lockheed Martin Tweetup”. That led to frantic trip planning, and a bunch of excitement.

Twitter and these ‘Tweetups’ have given me an incredible number of experiences that most could never imagine, something I’m very thankful for. My first Space Shuttle launch at STS-129, visiting Mission Control for STS-130 (forever cementing my human space flight geekiness) technically our entry with @MyTransponder to the Boeing DreamLiner before the public were admitted at Oshkosh, and now this.

This? Being present for the factory rollout of the final F/22 Raptor, SN 195 and an opportunity to spend some time in one of the simulators (later learning it’s technically the “cockpit demonstrator.” While it is a real chunk of airframe with accurate controls, the things displayed on the screen and HUD are the unclassified version.) Oh, and we’ll be going through the C-130J and P-3 wing assembly lines. And I was one out of the 14 selected of 60 applicants.

We arrived and were escorted to B(uilding) 2 on Dobbins Air Force Base which connects to B-1, the building which holds the assembly lines for the C-130J, P-3 and (now being decommissioned) the F-22. There was mention of assemblies for the F-35 too, but we avoided those areas due to ITAR (International Traffic in Arms Regulations) concerns. Sound like a big building? Try 3.3 million square feet. To access our conference room, we had to walk into the factory area – and it was overwhelming. The sights, sounds and smell was very industrial – sort of like your local maintenance shop, only immaculately clean, tape on the floor indicating where each creeper, parts bin and tool box was to be kept when not required for some piece of assembly.

B-1 was built in a bit over a year to facilitate assembly of B-29s, and has been used for aircraft production most of the time since. It’s common to see anything from a small bicycle (with large baskets for carrying items) to full size pickup trucks driving in the aisles, which are the size of a normal two-way city street.

After introductions and discussing some of the rules (like no photography, period) we headed out through the factory floor, and inside the fenced-in-inside-the-building area where the Raptor was assembled – now empty, except for a single complete airframe, off the line and lit with spotlights. I incorrectly tweeted it looked baby blue – it did, but that was more due to the color the lights were programmed for. When it got outside it was definitely green, lighter so than you would see on a Boeing airliner, for instance, if you’ve watched their rollout festivities. A couple people spoke, a video was shown, and it was showtime. From our spot there’s a gigantic US flag under which is written “Through these doors pass the most awesome fighters in the world.” Some ways away more sobering statement can be found: “A mistake covered up may cost the life of a brave pilot.”

A loud bell began ringing (a safety indication that the hangar doors would be opening very soon) and a drumroll started. A local high school marching band would be following the plane. And the parade was off! The tug was pulling the airframe, followed by the marching band, the program and military leadership, and the employees. We were mixed into the employee group, the fourteen “tweeters” and our four “chaperones” who later said “it was easy to keep track of you all – we just had to look for who were looking down regularly and holding a smartphone”.

The convoy continued for some ways around the corner of the building and to the front, stopping at the intersection the Raptor would be taken down to be completed – testing the fuel tanks, final electronics work, and test flying before ultimately getting its paint and special stealth coatings and delivery in the summer of 2012. There the management, employee, marching band, and eventually we got our photos taken with the aircraft.

Photo courtesy Lockheed Martin

Photo courtesy Lockheed Martin

Everybody went back to work, and we headed back to our conference room for lunch. There two test pilots, Trigger (who of course would not explain his call sign) and JB (who wouldn’t even acknowledge HAVING a call sign) told stories and answered questions about their experiences doing production test flying on the Raptor.

After lunch came a split into two groups, and my group went out onto the C-130 and P-3 floor. Walking from station to station we saw a floor become an airframe, wings appear, and engines / propellers be installed until the very last spot where a completed Hercules awaited its trip to the paint booth.

Photo courtesy Lockheed Martin

Then it was time for fun – on to the cockpit demonstrator. It’s not full-motion, and the avionics displays aren’t the same since many capabilities are classified – but it’s a “legit” airframe and controls. We didn’t have much time, so we cycled in and out through air to air, air to ground and landing sorties – but the systems (at least what we could see) are incredibly advanced and pretty awe-inspiring.

Photo courtesy Lockheed Martin

If you came here expecting an objective view of the F-22 program, plane, or policy – sorry, this isn’t it. I’m a fanboy, and I will admit that without hesitation. This is an incredible aircraft with the technology to keep our pilots safe and enemies fearful. I’m thankful for the opportunity to visit and Lockheed Martin’s hospitality during our visit. Our entire group didn’t open a door during our entire visit – there was always someone there. It felt like we were actually somebody important. What a great trip!

Meta-blog about the blog

I’m going to go a little meta and discuss the aspects of this project behind the project itself.

Why would someone want to blog every day?

  • To educate those who don’t know what you do
  • To learn more about a topic you already know – regardless of what you think of your knowledge you will be doing LOTS of research and experimentation along the way.
  • To practice writing and communicating on technical topics. This isn’t easy, and I’ve been “writing” for a while.

What does it take?

  • Interest in the topic you’re writing about. A little (or lot!) knowledge helps too.
  • Discipline – nearly every day there’s some degree of “meh I do NOT want to do this, or at least there was for me. Once I reached the 3/4 mark though it switched to “meh I do NOT want to do this, but I’m so dang close to succeeding!”
  • Basic blog software. Like I said at the beginning of the month, my time was better spent writing content that taught than hacking on some blog I could then use. You’ll bikeshed the crap out of a blog you build yourself, don’t fall in this trap.

My advice

  • Take it small – I would up about 500 words (according to WordPress) a day by accident. Wasn’t a goal, but that’s about where things felt “done”
  • Work a little every day. I thought taking weekends off would give me a chance to pre-fill the buffer with entries and leave weeknights free – nope. I was too busy enjoying NOT writing and doing other things.
  • Pre-plan: I didn’t get to everything I put on my list, and things came up that I didn’t even think about. But when crunch time came to prep an entry for the next day, the list gave me a clear direction of a sequence that made sense and if all else failed gave me an idea I could run with on a short deadline. Ask people what they want to know about your topic. In my case I asked several experienced Django devs I know what they needed to know about GeoDjango, mixed in the stuff I thought they should know too and wrote them.
  • Don’t be afraid to cut into pieces, or walk through a “project”. There seem to be a lot of people showing up to read entries, but a lot of the time they’re coming a couple days after publication. And now the entries will be out “forever” so those that find it can continue at their convenience.
  • DO IT. You’ll learn a lot, you’ll practice even more, and you’ll help people who don’t know things just like others helped you when you didn’t know things.
  • Don’t shoot for more than a month.
  • Give yourself time off – weekends, Monday/Wednesday/Friday, anything.

It’s been fun, and this blog isn’t going anywhere – the topic sheet still has a bunch there. But I’ve got some life, and a mess of housework, to catch up on.

Allowing front-end geographic input

As great as the Django Admin is, it’s not for most of your users. So what do we do to allow user-submitted geometries?

Cue django-floppyforms which contains handy widgets we can use with our own forms and modelforms to allow geographic input.

Consider this model:

class MyArea(models.Model):
    name = models.CharField(max_length=64, unique=True)
    point = models.PointField(srid=4326)
    polygon = models.MultiPolygonField(srid=4326)

Throw this in views.py

import floppyforms as forms

from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext

from formstuff.myarea.models import MyArea

class OSMPointWidget(forms.gis.PointWidget, forms.gis.BaseOsmWidget):
    map_srid = 900913

class OSMMultiPolygonWidget(forms.gis.MultiPolygonWidget, forms.gis.BaseOsmWidget):
    map_srid = 900913

class AreaForm(forms.ModelForm):
    point = forms.gis.PointField(widget=OSMPointWidget)
    polygon = forms.gis.MultiPolygonField(widget=OSMMultiPolygonWidget)

    class Meta:
        model = MyArea

def editing(request):
    form = AreaForm(request.POST or None)
    if form.is_valid():
        form.save()
        return HttpResponseRedirect('/')

    return render_to_response('area.html', {
        'form': form,
    }, context_instance=RequestContext(request))

and users can drop points and polygons on your model, which will be saved into the database. Do you want the Google basemap instead? Extend BaseGMapWidget instead of BaseOsmWidget, remove the srid attrib, and you’re set. It’s amazing how easy those widgets make it – you don’t even have to know you’re dealing with a geometry in your save method.

Improving the Admin

The Django admin saves us mountains of time. Back when Django still wasn’t quite Django and it was an internal project it was common for the team to leave a meeting, scribble a schema on a napkin and have the admin ready for data entry in the matter of a couple hours.

Models are still my first stop for any project – build the basic frame, and start gathering data with the admin. But over the years we’ve all come to expect more from applications and Django has gotten much better tools for it too. Need to reorder fields? Hide the stuff that rarely gets entered? Use a custom form? It’s in the docs. With the GeoDjango admin though, things aren’t as well documented. So let’s look at some of the simplest things that can make an application better.

Changing the default map

Two modes are available, admin.GeoModelAdmin and admin.OSMGeoAdmin.  GeoModelAdmin uses very simple tiles from OpenLayers that have state lines, rivers / water sources and a few other unmarked areas. I can’t imagine how it would be useful because there’s nothing to reference from, but if you have your own set of WMS tiles you can set wms_url and it will use them.

By default when you load the admin you’ll find yourself looking in the Atlantic off the coast of Africa. If you’re US-centric, try

class CampgroundAdmin(admin.GeoModelAdmin):
    default_lon = -98
    default_lat = 38.5
    default_zoom = 3

Which will center you in a spot where you can see the entire US. default_zoom of 4 is a closer view if you don’t need to see New England. For Kansas, default_zoom of 6 gets you the whole state. Experiment with these three values and you can set up your web app to be “optimized” for entry anywhere. As even a neogeographer can tell, they’re in decimal degrees like you get from your GPS.

This works in OSMGeoAdmin as well (the admin I use the most). Just as it says on the tin, OSMGeoAdmin uses OpenStreetMap so there’s a LOT of data available on the basemap you edit on top of. BUT this piece of the docs means one thing – “that uses a spherical mercator projection” – we can’t just put decimal degrees in and it work. But we have the tools to make it work.

>>> from django.contrib.gis.geos import Point
>>> center = Point((-98, 38.5), srid=4326)
>>> center.transform(900913)
>>> center.y
4650301.836738959
>>> center.x
-10909310.097740812

We put these coordinates on the admin object, and get a street map in the admin for editing.

class CampgroundOSMAdmin(admin.OSMGeoAdmin):
    default_lon = -10909310
    default_lat = 4650301
    default_zoom = 6

Other options in the admin class are available but some of the ones I could see using don’t seem to work – like max_zoom / min_zoom. “modifiable” set to false will force geometries not to be editable, but that’s not particularly useful in the admin.

Adding More Layers

We can add additional WMS layers to our maps, too – in this example we’ll add the current NEXRAD radar composite and a Topographical map. (additional layer info can be found at http://trac.osgeo.org/openlayers/wiki/AvailableWMSServices but many of them did not work for me)

Add the map_template attribute to our admin class:

class CampgroundAdmin(admin.GeoModelAdmin):
    default_lon = -98
    default_lat = 38.5
    default_zoom = 6
    max_zoom = 18
    min_zoom = 6
    map_template = 'gis/admin/openlayers_extralayers.html'

Now we need to create the template, and the javascript that will initialize the additional layers.

In gis/admin/openlayers_extralayers.html we change which file is included:

{% extends "openlayers.html" %}

{% block openlayers %}{% include "gis/admin/openlayers_extralayers.js" %}{% endblock %}

And in openlayers_extralayers.js we define the new layers:

{% extends "gis/admin/openlayers.js" %}

{% block extra_layers %}
    topo_layer = new OpenLayers.Layer.WMS( "USA Topo", "http://terraservice.net/ogcmap.ashx", {layers: 'DRG'} );
    {{ module }}.map.addLayer(topo_layer);
    nexrad_layer = new OpenLayers.Layer.WMS( "NEXRAD", "http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?", {layers:"nexrad-n0r",transparent:"true",format:'image/png'} );
    {{ module }}.map.addLayer(nexrad_layer);
{% endblock extra_layers %}

IF you want this to be the default behavior for ALL of your admins, just name the file openlayers.html and openlayers.js instead of openlayers_extralayers.html/js. NOTE: If you do this you must copy/paste the entirety of openlayers.html and openlayers.js into YOUR openlayers.html and openlayers.js and put your code inside of the appropriate blocks. If you use my example, the template will extend itself, cause an infinite recursion and the dev server or your server process will promptly quit with no warning. Ask me how I know!! :)

You can download openlayers_extralayers.html and openlayers_extralayers.js for use in your own projects.

Note this won’t work with OSMGeoAdmin immediately unless you use the openlayers.html / openlayers.js naming and follow the above concerns. If you don’t want to do that (and I would try to avoid it because it could get you stuck on an old version of the javascript in the future) create your own osm.html:

{% extends "gis/admin/openlayers_extralayers.html" %}
{% block openlayers %}{% include "gis/admin/osm_extralayers.js" %}{% endblock %}

and osm_extralayers.js:

{% extends "gis/admin/openlayers_extralayers.js" %}
{% block base_layer %}new OpenLayers.Layer.OSM.Mapnik("OpenStreetMap (Mapnik)");{% endblock %}

Since we named it osm.html it will take over for all OpenStreetMap admins. If that’s not what you want, name it something else and override map_template on the admin class.

Another note: the Topo layer used doesn’t understand the OSM projection so it won’t work in OSMGeoAdmin.

Making simple map images with qGIS

Occasionally you just need a quick map, and it’s not going to be used for interaction or even necessarily display on the internet (say a Keynote/PowerPoint presentation, for example). We could build it as a Google map, get a gigantic computer monitor and fullscreen the window and take a screenshot, and have it look like every other web map out there – or we can reach into the toolbox of those who are NOT neogeographers and borrow a few things.

For me this tool is still qGIS (for Mac check out KyngChaos for binary builds), though there are alternatives like GRASS GIS and TileMill, to name only a couple. (TileMill is actually designed to create tiles similar to how Google Maps / OpenStreetMap do it, but you can shoehorn it to do “print” maps)

Of course, it bears repeating that the results from doing this are not survey quality. Don’t use my recommendations / guidance to determine where not to dig to avoid buried lines, where to build a road, or anything else. But zoomed back a ways where the dot on the map is easily the size of a 40,000 population town, it’s close enough.

Since this is a process with no code, I’m switching format a bit and creating a screencast, which you can see here as a QuickTime file.

Mentioned files you may want for your own maps: