Monday, April 28, 2008

Alternative method to create PDF Plots from GeoMedia BatchPlot

There is a white paper from Intergraph detailing a workflow where you can create PDFs from batch plotting using Adobe Acrobat's Distiller. In this posting, I will describe an alternative method to create PDFs using the open source software ImageMagick instead of Distiller. While ImageMagick is free, the trade off is that the map image in the output PDF file is a raster image. Basically, the method is easy: just use BatchPlot to export to an image file, then use ImageMagick's convert utility to create a PDF file from the image file.

Step 1: Use BatchPlot to create the image file
If you are familiar with the BatchPlot utility in GeoMedia, you'd know that it can create bmp, jpg or tif image files of the map layout window contents. You can use the BatchPlot graphical user interface or the command line interface to create the image file.



Or for example from the command line:
C:\> BatchPlot export -file "C:\Temp" -type jpg -resolution 300 "C:\MyDocuments\geomedia.gbp"

The above example will create the JPG files in the folder C:\Temp.

Step 2: Use ImageMagick to convert to PDF
The convert utility has a long list of options but for our purpose, we only need to specify the input file name and the output PDF file name. For example from the command line, type in the following:

C:\> convert "C:\Temp\MapImage.jpg" "C:\Temp\MapImage.pdf"

This will create the PDF file from the image file generated by the BatchPlot utility.

That's it. Simple.

Monday, April 14, 2008

Editing GeoMedia Terrain Models

The documentation that comes with GeoMedia Terrain 6.0 does not provide clear details on practical usage of the terrain model editing commands. While writing a GeoMedia Terrain training course guide, I figure out that displaying the terrain model vertices and triangle edges goes a long way in helping users understand how to use the editing commands. By the way, this is not described in the delivered documentation.

Displaying Terrain Model Triangle Edges and Vertices
  1. In the GeoMedia menus, select Legend > Add Legend Entries.

    The Add Legend Entries dialog box appears.

  2. Expand the Terrain Warehouse connection node that contains your TIN terrain model.
  3. Check the {YourModelName}_TriangleVertices feature on.
  4. Check the {YourModelName}_TriangleEdges feature on.

    The Add Legend Entries dialog box should like as shown below.
  5. Click OK.

    The triangles and edges are displayed in the active map window.

Editing Terrain Model Vertices
Now that you can see the triangle vertices and edges, editing the model is so much easier.
  1. In the GeoMedia menus, select Terrain > Edit > Edit Model Vertices.

    The Edit Vertices dockable control is displayed.
Insert Vertices
  1. In the Action drop down list, choose Insert.

    You are prompted to "Select vertex to insert" in the GeoMedia status bar.

  2. In the Operate on drop down list, choose Individual vertices.
  3. In the Z field, enter an elevation value e.g. 5000.
  4. In the map window, click a new vertex point.

    A new vertex is created in the map window. You can see the model triangle edges and points dynamically adjust themselves to accomodate the new vertex.

  5. You can click to insert more vertices.
  6. If you made a mistake, you can do a mouse right click in the map window.

    The Edit Model Vertices context menu pops up.

  7. Choose Undo to remove the last vertex.
  8. After you have inserted all the vertices that you want, do a mouse right click in the map window.
  9. Choose Update Model to save the new vertices permanently into the terrain model.
  10. Right click and choose Cancel to terminate the command.
Move Individual Vertices
  1. In the Action drop down list, select Move.

    The cursor becomes a cross hair cursor. You are prompted to "Select vertex to move".

  2. In the map window, click on a vertex.

    The vertex is highlighted and you are prompted to "Select location to move".

  3. Click on the new location in the map window.

    The selected vertex is moved to the new location.

  4. In the map window, do a mouse right click and select Update Model.

    The changes are saved permanently.
Delete Individual Vertices
  1. In the Action drop down list, select Delete.

    The cursor becomes a cross hair. You are prompted to "Select vertex to delete".

  2. In the map window, click on a vertex.

    The selected vertex is removed and you are prompted to "Select another vertex to delete".

  3. In the map window, right click and choose Update Model.

    The changes are saved permanently.
