Programming

Computer Programming

Excel wants to express a number stored as a string in scientific notation

Ah the weirdness never ends. I needed to preserve a big long number as a string (a census data value as fips state, fips county, tract number, and block number). Excel apparently wants to keep it in scientific notation even though I am pasting values from a number formatted as an integer. I found a way to get it to work here so I wanted to book mark this somehow.
http://www.geniosity.co.za/musings/tips/stop-excel-using-scientific-notation-on-numbers/.

The Power of the Calculate Tool

Just a little curiosity I discovered today. I've been working with a Python script that has some problems calculating a field using an expression. I figured out that the problem was the syntax used in the expression is treating a variable as if it were a field in the feature class (but it is not a field). This was obvious to me because the variable in the expression is surrounded by Python decode field characters (the exclamation mark).

Anyway my search landed me on this page.

exiftool is very cool

I discovered this command line tool called exiftool written by Phil Harvey. It is a platform independant Perl library used to manipulate, edit, read, write exif data in photographic images. So far I've written a bash script to geotag images using user supplied geographic coordinates (DMS format) but it can also use GPS log files to geotag and geosync your photos. By default it creates a backup of the original but can also write over the original instead. It looks like a pretty powerful little tool. I think it was about 8MB to install it and it is freeware.
http://www.sno.phy.queensu.ca/~phil/exiftool/

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".
2. Go to HKEY_LOCAL_MACHINE -- SOFTWARE -- ESRI -- License.
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 ... sqlzoo.net

Linux Command Line Tips

A nice collection of Linux Command Line Tips http://www.pixelbeat.org/cmdline.html. 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 Petri.co.il. It looks like there might be some other cool stuff from this site too. It'll wind up on my del.icio.us.

Syndicate content