How to do things
Recently a customer asked that we publish his scanned parcel maps to his Intranet. For those not up on decade old Internet lingo "an Intranet is a private computer network that uses Internet protocols". He wanted everyone in the office to be able to view and print the scanned TIFF parcel maps. Easy enough, just create share on the file server, or a virtual directory on his web server that points to the directory of scanned images.
This was not exactly what he wanted. Windows XP provides a TIFF image viewer in the form of the “Windows Picture and Fax viewer”, however it’s slow, its zoom and pan capabilities are lacking (no zoom window) and printing is limited to “print to fit”. There’s also Irfanview , good for image batch conversion but I really don’t like the viewer.
Enter the Adobe PDF viewer. Adequate zoom and pan, fast, easy printing to original scanned size as well as other sizes, and you can zoom to an area and print just the zoomed area. I converted a few using tiff2pdf from the LibTiff utilities. Not too hard, install the LibTif windows binaries as well as the jpeg an zlib dll files. Add them to the PATH and go to work.
tiff2pdf -o map.pdf map.tif
Ok, so lets convert all 4000 of the TIFF files to PDF. Gosh there must be some way to batch this process. OK, there is. For each directory:
for %f in (*.tif) do; tiff2pdf -o %~nf.pdf %f
Notice the “%~nf”? It’s replaced by the base name for the file. Therefore %~nf.pdf is replaced by map100.pdf when the TIFF file is map100.tif. That’s better but the new PDF files landed in the dame directory. A small change fixes that:
for %f in (*.tif) do; tiff2pdf -o \\SERVER\\share\%~nf.pdf %f
or if you have mapped a drive:
for %f in (*.tif) do; tiff2pdf -o X:\dir\%~nf.pdf %f
Those who are fluent in shell scripting need not comment, I’m talking to the Windows guys who have lived their entire existence by clicking somewhere.
So far so good but I have 300 directories. We could use the /D and /R parameters of the for command to recurse a directory but I wanted more control. The following does not work:
>for /r %f in (*.tif) do tiff2pdf -o .\pdfdir%~pf%~nf.pdf %f
Since the directory does not exist tiff2pdf can’t create the output file. So what now?
In a perfect world we would have a good UNIX/Linux shell (bash for instance) on our Windows PCs. And we can, just install Cygwin or if you need only the bash shell (unlikely) it’s available for Windows individually.
But we do have scripting. Windows Script Host provides VBScript and Javascript. We can also download and install a number of other scripting languages including Perl, Python, and others.
A few years ago I found a little VBScript program named span.vbs that does just this. I used it for a few tasks over the following months but soon found that I needed more flexibility.
I find writing in VB and VBscript a problem. Once I get my brain used to a language (I code in Java and C# regularly) I find it hard to switch to a language syntactically different as VBscript. Therefore I converted the VBS code to JavaScript then made my improvements.
The result is spanbase.js. With this program I can batch process an entire directory of files.
cscript [path/to]spanbase.js "[Command] [parameters]" [Regex] [NewExt] [NewBaseDir]
Command: Command string to pass to command interpreter
Regex: Regular expression pattern to match filename (e.g. tif$)
!!!! Make sure to place quotes around the command and parameters !!!!
The following substitutions will be made before execution
@File - the current filename
@Ext - the current file extension
@Base - the basename of the current file
@Newfile - a filename compose of the basename + NewExt
NewExt: The new extension to use for the new file
NewBase: New Base Directory for new file, this will be prepended to the file path.
this will be appended to the basename of the original filename (e.g. t.jpg)
cscript C:\wsh\spanbase.js "tiff2pdf -o @Newfile @File" tif$ pdf MyPdfDir
Run this script from the topmost directory containing your tiff images (e.g. C:\tiff) the new PDF files will be placed in the directory C:\tiff\MyPdfDir and the file C:\tiff\spanbase.log will contain each directory entered as well as program output and program error messages.
Publish your work in a PDF file
Adobe PDF (Portable Document Format) provides a convient means for others to view maps, drawings or other documents. Here's how it's done.
Use Adobe Distiller or another commercial program. or... Use the free PDF995 printer driver.
Note: Be sure to use the correct sheet / paper size to insure that line weights and text display correctly.
You may also wish to download and install pdfEdit995, a configuration tool for pdf995 that gives you additional control over the PDF995 printer driver.
The not so easy and instant Oracle Instant Client install.

If you can run the Oracle Installer then run that first and uninstall all Oracle products. Also check Add/Remove programs in Control Panel. Otherwise delete all the Oracle files and remove all references from the Windows Environment (My Computer->Properties->Advanced Tab) especially ORACLE_HOME, TNS_ADMIN and oracle directories in the PATH environment variable.
(Download link at the bottom of this page The actual link seems to change frequently)
Get Instant Client Package – Basic Lite, ODBC, and SQLPlus. Unzip all
to the same directory (e.g. C:\instantclient)
Add this directory to your System PATH and add two new system environment variables ORACLE_HOME and TNS_ADMIN containing the directory.
To add or modify environment variables Right click on “My Computer”, select Properties from the popup. Click the Advanced Tab, Click the “Environment Variables” button. In the lower “System Variables” list you can edit or add new system variables.
Open Control Panel->Administrative Tools->Data Sources(ODBC), Select the system tab. Click Add, Select Oracle in instantclient and click finish. The Oracle ODBC dialog should appear.
Data Source Name: A_Descriptive_Name
TNS Service Name: //hostname_or_ip_address/XE
UserId: scott
Use the defaults for everything else.
Click Test Connection
Password: tiger
Of course replace scott and tiger with your login/password
Your data source is ready to use in Arc, Excel, Access, etc.
In ArcCatalog go to Database Connections, Double click on Add OLE DB Connection, select “Microsoft OLE DB Provider for ODBC Drivers”, click next, Select the data source that you created earlier. Enter Username and password, “Check Allow saving password”, click test connection. Click OK then name the connection (this will be already highlighted).
There are other ways to do this, but this works for me. You may ask “Why do they have to make this so hard”: The answer “Because they can”.
One of the most tedious parts of creating any web mapping application is the creation of the base map. The application map data is in many occasions relatively simple points or polygons. Maps are much more useful when we can see not only our map data but also rivers, streams, roads, and aerial photos on our map. Google Maps provides worldwide maps as well as aerial photos utilizing an easy to use interface. All that you need is a web browser and an internet connection. In addition Google provides an API where we can utilize these maps in our own mapping application. We can add our data to the Google maps in a number of forms:
Google Maps Site Locator: (click to launch application)
![]()
This application demonstrates the use of Google Maps as the base map overlaid from West Virginia State and county lines from a KML file and point locations from a tab delimited text file. It also demonstrates the addition of a user interface that allows users to select a site either by clicking on the marker symbol or the list links in the right column. Once a site is selected the location address is shown in a popup windows and one can then click a link to get driving directions.