Getting high quality graphics out of Quantum GIS

It’s hard to get print-quality graphics out of Quantum GIS (QGIS). There’s a kludgy command line method, but it doesn’t always work right (see that page’s comments). It’s stupid that you have to take a GUI-based program to the command line to get good graphics!

I asked for something straightforward 2 years ago (link), but it hasn’t gotten much traction. In the meantime, you can use the Print Composer as a workaround. Here’s how:

  1. Orient your QGIS viewport to fully include the part you want to export. It’s OK if it shows a little more than what you want to export. For example, I’m only wanting the gridded part of this view:
    qgis broad view
  2. File > New Print Composer.
  3. In the button bar, click Add new map (Add new map button).
  4. With the mouse pointer, draw a large rectangle on the canvas. It’ll show the view you you established in step 1 and more:
    Print composer - initial view
  5. Notice how the image is offset from center. Center this graphic in its box:
    1. Click the Move item content button (Move item content button).
    2. Figure out what you want to be in the center of the exported image. With your mouse inside the rectangle you drew, drag the image until the part you want to export is centered in the rectangle. In my case, I just moved it up a bit:
      Centered viewport
  6. Since I am really only shooting for the grid in my final output, I need to zoom in. On the bottom right side, click on the Item Properties tab. You should see a field named Scale. Gradually reduce the value in Scale, starting with about 10% at a time, until what you want almost fills the frame. Press enter after you change that number to see the effect of that change. After adjusting the scale down by about 1/3 (a smaller number in Scale zooms in the view), I finally have it looking as I want:
    Centered and zoomed in
    (I’ve filed issues to add a tool to zoom in and out of items and to better explain the scale field.)
  7. Click the Export as Image button (Export as Image button) and save the PNG using the dialog.

Voila, you have a high quality image! You may still need to crop it to get it just right.

