Start Programming in GIS

November 10, 2008 by Timothy  
Filed under ArcGIS, GIS Tips, Programming

GIS in and of itself is a very technical system.  Just think about the visual part of a map and then add in the data that lies behind the visualization.  Then on top of everything, add the ability to do extensive analysis with the data.  Each of these parts are held together with a Graphic User Interface such as ArcGIS, MapInfo, or GoogleEarth.  While already being overwhelmed by the data alone, think about the programming that goes into these GUI’s.  You may tell yourself that programming is an area that you plan to stay far away from; however. I believe that there are extremely great benefits to knowing a little bit about programming.

In order to get your feet wet in GIS programming, I would suggest learning a little bit about Visual Basic for Applications. VBA is an event driven form of Visual Basic.  It usually relies on applications to serve as its host as it does not work independently.  Microsoft Software is the main housing unit for VBA, but it does come with other software packages such as AutoCAD, WordPerfect, and ArcGIS. VBA allows the user to perform repetitive and/or extensive tasks in a simple to use format.  These formats can include but are not limited to a Button, Tool, Form, and Macro.

To Begin, find where the Visual Basic for Applications program is located. In ArcMap or ArcCatalog click Tools -> Marcos -> Visual Basic Editor… (This is basic for all applications with VBA). The shortcut is Atl+F11. This will open Microsoft Visual Basic in a new window.

Start by exploring the various areas presented. Familiarize yourself with the Menu bar. Many of the options will be completely foreign, but you will learn how to apply them to programming eventually.

Next, you should see a Project Explorer Window (If you do not see this window, click View -> Project Explorer). The Project Explorer displays each project that is open. Normal is the master application template. Any changes to this project will apply to all documents. You may also see Project (Document_Name). Changes within this project will only apply to that project. Keeping this in mind will enable you to customize at the individual document level and also at the application template level. There are objects under each project. You can toggle between the object and the code with the buttons at the top of this window.

The next area to look at is the Properties Window (If you do not see this window, click View -> Properties Window). This is where you can name the various objects within the project as well as assign properties. These will vary by object.

The last area to bring attention to is the Coding Window (the large white space). This area is where code is placed to carry out your desired procedure. Each object will have its own separate coding area.

Now that you have a general overview of Microsoft VBA, I would recommend continuing to explore other areas that I may not have covered. If you are not sure what something is, use the help document (Help -> Microsoft Visual Basic Help or hit F1). There is a wealth of information located here.

Note:  VBA is not the only programming language in GIS; however, it is an excellent language to begin learning GIS programming.

Related Topics on GIS Pathway

Related Books

Related Websites

Comments

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!