Translating Coordinates

Of all the GIS questions I field, coordinate system related questions are the most frequent. The following is typical:

I have a shape file of land parcels from Bonneville Co. and am trying to overlay that onto the County NAIP imagery. For some reason, when I have the same coordinate system and datum assigned to all layers, the NAIP and shape files are projecting at different scales and not even coming close to lining up. I’ve tried everything in my limited arsenal. If you have any idea of what’s going on, please let me know.

The problem here is not a lack of understanding of the software, but misunderstanding concepts behind assigning and translating a coordinate systems.

Translate This

I've found language translation to be the most accurate analogy for making sense of coordinate systems in ArcGIS.

Suppose you're traveling on a ferry in the Baltic Sea (why not?). A frazzled tourist is running from person to person animatedly asking a question. Fortunately, you have a web browser on your phone and you call up Google Translate to assist. You are two dropdown listboxes away from understanding:

  • First, you must correctly identify what language they are speaking.
  • Second, you must indicate what language to which you want the information translated (most likely English)

You hand your phone over and they pound quickly into the keys:

missa ovat wc

You've selected English as the output for your benefit, but the original language requires a guess, so you randomly start trying local tongues.

Swedish suggests Ovat has bad aim...

Ms. Latvia haz Water Closet...

Ah, the Finn has to pee!

Ah, but how do we ask the Dutch crew?

Projections in ArcGIS present exactly the same problem. ArcGIS needs to “know” what coordinate system you want everything to be in, and it needs to know what coordinate system the different layers are in to begin with, so it can successfully translate. In some situations (generally where the datum differs) it is a best practice to permanently re-project the data to match the rest of your data. The most insidious errors occur when you incorrectly guess one or more coordinate systems and receive gibberish in response.

Idahos to the Rescue

So what to do when layers don't play well with others? Out here we bring on the Idahos. Or "Projection Finder" as I call it professionally. This is a layer I made that is projected in IDTM83 and displays where fifteen common projections fall to use in identifying projections.

How to use this layer

  1. Open a new map and add the Project Finder layer first. This is important as starting a new map and adding a layer sets the default projection of the data frame to match the first layer added.
  2. For the layer you want to determine a projection for, first make sure it has no projection defined. There are two ways you can do this: in Windows Explorer delete the corresponding .prj file or in ArcCatalog right-click on the layer, select Properties, select the XY Coordinate System Tab and spank the Clear button.
  3. Once the coordinate system is nuked, add the layer to the map.
  4. Zoom to the layer to to see in which projected Idaho it falls.
  5. Now you can go to Toolbox > Data Management Tools > Projections and Transformations > Define Projection and do just that.
  6. Once it is defined, remove it and re-add it to your map and it should move to fall inside IDTM83 since it now has a projection defined it is reprojecting on the fly to match the data frame. This is a good thing.

You're Finnished.

Oliko se hyvä sinulle? Osta minulle olutta.




Copy the projection files to the State Coordinate Systems folder for your ArcGIS installation if they are not already present.  This location is typically (where DesktopX.X is your ArcGIS version number):

C:\Program Files\ArcGIS\DesktopX.X\Coordinate Systems\Projected Coordinate Systems\State Systems

Making Copies with a HP DesignJet 5000ps (Queue Management)

At my old job making copies on the plotter was a piece of cake. You went into the Queue, selected the job and number of copies and presto! For some reason, possibly because I hardly make paper maps anymore, learning queue management on the DesignJet 5000ps did not come intuitively.

My latest map kept running out of memory on the plotter, so when it finally did print after spooling for three hours, I had the incentive I needed to explore the DesignJet 5000ps menus.

I must admit that I have waited five years and wasted the total of several days spooling print jobs. It isn't even complicated.