If you need a higher resolution, then click on the Composition tab and change the DPI value to the right of Print as raster. (Print as raster is probably not related to the DPI; this has been filed as a bug (http://hub.qgis.org/issues/7973).) Export again.

Frequent Sitecore upgrades are good!

Frequent Sitecore upgrades have convincing benefits and lower its TCO.

My employer’s current practice is an annual Sitecore upgrade. I recommend this as the maximum interval; we should do more frequent upgrades when important-to-us new features, fixes, or enhancements are released. It may be prudent to even consider twice-a-year upgrades given Sitecore’s rapid release schedule.

Here’s the specific benefits of frequent upgrades:

  • Fast track putting UI enhancements and bug fixes into production.
  • Puts new features front and center. Even if we don’t use these features right away, they are often the basis of near-term enhancements.
  • Fast track putting enhanced modules into production. Many times, newer module versions require upgrades of the base product, too.
  • Avoids bifurcated environments. Aggressive upgrade policies reduce the pressure to try out and do development on newer releases than what we have in production.
  • Avoid cost of delaying implementing new features. We once delayed upgrading from 6.2 to 6.4. This contributed to not-aggressive-enough learning of 6.4’s enhancements, causing our old technology to get more deeply ingrained in our practices. This made our move to 6.4’s paradigm more complex.
  • Reduced upgrade complexity. We and other customers experienced difficult upgrades when we failed to upgrade frequently. Frequent upgrades means each upgrade is more of a snack than a huge meal.
  • Better supportability. While Sitecore has a generous support policy—they appear to support many versions going back—it is inevitable economic reality that dusty versions will have a harder support experience. The best companies are aggressively forward-looking.
  • Cleaner install and better reliability due to reduced use of hotfixes. If we do a frequent upgrade regimen, we can often defer hotfixes to when problems get fixed in future releases. With infrequent upgrades, we will be under pressure to rely more heavily on hotfixes (customizations) that 1. must later be backed out, 2. may not be as well-tested, creating unintended consequences during use, and 3. when backed out, could cause unpredictable changes.

My employer has a legitimate fear of frequent upgrades due to its experience with our ERP. Indeed, upgrades to this ERP are monstrously complicated. A Sitecore upgrade is a fraction of the complexity of an upgrade or even a patch on our ERP.

Due to the way Sitecore is architected—it generally disallows spaghetti code or direct modification of vendor code or logic—and my disinclination to customize the base product, compared to our ERP, it is rare that we will run into code incompatibilities with newer versions. Our custom code will usually “just work”.

To conclude, I recommend frequent upgrades whenever possible. It has convincing benefits, and, really, it is just a sign of an engaged product owner that wants a relevant, competitive web marketing presence.

FODMAP is NOT about gluten free!

(BACKGROUND: FODMAPs are five kinds of carbohydrates: fructans, galactans, fructose, lactose, and polyols. For some people, FODMAPs cause digestive problems. A FODMAP diet is where you avoid FODMAPS.)

A lot of FODMAP resources recommend avoiding gluten. This is bad advice: the FODMAP diet is about problem carbohydrates. Gluten is not a carbohydrate; it’s a protein! Avoiding gluten is not a goal of the FODMAP diet.

Here’s why many are confused. Gluten-free products generally do not contain wheat, barley, or rye. These should be avoided on a FODMAP diet. Therefore, FODMAP-sensitive people may have success with some gluten-free products.

But not all! Some gluten-free products have FODMAPs. For example, Rudi’s Multigrain gluten-free bread has inulin. People on a FODMAP diet cannot have inulin; it’s a long-chain polymer of fructose!

So what’s my point? FODMAP dieters will probably end up buying gluten-free products. However, you’re doing it not because of the gluten–a protein–but because of the carbohydrates. Products that contain gluten but do not have the problem carbohydrates, like beer, are generally not a problem on the FODMAP diet.

Dallas County Schools bus cameras = profiteering?

My feathers got rankled: I heard from a motorist who got two $300 citations for being safe, prudent, and reasonable, all thanks to unreasonable use of school bus flashing lights and automated ticketing machines installed on Dallas County Schools‘s buses.

I fired off the below letter to my Texas legislators. If you are also concerned, contact your legislators (find them here) and Dallas County Schools (info@dcschools.com).

My letter:

Senator Duell and Representative Sheets,

Dallas County Schools has installed automated ticketing machines on its school buses. These machines photograph motorists who pass a stopped school bus that has its red lights flashing.

I am aware of motorists getting pointless $300 automated traffic citations, These are due to how Dallas County Schools bus drivers are using their flashing red lights.

In this case, school bus drivers are activating their red lights when departing or entering bus occupants are simply walking between a bus and a school. These pedestrians will not cross a road. Last I checked, cars don’t drive on sidewalks or across school lawns, so this use of red light flashers to stop cars on an adjacent road–where departing or entering school bus occupants won’t even go–is an abuse of power and disrespectful to Texas citizens.

This needs legislative attention for two reasons:

First, if the law requires bus drivers to use flashing red lights even when it’s pointless, the law should be revised. Drivers should only be permitted to use flashing red lights when students entering or departing the bus are actually going to cross the road that the bus is on.

Second, if this is due to Dallas County Schools policy, then this needs to be investigated by the legislature as an unprecedented cash grab. $300 per automated citation is egregious. This is 400% the cost of a statutorily-authorized red light camera ticket. And that begs the point: are automated ticketing machines on school buses even statutorily-authorized?

I realize we’re in tough economic times, but it’s egregious for Dallas County Schools to collude with area cities to set up unusually expensive traffic tickets enforced by a statutorily-unauthorized automated ticketing machines, apparently so that they can abuse motorists who, while being on the wrong side of the law, could not have possibly endangered a student: you can’t run over kids that won’t even be in the road!

Aren Cambre

Beware of Drupal for enterprise WCM

A colleague at large university asked my thoughts on using Drupal for enterprise web content management (WCM).

Drupal has its uses, but I only recommend it for point solutions or, if in large-scale use, for cookie-cutter things where all the Drupal instances are configured almost identically and share little content. I generally do not recommend it for enterprise-wide WCM.

I wrote:

Drupal is a great solution for certain purposes, but I hesitate at recommending it for an enterprise CMS. Even though some tools make it easier to manage [edit: like Aegir], Drupal “enterprise”, especially for a college campus, is still essentially flying many individual instances in parallel, so I don’t consider that a real enterprise setup. No other “enterprise” system that I am aware of is so loosely-coupled on the application layer of the service delivery stack.

You’ll find other institutions with a different perspective. I think Stanford is one. Stanford, I believe, is widely using Drupal. [edit: yes, it is: https://techcommons.stanford.edu/drupal]

The problem with their setups is to run a massive Drupal installation, your IT department’s staff commitment to web content management (WCM) will be more heavily expressed in sysadmin skillsets and FTEs than developer skillsets and FTEs. The problem there is cultural: as practitioners of stability, minimizing cost, avoiding change, etc., sysadmins are culturally much further away from web marketing than developers.

And that’s what I like about Sitecore: as a true enterprise WCM, it frees me from much of the sysadmin burden that I would bear by running gobs of parallel instances. It allows me to instead invest in developer skillets and FTEs, which in the long term helps our marketing mission.

Now, there’s also an economy of scale. At some point, you may have sufficient staff resources that it may in fact be cost-effective to go with virtually any free CMS as a base product and develop whatever you want on it.

Three general pointers:

  • Customized code that is not expressed as a formal Drupal module or theme will cause update headaches. Drupal core and the modules have frequent releases, and I recommend staying on top of them because they often contain important bug and security fixes. If you customize Drupal core or customize a module, you’ll have to re-customize it every time there’s a new release. However, if you can implement your custom code as a formal module, it is much more likely to be able to exist unchanged while other modules or Drupal core change. It’s likely, though, that you’ll need to revisit your modules on major new Drupal releases, like v7 to v8.
  • Software costs are a small part of TCO of a system. Just because the software is free does not mean you’re going to get a gigantic savings over a commercial product. That notwithstanding, there are FOSS [edit: free and open source software] tools that make a lot of sense, like, say, Firefox, Chrome, WordPress, and even Drupal for certain situations. But sometimes, FOSS tools may require more FTEs or, like I said above, FTE types that may not be the best cultural fit for marketing.
  • Generally, academic-targeted CMSes are not that good. They seem to have their rabid supporters, but my general experience is that these supporters are suffering from confirmation bias, and that these academic focused CMSes cannot compete with the big players.