Search

Pee Dee GIS Users Group

SC GIS Professionals in the Pee Dee Area

Category

Tips and Tricks

Creating a Locator Frame in ArcGIS 10 if you use data driven pages

I, like many of you, have used the old DS Mapbooklet Plotting sample code for many years. It has been a wonderful tool and one I cannot do without. ArcGIS 10 introduced Data Driven Pages which basically incorporated much of the DS Mapbook code directly into the core ArcGIS Desktop products.  The one thing that has been driving me crazy is how to reproduce the local Map Locator that DS Mapbook had. I found the following steps on the ArcGIS Forums today posted by David B from Esri.

Create a Map Locator Frame

You can do this with the data frame extent options. In 10.0 there are new options that allow you to drive the extent of one data frame based on the extent of another data frame.

To make a locator map that automatically adjusts as you page through your map series try this:

  1. Go to the properties dialog for your locator data frame and select the Data Frame tab.
  2. In the Extent section at the top select “Other Data Frame” from the dropdown.
  3. Now you should see options to “Derive the extent from another data frame’s extent”. Make sure the DDP data frame is selected in this dropdown (it might show a different data frame selected by default if you have more data frames in your map).
  4. Set the margin options if you want a consistent margin, or select “Zoom to features that intersect the other data frame’s extent” if you want to make sure surrounding features show. The latter is useful if you index layer is a rectangular grid, for example.

Here is the link to the original source I found this on: http://forums.arcgis.com/threads/16422-Map-Locator-with-DD-Map-Book

Hopefully many will find this as helpful as I have.  

Tripp Corbin, CFM, GISP

Advertisements

Access your GPS Radio with VB.Net code

What follows is the code for a module that can be inserted into a VB.net project. Call the sub with the comm port that the GPS radio is on and you are set. Also add a Serial Port Control to your form and name it “serialPort”. Timeout is required in case an incorrect serial port has been specified.

Programming note: Even with the timeout set in the code, the application will lock up if an incorrect, but active comm port has been specified. If you know of a fix post it in the comments.

Imports System
Imports System.IO.Ports

Module gps

    Public strLatitude As String = ""
    Public strLongitude As String = ""

    Public Sub queryGPS(ByVal cPort As String)
        Dim loopCount As Integer = 0
        Dim GPSOutput As String = ""
        Dim GPSGPRMCStr As String = ""
        Dim newLineStr As String = "$"
        Dim aStrSplitItems() As String
        Dim NSHemi As String = ""
        Dim EWHemi As String = ""
        Dim EW As Integer = 0
        Dim NS As Integer = 0
        Dim commQuit As Boolean = False
        Dim portClosed As Boolean = False
        Dim dblLatitude As Double = 0
        Dim dblLongitude As Double = 0
        Dim wsLatitude As String = ""
        Dim wsLongitude As String = ""
        'Set sentence to parse from GPS Output. Use GPRMC GPGLL, or GPGGA
        Dim strSentence As String = "GPRMC"

        'Reset coordinate variables()
        strLatitude = ""
        strLongitude = ""

        On Error GoTo Errhandler

        'Calls Serial Port Control on main form. Add Serial Port Control to form and name it "serialPort"
        'Timeout is required in case an incorrect serial port has been specified. Application will freeze
        'if timeout is missing or too lengthy.
        frmMain.serialPort = New SerialPort("COM" & cPort, 4800, Parity.None, 8, StopBits.One)
        frmMain.serialPort.ReadTimeout = 5
        frmMain.serialPort.Open()

