Computer Programming

When to Automate

I'm just pondering something that I think about fairly often when I'm asked to do some immense task like create output for 2,256 watersheds. That was today's task ... and by “today” I mean ... I'm not going to finish it today, it was just added to my inbox today. I have to use the 2001 NLCD to create forest/non-forest data and then clip out a piece for each of the 2,256 sheds to run Fragstats on. What I wonder about is how much of this can I automate with a script. The answer usually boils down to efficiency. I mean how much time would it take to write the script vs. how much time would it take to do it manually. Usually there are several steps (as in the present case) so I have to answer the question for each step. Sometimes a script can be useful in the future so it may be worth writing one even if it takes a little longer to write than to do it manually (because it will be so much quicker next time you have to do a similar task).

Single Use License (ArcView) and License Server (ArcInfo) on one computer

I recently discovered that it is possible to have a Single-Use License for ArcView 9.2 installed on a computer with a Concurrent-Use installation of ArcInfo 9.2. This allows users with a laptop to use the ArcView level of the ArcGIS software at home without the hassle of connecting to a license server through a VPN. Start with a complete installation of ArcGIS 9.2 and then proceed with these instructions.

1. At Run Prompt, type "regedit".
3. Right-click inside the window on the right and go to New -- String Value.
4. Name the new Key "SingleUse_Installed" and make the value "Viewer". Close Registry Editor.
5. Open Desktop Administrator from Start -- All Programs -- ArcGIS -- Desktop Administrator

Learning MapServer (UMN's Map Server cgi program)

I've been wanting to try the UMN's MapServer product. All the information about this great product is on the UMN MapServer website. Earlier this week I downloaded an installer for MapServer for Windows and installed it on my work computer. The installer is called ms4w and it installed everything I needed to get started with no problem including Apache, MapServer, GDAL, OGR. I downloaded the MapServer Demo application to look at.

Its been fun to work with and I hope to get something cool going eventually. For now my test application can be viewed at the very short list of

My Approach to Geoprocessing with Python

I've done a bit of programming with ArcObjects in VB and VBA. I probably hadn't heard of Python until ArcGIS 9.0 came out. I've been interested in learning Python but never followed up on it because I can usually write it quicker in VBA (because I already know how to do it). I've been learning Perl over the past few months too so I understand how scripting languages can be very streamlined and effective for text manipulation and apparently for geoprocessing too. I recently watched a 60 minute tutorial on Scripting called “Getting Started with Scripting in ArcGIS 9”. Its worth watching to get an idea of how the syntax works but the take home is that its really quite easy and intuitive (they don't go into much detail). I think you'd still want a good reference book on hand to help you get started.

SQL Tutorial

A gentle introduction to SQL. I saw this on Digg. Its a very simple tutorial on using SQL (at least everything I've done so far in the "tutorial" section is pretty simple). You actually run real queries yourself using your browser and an online database.

Follow this Link ...

Linux Command Line Tips

A nice collection of Linux Command Line Tips I believe that many of these translate into valid Unix commands as well. There are some advanced expressions here using regex and sed. I saw this on Digg recently.

Opening a Command Prompt from Explorer

This article explains how to Open a Command Prompt from Explorer. The article is from It looks like there might be some other cool stuff from this site too. It'll wind up on my

Perl script for making a web page from a folder full of images (Part III) Navigable Site with CSS

Ok ... I've given it a bit more work and created a new script “” that uses an installation of imagemagick on a windows system to make thumbnail copies of every image and create a series of web pages (one fore each image) with a navigation bar running from top to bottom on the left side of the page for moving from page to page. It uses css to mark up all pages.

You can see an example of the results of this on my nephew Owen's photo page. I created this using this perl script.

The images you start with should probably be a reasonable size because the full-sized images are what are displayed in the main body of the page (and if they are too large it may crowd out other parts of the page). The main overhead in doing this is writing a heading and description of each image.

IE7 and ArcGIS not compatible

I installed IE7 Beta the other night because I was anxious to see how some of my web pages looked. The CSS in my pages doesn't work quite as I'd like but that is in no way the worst of it.

I was planning to do some light geoprocessing this morning (I had a couple of shapefiles to merge together). I started ArcMap and went to the merge tool and clicked on it. As the hourglass started pouring sand, I thought "hmmm this is taking longer than it should" and then ArcMap crashed. So I tried a bunch of other tools, same problem. I had installed an extension the other day so I unregistered it thinking that was the problem. I even uninstalled and re-installed the desktop product before I finally gave up.

Then tonight, I found this ESRI Technical Article on the subject.

Tables vs. CSS part II

Awhile back I posted about my Professional Page and how it was difficult to make it look right using all CSS positioning. Well I completely removed all the tables. See ... My Professional Page.
It still doesn't look completely right using Internet Explorer. I viewed it using IE7 and the relevant courses section doesn't line up properly. However It looks great in Opera and Firefox.

You can compare it with the tables version and I think you'll agree that the new one looks best. I also have an intermediate version that just keeps a small set of nested tables at the very top (they were the most difficult to remove).

Syndicate content