Move Vertices in a Selection Set
  1. Click on the Select Tool icon.
  2. Then click on two or more vertices in the map window. Note that if you want to add to the selection set, then you need to press down the CTRL key on the keyboard while clicking.
  3. After you are done with selection, in the Action drop down list, select Move.
  4. In the Operate on drop down list, choose Select set.

    You are prompted to "Input X,Y values to move the vertices.

  5. Then key in the relative X and Y offsets in the X and Y fields, e.g. X=500, Y=500.

    You are prompted to Click Process Move to move the vertices.

  6. Do a mouse right click in the map window. In the context menu, choose Process Move.

    A message box appears showing the number of vertices moved and the number failed.

  7. Click OK.

    The vertices in the selection set are moved by the relative X and Y offsets.

  8. In the map window, right click and choose Update Model to save the changes permanently.
Editing Terrain Model Z Elevation Values
You need to activate the Edit Z dockable control toolbar to perform editing on the Z-elevations of the terrain model. Select Terrain > Edit > Edit Z in the GeoMedia menus.

The Edit Z dockable control appears.


Edit Individual Vertex's Z Value
  1. In the Edit Z control's Applies to drop down list, select Individual vertices.

    You are prompted to "Select vertices to edit".

  2. In the control's Operator field, choose None.
  3. In the control's New Z field, enter an elevation e.g. 6000.
  4. Click on an existing vertex in the map window.

    You are prompted to "Select another vertex or choose 'Edit Vertices' to perform the edit.

  5. Click on additional vertices.
  6. When you are done, right click in the map window and choose Edit Vertices to perform the edits.

    The message box appears showing the number of vertices edited or failed.

  7. Click OK.

    All the selected vertices' elevation values are updated.

Edit Z of Vertices with the Same Z
  1. In the control's Applies to drop down list, select Vertices with same Z.
  2. In the control's Original Z field, enter the Z elevation of the vertices to change e.g. 6000.
  3. In the control's Operator drop down list, select an operator e.g. +.
  4. In the control's Operand field, enter the delta value e.g. 500.

    The control's New Z field shows the resultant Z value,
    e.g. New Z= {Original Z=(6000)}{Operator=(+)}{Operand=(500)}=6500.

  5. In the map window, right click and choose Edit Vertices.

    After processing, the message box showing the number of vertices edited or failed appears.

  6. Click OK.
  7. In the map window, right click and choose Update Model to save the changes permanently.




Thursday, April 10, 2008

GeoMedia 6.0 Command Wizard for Visual Studio 2005

GeoMedia version 6.0 does not come with a command wizard for Visual Studio 2005. I found out that there is a zip file GeoMediaWizardVS2005v60.zip available from the Intergraph website http://synergy.intergraph.com (login required). Download and extract the contents of this file and follow the following procedure to install it as an add-in to Visual Studio 2005.
  1. Extract templates.zip to Drive:\Program Files\GeoMedia\wizard\Templates folder.
  2. Extract Regwiznet.zip to Drive:\Program Files\GeoMedia\wizard\ folder.
  3. Extract GeoMediaCmdWizNet8.zip to Drive:\Program Files\GeoMedia\wizard\ folder.
  4. Run Drive:\Program Files\GeoMedia\wizard\Regwiznet.exe.
  5. Start Visual Studio 2005.
  6. Select Tools > Add-in Manager (notice the GeoMedia Command Wizard Add-in)


Note: If you are using GeoMedia version 6.1, then you no longer need to do the above as 6.1 comes with the Visual Studio 2005 add-in.

Thursday, April 3, 2008

Work around GeoMedia Map Publisher's Slow Dialog Boxes Display Problem

GeoMedia Map Publisher is a brand new product from Intergraph for cartographic map production including project management, instance-based cartographic editing and display management. I tried out the spanking new Intergraph GeoMedia Map Publisher 6.1 software, released in December 2007. Overall, it is a pretty cool product but like all new software, there is bound to be some irritating program bugs. The first thing that I noticed was that the dialog box display of the product takes an annoyingly long time to complete refresh (if at all). This makes it difficult to work as you cannot see the text fields until the refresh completes. After discussing the problem with an Intergraph support engineer, he suggested the following workaround outlined below. Basically, the problem will go away if the Windows DirectX acceleration is disabled.

Workaround Steps:

  1. On the Windows Desktop, right-click the mouse and select Properties in the context menu to bring up the Display Properties dialog box.
  2. Press the Settings tab.
  3. Click the Advanced button to bring up the Plug and Play Monitor Advanced Settings dialog box.
  4. Click the Troubleshoot tab.
  5. Move the Hardware acceleration slider to the third scale mark. Make sure that the description below is saying something like "Disable all DirectDraw and Direct accelerations...", as shown in the screen shot below.
  6. Click OK. That's it! From now on, the annoying slow dialog box display will be gone.