readLine:
        Dim cCount As Integer = 0

        If portClosed = True Then
            frmMain.serialPort.Open()
            portClosed = False
        End If
        'Read GPS data from Device - Geographic Position, Latitude/Longitude
        GPSOutput = frmMain.serialPort.ReadLine.ToString
        GPSGPRMCStr = GPSOutput

        'Test string for debugging without a good GPS signal
        'GPSGPRMCStr = "GPRMC,174607.000,A,3411.3450,N,07946.0365,W,0.44,160.26,020910,,*12"

        If GPSGPRMCStr.Contains(strSentence) Then
            commQuit = True

            For i = 1 To Len(GPSGPRMCStr.ToString)
                If Mid$(GPSGPRMCStr.ToString, i, 1) = "," Then cCount = cCount + 1

                Select Case strSentence 'Set the line the program reads in the DIM statement above
                    Case "GPRMC"
                        Select Case cCount
                            Case 3 'Start collecting latitude
                                strLatitude = strLatitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 4 'Get Hemisphere
                                NSHemi = NSHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 5 'Start Collecting longitude
                                strLongitude = strLongitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 6 'Get Hemisphere
                                EWHemi = EWHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                        End Select
                    Case "GPGGA"
                        Select Case cCount
                            Case 2 'Start collecting latitude
                                strLatitude = strLatitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 3 'Get Hemisphere
                                NSHemi = NSHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 4 'Start Collecting longitude
                                strLongitude = strLongitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 5 'Get Hemisphere
                                EWHemi = EWHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                        End Select
                    Case "GPGLL"
                        Select Case cCount
                            Case 1 'Start collecting latitude
                                strLatitude = strLatitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 2 'Get Hemisphere
                                NSHemi = NSHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 3 'Start Collecting longitude
                                strLongitude = strLongitude & Mid$(GPSGPRMCStr.ToString, i, 1)
                            Case 4 'Get Hemisphere
                                EWHemi = EWHemi & Mid$(GPSGPRMCStr.ToString, i, 1)
                        End Select
                End Select
            Next
        Else
            GoTo readLine
        End If
        strLatitude = Microsoft.VisualBasic.Right(strLatitude, Len(strLatitude) - 1)
        NSHemi = Microsoft.VisualBasic.Right(NSHemi, Len(NSHemi) - 1)
        strLongitude = Microsoft.VisualBasic.Right(strLongitude, Len(strLongitude) - 1)
        EWHemi = Microsoft.VisualBasic.Right(EWHemi, Len(EWHemi) - 1)

        If NSHemi <> "" Then
            If NSHemi = "N" Then NSHemi = "" Else NSHemi = "-"
            If EWHemi = "E" Then EWHemi = "" Else EWHemi = "-"
        End If

        'Convert Lat and Long to decimel
        '********************************************************************
        'Strip leading Zeros
        dblLatitude = CDbl(strLatitude.ToString)
        dblLongitude = CDbl(strLongitude.ToString)
        'Add polarity
        If NSHemi = "-" Then
            dblLatitude = dblLatitude * -1
            NS = -1
        Else
            NS = 1
        End If
        If EWHemi = "-" Then
            dblLongitude = dblLongitude * -1
            EW = -1
        Else
            EW = 1
        End If

        'Move decimel place two places to the left
        dblLatitude = dblLatitude / 100
        dblLongitude = dblLongitude / 100

        'Get values left of decimel
        Dim leftLat As Integer = Math.Abs(dblLatitude)
        Dim leftLong As Integer = Math.Abs(dblLongitude)

        'Get values right of decimel
        Dim rightLat As Double = Math.Abs(dblLatitude) - Math.Abs(leftLat)
        Dim rightLong As Double = Math.Abs(dblLongitude) - Math.Abs(leftLong)

        'Convert to minutes
        rightLat = (rightLat * 100) / 60
        rightLong = (rightLong * 100) / 60

        'Lat/Long in decimel, in case you need decimel degrees instead of degrees/minutes/seconds.
        wsLatitude = Trim(Str(CDbl(strLatitude) * NS))
        wsLongitude = Trim(Str(CDbl(strLongitude) * EW))

        'Lat/long in Degrees/Minutes/Seconds in decimel form
        strLatitude = Trim(Str((leftLat + rightLat) * NS))
        strLongitude = Trim(Str((leftLong + rightLong) * EW))

        frmMain.serialPort.ReadBufferSize = 0
        frmMain.serialPort.Close()
        portClosed = True

        '*********************************************************************
        'Comment out else section when deployed. Work with results in main sub
        '*********************************************************************
        'Sometimes reception is poor and it takes more than one pass of the data to get a fix
        'This section forces another read of the GPS device when the coordinates are null or
        'contain zeros. Note: The application as written will fail on the prime meridian when
        'at the equator.
        If strLatitude = "" Or strLongitude = "" Or strLatitude = "0" Or strLongitude = "0" And commQuit = True Then
            loopCount = loopCount + 1
            If loopCount > 10 Then
                MsgBox("The GPS device is currently not getting a fix, please try again later." _
                      & Chr(10) & GPSOutput, vbOKOnly, "Satellite Communication Unavailable")
                Exit Sub
            Else
                GoTo readLine
            End If
        Else
            'Access web service from arc to return a list of addresses within a certain range of the inspector's location.
            'Web Service is currently in SC stateplane.

            'A google test.
            'System.Diagnostics.Process.Start("http://maps.google.com/maps?q=" & strLatitude & "%2C" & strLongitude)
        End If
        '********************************************************************
        Exit Sub
Errhandler:

        Select Case Err.Number
            Case 5
                Resume Next
            Case 13
                'MsgBox(Err.Number & " " & Err.Description)
                Resume Next
            Case 57
                'MsgBox(Err.Number & " " & Err.Description)
                MsgBox("Comm Port not available", MsgBoxStyle.Exclamation, "Communication Error.")
                Exit Sub
            Case 91
                'MsgBox(Err.Number & " " & Err.Description)
                Resume Next
            Case 8002
                'GPSComm.PortOpen = False
                MsgBox("Comm Port not available", MsgBoxStyle.Exclamation, "Communication Error.")
                'GPSComm.PortOpen = True
                Resume Next
                Exit Sub
            Case Else
                MsgBox(Err.Number & " " & Err.Description)
                Resume
                Resume Next
        End Select
    End Sub
End Module

 

Converting an ArcGIS 10 GDB to ArcGIS 9.3 or earlier

I was just asked by a client how to convert a newly created GDB in ArcGIS 10 to one that could be read by ArcGIS 9.3. Before 10, I would normally do this by moving everything to a personal GDB and editing the GDB_ReleaseInfo table to have the values the older versions expected to see. This always worked great as long as your GDB was fairly simple without a lot of higher end features such as geometric networks or parcel fabrics.

ArcGIS 10 however has completely revamped the personal Geodatabase schema so the GDB_ReleaseInfo table does not exist and I have not been able to find a table that contains similar information. So this method will no longer work for converting back to older versions. ESRI recommends if you want to convert to an older version, you should create a new GDB using an older version of the software. Then copy and paste the data from the ArcGIS 10 GDB to the newly created older version GDB from an ArcGIS 10 install. This is great if you have a computer installed with the older version but what do you do if you don’t.

One option I found is to create layer packages. When creating a layer package it has the option to create one that is compatible with older versions of ArcGIS. Here is a link to the online help with more information. If anyone else has ideas or methods they use I would be interested in hearing them.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000q4000000.htm

Tripp Corbin, MCP, CFM, GISP
Vice President, GIS/IT
ESRI Authorized Instructor
CompTIA Certified Technical Trainer
Keck & Wood, Inc.
(678) 417-4013
(678) 417-4055 fax

ArcGIS to Adobe Illustrator

Occasionally you might get a request to supply someone with a map that they can use in a Adobe Illustrator. ArcGIS gives you the tools you need to do this, but to avoid trial and error here’s a quick tip for outputting your map to an Adobe Illustrator compatible format.

Design your map in ArcGIS and once finished:

  1. Click File-Export Map
  2. In the Save as Type drop down, select EPS (*.eps)
  3. In the Options section, click the Format tab.
  4. Set your options as shown below.


By setting your output as shown the recipient will be able to work with your annotations and read them since using embedded fonts may cause issues in Illustrator.

ArcGIS 10 License provisioning for multiple single-use licenses

Looks like ESRI is starting to let folks download the final release of ArcGIS 10. I was able to download ours yesterday. For those of you that opted for the download option, if you have not received you email with instructions yet, I am sure you will be soon.

One of the many things that have changed with the release of 10 is how you get your license files. ESRI has a new customer portal that allows you to allocate all your various licenses and generate provisioning files. A provisioning file is a text file that can be used to pre-populate user information and authorization numbers in the Software Authorization Wizard instead of manually entering the information. For the ArcGIS License Manager, the provisioning file is in the format *.prvs. For ArcGIS Desktop, Engine, Server, the provisioning file is in the format *.prvc.  For those that run concurrent licenses, this is very similar to the license files we always received. It will work a little differently for single use licenses especially if you have multiple licenses.

If you have multiple single use licenses, when you go to generate provisioning files for those licenses, you will have to allocate and generate a file for each individual computer you plan to assign a license. For example we have 5 single use ArcView licenses. I cannot generate one provisioning file allocating all 5 of my licenses and use it to install on 5 different computers. Instead I must generate five different provisioning files.  

For additional information go to:  https://customers.esri.com/index.cfm?event=general.dspHelp&topic=authorizations

 You may need to login to your ESRI global account to access the link. Hopefully this will help as you start to migrate to ArcGIS 10.

Installing ArcGIS Server .Net on Windows 7

I have just upgraded my laptop to Windows 7 which I have to say was about the easiest OS install I have experienced. However when I went to install ArcGIS Server .NET 9.3.1, I ran into some issues with Microsoft Internet Information Server. Windows 7 uses IIS 7 which is the same as Windows Server 2008. So unlike past versions of IIS which only required you to add it as a Windows componet, this new version has some setting you need to make sure to check as you install it on your computer. I thought I would share these with you so you don’t run into the same issues I did.

When you install IIS on your Windows 7 or Server 2008 you need to make sure to include the following components:

Web Server (IIS) 7

Common HTTP Features

  • Static Content
  • Application Development
  • ASP.NET
  • .NET Extensibility
  • ISAPI Extensions
  • ISAPI Filters

Security

  • Basic Authentication
  • Windows Authentication
  • Request Filtering

Management Tools

  • IIS Management Console
  • IIS Management Scripts and Tools

Management Service

  • IIS 6 Management Compatibility
  • IIS 6 Metabase Compatibility

Hopefully this will be helpful. More information can be found in ESRI’s online help at http://resources.esri.com/help/9.3/arcgisserver/install_gds/dotnet/ArcGIS_Server.htm

Tripp Corbin, CFM, GISP
Vice President, GIS/IT
Keck & Wood, Inc.

ArcGIS Server, flex apps (VIPER, etc.) and other widgets

Good Morning All

As more and more of us are starting to work with ArcGIS Server, flex apps (VIPER, etc.) and otherwidgets, we are finding that many of us are using the same tools. We are also finding that many of usare trying to discover data feeds, etc. that would be of benefit to us in SC. In order to minimizeduplication of effort in the searching and learning process, Gloria Forthun from EMD has set up a YahooGroup that anyone (state, local, or others with interest) can participate in. The purpose is to help shareideas, links/data pertinent GIS web apps, widgets we modify/develop, etc. We hope that this will cutdown on searching across the web and other forums. We believe this will help save time.

HOW – go to Yahoo.com and click on Groups. If you are not already signed up for Yahoo, you will needto do this (quick/easy). Sign up for the GISandFlexApps group. You can even set it up so messages are sent to your normal email account. If you need help with any of this, please contact either Gloria or I and we will be glad to assist. I’ve already posted some content out there to get us started. Please help us all by getting involved. It won’t take much time, and it can save you and others ALOT of time.

Thank you,

Tim De Troye

NAD83 (HARN)

The attachment dcto shows how the changes in NAD83 (HARN) will affect our differential correction.Understanding the Evolution of Datums WGS 84 and NAD 83

Spacial Joins and Selections

Issue: Doing a Spacial Join or Selection returns all items.

Description:
If you join a layer to a table you may be unable to use that layer in a spacial join to another layer. When using a layer with joins in ArcMap 9.3 you might encounter the issue where all the items in a layer are selected instead of the selection based on your criteria.

Solution:
The solution is to export the layer with the join to a separate layer file, then use that layer to do the spacial join/selection.

Create a free website or blog at WordPress.com.

Up ↑