idfg-bthomas's blog

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
rs.movenext
Loop

End Select
'closing connections this is a must
rs.Close
Conn.Close
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:

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

MySQL
“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:



Link