Starting at the Main Menu (use "Top" key to make sure you are at the Main Menu)

  1. Press the "ENTER" button (this will select the first option "Printing")
  2. Highlight "Queueing & Nesting..." and press "ENTER"
  3. Highlight "Queue Management" and press "ENTER"
  4. Highlight the job number (These are negative numbers in the order last printed. Select "-1" for the last job.)
  5. Highlight "Copies = 0..." and Press "ENTER"
  6. Highlight the number of copies you want in the Copies Menu and Press "ENTER"
  7. Press the "BACK" button to return to the Job Menu (Titled "-1:" in this example)
  8. Highlight "Move to Top" and Press "ENTER"

The plotter should start warming up and printing will begin almost immediately. Best yet, it will continue to print with no interruption for processing.

I just made three copies of a 36"x60" shaded relief poster in the time it took to type this out.

Saving Label Expressions

Using the database querying label expressions I wrote about on Thursday, I got to learn a new "feature" of ArcGIS today: Disappearing label expressions on modification of a definition query

That's right, spend five minutes building a database query into your label expression, get it working perfectly and then to celebrate try limiting it with a definition query. Bam! No more label expression. Ain't ArcGIS beautiful?

In dealing with this "feature", I discovered ArcGIS has the ability to Save and Load label expressions.

I'm quickly developing a catalog of label expressions.

ArcGIS One-To-Many Labeling

ArcGIS is just plain lousy at dealing with any relationship that isn't one-to-one.

We all have a slew of hacks just to deal with this limitation. I for one regularly am creating temporary cross-tab queries so I can represent multiple sample results at a collection point, fish surveyed at a cross-section and a host of other relationships.

The classic example for mapping comes from the cadastral community and condominium lots. It's an odd situation where more than one person has title to the same piece of ground. How do you represent this?

I've got a new trick thanks to Mohammed Hoque's article in ArcUser Magazine.

We're going to do a database query inside a label expression, loop through the results and output the entire list to label.

For our example we'll use Outfitting Areas in Idaho and we'll label them with the Outfitters and Guide License Numbers and Outfitter Names.

1.) Open ArcGIS and add your spatial layer with the unique identifier shared with your database.
2.) In the label expression, click Advanced

3.) Replace the labeling expression with the following:

Function FindLabel ([ID])
Dim strQry, strInfo, i
i = 1
strQry = "SELECT Outfitter FROM VU_GIS_Labeling WHERE ID = " & [ID]
Dim Conn
set Conn = createobject("ADODB.Connection")
Dim rs
set rs = createObject("ADODB.Recordset")
Conn.Open "PROVIDER=SQLOLEDB;Integrated Security=SSPI; Persist Security Info=False; Initial Catalog=aDatabaseName; Data Source=aServerName"
Conn.CursorLocation = 3
rs.Open strQry, Conn, 3, 1, 1
'if more than one records are found, append to the existing string.
Select Case rs.RecordCount
Case -1, 0
'If no record is found, return empty string
strInfo = ""
Case 1
'reading only the first record
strInfo = rs.Fields("Outfitter")
Case Else
Do While Not rs.eof
'if multiple records indicate how many using count
strInfo = strInfo & vbNewLine & rs.Fields("Outfitter") & " (" & i & ")"
i = i + 1

End Select
'closing connections this is a must
Set rs = Nothing
Set Conn = Nothing

'returning string for labeling
FindLabel = strInfo
End Function

You'll need to replace the bold values with those appropriate for your situation.

This example also uses SQL Server, different databases require different database connection strings:

“PROVIDER=OraOLEDB.Oracle; Data Source=aDatabaseName; User ID=aUserName; Password=aPassword”

“driver={MySQL ODBC 3.51 Driver}; Server=aServerName; Database=aDatabaseName; uid=aUserName; PWD=aPassword”

Microsoft Access
“PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=c:\myDatabase.mdb;”

Microsoft SQL Server (using Windows NT Integrated security)
“Provider=SQLOLEDB; Integrated Security=SSPI; Persist Security Info=False; Initial Catalog=aDatabaseName; DataSource=aServerName”

4.) Finally, test your label expression for typos using the Verify button and if successful, OK your way out.

The final product: