GeoChalkboard

A “Spatial” Education Blog

Archive for the 'ESRI' Category


Benefit from GIS E-Learning Opportunities

Posted by epimpler on June 17, 2008

Introduction
In recent years there has been a large movement towards e-learning in many industries, and GIS is no exception. Although computers will never completely eliminate the need and desire for human interaction between instructor and student, the many benefits it offers far outweigh the limitations of the medium. In this post we will examine the benefits, drawbacks, availability, and types of e-learning currently available to GIS professionals.

Features Unique to E-Learning
Knowing a little bit about learning styles can help you determine if e-learning is for you. The interaction and delivery methods used in online classes are dramatically different from traditional classes, so understanding how you learn is a good part of the decision-making process. The three predominant learning styles are visual, auditory, and tactile/kinesthetic. Visual and auditory learning styles fall into the category of passive learning modes while the tactile/kinesthetic learning style is an active learning mode. An active learning mode implies that learning is accomplished by doing or practicing a task and/or speaking about what we learn. Most people tend to fall into this category. However, some people learn best through a passive learning mode which is done through seeing and reading.

Like no other training form, e-learning promises to provide a single experience that accommodates the three distinct learning styles of auditory learners, visual learners, and kinesthetic learners. Other advantages created by the advent and development of e-learning are more efficient training of a globally dispersed audience; reduced publishing and distribution costs as Web-based training becomes a standard; and decreased costs of training from a travel and training materials standpoint.

E-learning also offers individualized instruction, which print media cannot provide, and instructor-led courses allow clumsily and at great cost. In conjunction with assessing needs, e-learning can target specific needs. And by using learning style tests, e-learning can locate and target individual learning preferences.

Additionally, synchronous e-learning is self-paced. Advanced learners are allowed to speed through or bypass instruction that is redundant while novices slow their own progress through content, eliminating frustration with themselves, their fellow learners, and the course.

In these ways, e-learning is inclusive of a maximum number of participants with a maximum range of learning styles, preferences, and needs.

Benefits

Some of the advantages to the learner include:

  • Reduced cost
    This is the single most influential factor in adopting e-learning. The elimination of costs associated with student travel, lodging, and meals are directly quantifiable. With the cost of gasoline now reaching over $4.00/gallon and airfare costs increasing weekly this adds up to big savings. The reduction of time spent away from the job by employees may be the most positive offshoot.
  • Learning times reduced
    An average of 40 to 60 percent, as found by Brandon Hall (Web-based Training Cookbook, 1997, p. 108).
  • Increased retention
    Retention averages an increase of 25 percent over traditional methods, according to an independent study by J.D. Fletcher (Multimedia Review, Spring 1991, pp.33-42).
  • On-demand availability
    Enables students to complete training conveniently at off-hours or from home.
  • Self-pacing
    For slow or quick learners reduces stress and increases satisfaction.
  • Interactivity
    Engages users, pushing them rather than pulling them through training.
  • Confidence
    Responsibility of mastery is reduced since materials are available as a refresher or quick reference materials.

Drawbacks
The ways in which e-learning may not excel over other training include:

  • Technology issues
    Some learners are fearful or intimidated by technology or the technology is unavailable for use.
  • Portability
    E-Learning is not as portable as printed workbooks or reference material, but the limitations of portability have been greatly reduced through wireless connections, network links, notebook computers, PDAs and mobile phones.
  • Reduced interaction
    Social and cultural interaction can be a drawback. The impersonality, suppression of communication mechanisms such as body language, and elimination of peer-to-peer learning that are part of this potential disadvantage are lessening with advances in communications technologies.

Types of E-Learning and Delivery Methods
E-learning takes many forms including the following:

  • Web based (Blackboard, Moodle, WebCT)
  • Computer-based (CD-ROM)
  • Blended learning – combination of online and face to face
  • Video/audio
  • Blogs, Chat, and Discussion Forums
  • Hard-copy Workbooks
  • Videoconferencing and/or Teleconferencing

It is not uncommon for more than one of these delivery formats to be used in the same course of study to supplement the learning experience.

Availability of GIS E-Learning Opportunities
A number of GIS e-learning opportunities exist from commercial and academic institutions. We don’t have room in this article to highlight all the available distance learning programs offered by colleges and universities so we have highlighted a few of the better known options.

Non-Academic

  • GeoSpatial Training Services
    Our company, GeoSpatial Training Services, provides both web-based and computer-based e-learning opportunities focusing primarily on Google Earth, Google Maps, and ESRI technologies.
  • ESRI Virtual Campus
    The ESRI Virtual Campus hosts a number of self study courses through their virtual campus.
  • New Urban Research
    New Urban Research offers twelve advanced topic ArcGIS Tele-Classes.

University Distance Learning Programs

  • UNIGIS International
    UNIGIS is a worldwide network of educational institutions which offer distance learning courses in GIS. Institutions within the UNIGIS network offer internationally recognized qualifications for GIS professionals and those seeking to enter the field.
  • Penn State University
    Penn State offers a Masters Degree in GIS through their World Campus program.
  • Institute for Advanced Education in Geospatial Sciences
    IAEGS was established as a collaborative course development center, based at the University of Mississippi in Oxford, Mississippi and hosts a number of courses on topics such as remote sensing, photogrammetry and digital image processing, and other geospatial technology topics.
  • University of Southern California
    USC offers both a Master of Science + Technology degree along with a GIST certificate program.
  • Elmhurst College
  • University of Denver

GeoSpatial Training Services: Our Approach to GIS E-Learning
At GeoSpatial Training Services, we focus on the development of Internet based and computer based (CD-ROM) courses for the geospatial industry and we focus heavily on Google Earth, Google Maps, and ESRI technologies. Through our Virtual GIS Classroom we offer Internet based courses such as “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” and will soon have additional offerings. In addition, we offer a wide array of computer based GIS training options available by e-delivery (download) or traditional via traditional CD-ROM. Furthermore, we develop custom training solutions for geospatial custom off-the shelf products (COTS) and organizations and conversion of instructor led training materials to various e-learning formats.

Posted in ESRI, GeoSpatial Training Services, Geoprocessing, Google Earth, Google Maps | No Comments »

GeoSpatial Training Services - June 2008 Update

Posted by epimpler on June 10, 2008

GIS Programming 101 Course
Our GIS Programming 101 course scheduled for July 7th - August 1st is beginning to fill up. We still have 5 seats available though so if you’re interested please let us know ASAP by contacting sales at geospatialtraining.com.

This is an instructor guided course taught in a Virtual GIS Classroom using the same technologies implemented by colleges and universities around the world to deliver Internet based courses. Our new Virtual GIS Classroom blends the best of instructor led and e-learning formats into a new instructor led web based format that allows for more interactivity between the instructor and student, and between students.

We have posted various articles in the past few months to give you a preview of what you can expect in this course.

GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS is designed to teach the fundamental programming constructs of the Python language and how it can be integrated with ArcGIS Desktop to automate geoprocessing tasks. Course participants will be led through a series of 13 modules described below.
Module 1: Getting Started with Python in ArcGIS
Module 2: The Geoprocessor ArcObject
Module 3: Basic Python Language Features
Module 4: Obtaining Descriptive Information About ArcGIS Data
Module 5: Using Cursor Objects to Select, Edit, and Add Records to Tables and Feature Classes
Module 6: Enumeration Objects for Listing ArcGIS Data
Module 7: Miscellaneous Objects
Module 8: Dynamic Scripts
Module 9: Integrating Python Scripts with ArcToolbox
Module 10: Geoprocessing Tools
Module 11: Scheduling Geoprocessing Tasks
Module 12: Messaging and Error Handling
Module 13: Final Project

As always we offer an additional 15% discount on any course to all educational, non-profit, local, state, and federal government organizations. Please contact sales at geospatialtraining.com to take advantage of this discount.

Posted in GeoSpatial Training Services, Geoprocessing | No Comments »

GeoSpatial Training Services - March 2008 Update

Posted by epimpler on March 3, 2008

GIS Programming 101 Course
Our GIS Programming 101 course scheduled for March 24th - April 18th is almost full.  We still have one seat available so if you’re interested please let us know ASAP.  Because the demand for this course has been so high we will be offering a second section of this course in the May-June timeframe.  The exact timing of the course has not been determined as of yet, but we will let everyone know as soon as we have the dates. 

This is an instructor guided course taught in a Virtual GIS Classroom using the same technologies implemented by colleges and universities around the world to deliver Internet based courses. Our new Virtual GIS Classroom blends the best of instructor led and e-learning formats into a new instructor led web based format that allows for more interactivity between the instructor and student, and between students.

GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS is designed to teach the fundamental programming constructs of the Python language and how it can be integrated with ArcGIS Desktop to automate geoprocessing tasks.  Course participants will be led through a series of 13 modules described below.
Module 1:  Getting Started with Python in ArcGIS
Module 2:  The Geoprocessor ArcObject
Module 3:  Basic Python Language Features
Module 4:  Obtaining Descriptive Information About ArcGIS Data
Module 5: Using Cursor Objects to Select, Edit, and Add Records to Tables and Feature Classes
Module 6:  Enumeration Objects for Listing ArcGIS Data
Module 7:  Miscellaneous Objects
Module 8:  Dynamic Scripts
Module 9:  Integrating Python Scripts with ArcToolbox
Module 10:  Geoprocessing Tools
Module 11: Scheduling Geoprocessing Tasks
Module 12:  Messaging and Error Handling
Module 13:  Final Project

March Sale on Google Earth and Google Maps E-Learning Courses
During the month of March we are offering a 15% discount on our “Google Maps and Google Earth Bundle“.  Regular price is $200.00 (e-delivery), $250.00 (mail delivery), but during the month of March you can purchase this bundle for $170.00 (e-delivery), $210.00 (mail delivery). This bundle is composed of 5 e-learning courses with over 450 pages of instruction.  The five courses are as follows:

Mastering KML in Google Earth
Google Earth for ArcGIS Users
Google Maps for Your Apps!
Arc2Earth for ArcGIS Users
Dynamic Google Earth Applications (in development scheduled for March release)

See more information on these courses.

As always we offer an additional 15% discount on any course to all educational, non-profit, local, state, and federal government organizations.  Please contact sales at geospatialtraining.com to take advantage of this discount.

Posted in ESRI, GeoSpatial Training Services, Geoprocessing, Google Earth, Google Maps | No Comments »

Executing ArcGIS Tools from Geoprocessing Scripts (Part 5)

Posted by epimpler on February 28, 2008

Other posts in this series: 
Scripting Your ArcGIS Geoprocessing Tasks (Part 1)
Scripting Your ArcGIS Geoprocessing Tasks with Cursors (Part 2)
More ArcGIS Geoprocessing Concepts - Enumeration Objects (Part 3)
Obtaining Descriptive Information About GIS Datasets with ArcGIS Geoprocessing Objects (Part 4)

Introduction
In this final post in our five part series on scripting your geoprocessing tasks in ArcGIS we will take a look at how you can take advantage of the built in geoprocessing tools in ArcGIS through your scripts.  These are the tools available through ArcToolbox. 

Each of these tools is accessible from your Python scripts through dynamic methods on the Geoprocessor object.  We’ll take a look at the tools that are available, the syntax you need to use to access them, aliases for the toolboxes that you can use in referencing the tools, and some examples of how you can use these tools in your code. 

Dynamic Tools
The arcgisscripting/GpDispatch object on the Geoprocessor OMD contains a section called Dynamic Methods and Properties.  The Tool method seen below is a generic method meant to imply the existence of multiple tools. 

 

This generic “Tool” method can be a bit confusing until you understand some additional information.  There is a single “Tool” method on the OMD for two reasons.  First, there are simply too many geoprocessing tools to fit on the OMD.  Remember, if you have the ArcInfo license this would mean you’d have access to approximately 200 tools.  In addition, the tools available will depend upon the license level that you have.  Not only does this include the basic license level (ArcView, ArcEditor, ArcInfo), but also the ArcGIS extensions that you are licensing (3D Analyst, Spatial Analyst, many others).  So, as you can see it simply makes sense to group all these tools into a single generic “Tool” method.

Toolbox Names and Aliases
All system toolboxes have an alias property.  This alias is important because it is possible to have multiple tools with the same name.  For instance, a Buffer tool can be found in both the Analysis and Coverage toolboxes.  Therefore, to distinguish the correct tool in your code you’ll need to add the suffix “_<alias>” when calling a tool.  For example:

gp.buffer_analysis(”Roads.shp”,”Road_Buff.shp”, “150 feet”)

This specifically tells the geoprocessor to execute the buffer tool found in the analysis toolbox.  This is a bit inefficient though and most people prefer to set the Toolbox parameter in their code before calling the tool.  For example:

gp.toolbox = “analysis”
gp.buffer(”Roads.shp”,”Road_Buff.shp”, “150 feet”)

The alias for each toolbox can be found by right-clicking the toolbox in ArcToolbox and selecting Properties.

Tool Syntax
To run a tool from the geoprocessing library you need to know the correct syntax for doing so.  For example, the Buffer tool requires several inputs including the input features to buffer, an output feature class, and a buffer distance.  You must give Python the parameters it needs to run the tool correctly.  There are a number of ways that you can access syntax information for a tool, but perhaps the easiest is to use the online ArcGIS Desktop help system.   Here is the link to help information for the Buffer(Analysis) tool.  The help system contains an illustration, usage tips, command line syntax and examples, scripting syntax, and script examples for each tool.  For this post we’ll concentrate on the scripting syntax.  Scroll down near the bottom of the help page until you get to the Scripting syntax section.  In this case you should see the following:

Just below this you’ll see an explanation of each paramter including required or optional information, a descriptive explanation, and the data type.  Required parameters must be included when you call the tool while optional parameters are just that.  In some cases you may have a need to include these parameters and sometimes you won’t.   So, a very simple buffer script could look something like the figure below.

More Information
We will be presenting a new Virtual GIS Classroom course, “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” starting March 24th and ending April 18th.  We still have 2 seats of available so hurry to reserve your seat now.  We do offer a 15% discount for government, educational, and non-profit entities.

We also offer an e-learning course entitled “Introduction to Geoprocessing with Python” which contains even more detailed information on ArcGIS geoprocessing with approximately 200 slides of audio and video lectures, visual software demonstrations, exercises and data. 

During our February sale when you purchase our “VBA & ArcObjects Bundle” you can receive a free copy of “Introduction to Geoprocessing with Python“.

Posted in ESRI, Geoprocessing | Tagged: , , , , | No Comments »

Obtaining Descriptive Information About GIS Datasets with ArcGIS Geoprocessing Objects (Part 4)

Posted by epimpler on February 17, 2008

Other posts in this series: 
Scripting Your ArcGIS Geoprocessing Tasks (Part 1)
Scripting Your ArcGIS Geoprocessing Tasks with Cursors (Part 2)
More ArcGIS Geoprocessing Concepts - Enumeration Objects (Part 3)

The arcgisscripting/GpDispatch object contains a Describe method that can be used to return an object that describes data.  The Describe method takes a single argument which is a pointer to a data source.  This method is intelligent enough to determine the type of data being referenced and return an object that describes the type of data.   Each descriptive object returned contains information about the particular dataset specified in the InputValue parameter passed into the Describe method.

 

For instance, if you use the Describe method with a  pointer to a feature class, a FeatureClass Properties object will be returned containing information about that dataset.  This object is often used to test for the type of data (either point, line, or polygon) before further processing.  Various read-only properties are available through this object including ShapeType which returns the basic data type such as point, line, or polygon, FeatureType, ShapeFieldName, and others. 

 This class also has access to two other classes in the Describe object model diagram.  These two classes are Table Properties and Dataset Properties.  The Table Properties object supplies a Fields object containing the Fields in the feature class as well as an Indexes property that returns an Indexes object containing all indexes on the feature class.    The Dataset Properties object contains properties for the spatial reference, extent, and dataset type.

Other Describe Objects
There are a number of other describe objects that can be returned by the Describe method including Tables, Datasets, Workspaces, Relationships, Raster Catalog, Raster Dataset, Raster Band, Coverages, and Layers.  For specific information about these objects please see the green colored objects on the OMD.

Common Describe Object Properties 
All objects returned by the Describe method on GpDispatch can access two additional properties.  These properties are DataType and CatalogPath.  DataType is used to distinguish between types of features classes such as shapefiles, coverages, personal geodatabases, CAD data, and others.  It is often used in if..elif..else decision statements to branch code based on the type of data.  CatalogPath can be used to obtain the full path to the data based on an ArcCatalog connection.  This information is identical to what you would find if you were viewing the data in ArcCatalog.

More Information
We will be presenting a new Virtual GIS Classroom course, “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” starting March 24th and ending April 18th.  We still have 5 seats of available so hurry to reserve your seat now.  We do offer a 15% discount for government, educational, and non-profit entities.

We also offer an e-learning course entitled “Introduction to Geoprocessing with Python” which contains even more detailed information on ArcGIS geoprocessing with approximately 200 slides of audio and video lectures, visual software demonstrations, exercises and data. 

During our February sale when you purchase our “VBA & ArcObjects Bundle” you can receive a free copy of “Introduction to Geoprocessing with Python“.

Posted in ESRI, Geoprocessing | Tagged: , , , | No Comments »

Where Does Data in AutoCAD Drawings Come From?

Posted by epimpler on February 12, 2008

Today we’re featuring a guest post from Tripp Corbin of Keck & Wood.  Keck & Wood is a GeoSpatial Training Services business partner, and Tripp and his team created the instructor led and e-learning course  ”Using AutoCAD Data in ArcGIS“.  This course explains the .dwg format and how it can be integrated into standard ESRI data formats such as shapefiles and geodatabases.

Introduction 
Like GIS data, AutoCAD data can be created in a number of ways and accuracies.  There is a general assumption that data created by Engineers and surveyors is always extremely accurate.  This is not always the case.  The accuracy will depend on the methods used to collect the information found in the drawing.  The most common methods for data collection include:

• Land Surveys (Conventional, GPS, Station & Offset)
• Using Existing Drawings
• Importing from a GIS
• Digitizing (Tablet and Heads-up)

Each of these methods have varying degrees of accuracy.  As with any data you might want to integrate into your GIS, it is import to know how the drawing you are working with was created.  Let’s look more closely at some of these methods engineers use to collect data.

Surveying:
Land Surveys are one of the most common ways data is collected for AutoCAD drawings.  Engineers and other professionals use land surveys because they capture the current real world conditions for the area related to their project.  There are many methods that can be used by Surveyors to collect data.  The three basic types of surveys are:

1. Conventional (Transit, Levels, Total Stations)
2. GPS
3. Station and Offset

Each of these methods have different levels of accuracy as well as pros and cons. 

Conventional Surveys
Conventional land surveys are what most people think of when you mention surveying.  This is the person standing on the side of the road using an instrument such as a transit, level or Electronic Total Station (see picture above).  Such surveys generally produce very accurate relative data.  This means the distances and angles between the various features collected are extremely accurate.  However this information is not normally tied to a specific geographic location.  Instead it is collected in a local or assumed coordinate system. 

 It is not impossible to tie a survey done with conventional means to a true geographic location. If a control point or monument is near by a surveyor can use it to georeference his survey data. Many locations have laws that will actually require surveyors to do this. The problem is that there are not normally any control points or monuments near by for surveyors to use and those that have been set by agencies such as the USGS have been damaged or destroyed. This means a surveyor would have to traverse a long distance to locate one of these monuments.

New technology such as combined electronic distance meters and theodolites (commonly called Total Stations) have made conventional surveys much easier and less labor intensive.  Conventional methods can also be mixed with newer technologies such as GPS to further reduce cost, improve accuracy and georeference data.

GPS Surveys

GPS has opened up a whole new way to easily collect georeferenced data. Unfortunately many users do not understand how GPS works or its limitations.  A GPS unit purchased at a big super store for $100 does not have the same ability as one purchased from a surveying equipment vendor for $20,000. What a lot of people do not understand is that GPS equipment comes in various grades and prices depending on its capabilities.

There are three general grades of GPS equipment, each with different capabilities and levels of accuracy.  The first is recreational grade.  These units cost anywhere from $100 to $1,000 depending on the bells and whistles. They have a horizontal accuracy typically around plus of minus 10 meters. Some of the high end models can achieve a 2 meter accuracy. The next grade is GIS/Mapping. These units are capable of sub-meter horizontal accuracy plus they can also be used to record user defined attributes about the items being located. The highest grade of GPS equipment is survey grade. These units have a sub-centimeter horizontal accuracy in addition to having many of the attribute collection capability associated with the GIS grade.

                  

Regardless of the grade these units share some common short comings.  First their vertical accuracy is not always very good.  In general a GPS units’ vertical accuracy is 1.5 to 2 times its horizontal accuracy.  This means survey grade equipment is the only one that can record reliable elevation data.  Second, since these units rely on satellites in the sky anything that blocks the sky can adversely impact the ability of GPS to record a location.  This can include trees, buildings, bridges, and people.  Weather and other atmospheric conditions such as sun spots can affect the reliability and accuracy of GPS data.

Station and Offset Surveys

This method is most commonly used for studies, utility relocation or preliminary roadway design.  The Station and Offset method is a quick and easy method to locate objects as they relate to an existing road.  This method consists of someone measuring a distance down the centerline or edge of pavement of a road normally starting from an intersection.  Once they are approximately perpendicular to the road and the object to be located, they will record that distance as a station in the format of hundreds + tens of feet (i.e. 2+57.06 = 257.06 feet).  Once they record the station, they then measure the offset from the station to the object being located recording not only the distance but also the side of the road the object is on.  A measuring wheel or a tape is the most common tools used to take these measures.  This is the least accurate method of surveying.   

Other methods of data collection:
Just as we do in GIS, Engineers and Surveyors will often use existing data to start a project. This is especially for preliminary design phase of their projects.  This existing data includes existing engineering drawings, survey plats, hardcopy maps, aerial photos or GIS data.  This data is imported in to their current project using many of the same methods we use in GIS such as heads-up digitizing, raster to vector conversion, or doing a direct import.  Because all of these methods make use of existing data, the accuracy of such information varies greatly.  If you, the GIS professional, want to make use of this information you must learn as much as possible about how the drawing was created.  The more information you have the easier it will be for you to decide how to integrate the drawing into your GIS.

As you can see not all CAD data is created equal no more so than all GIS data is equal. In order to effectively use CAD data in a GIS, you must know as much as possible about how the CAD data was created.  It should be treated like any other piece of information you intend to add to your database.  Keck & Wood, Inc. in partnership with Geospatial Training Services, LLC has released both an instructor led and e-learning class entitled Using AutoCAD data in ArcGIS that covers how to integrate AutoCAD data into a GIS database in much greater detail.

About the Author:
Tripp Corbin, a GIS Certified Professional and an ESRI Authorized Instructor, is the Vice President of GIS Services for Keck & Wood, Inc. and has over 16 years of Surveying and GIS related experience.  As an ESRI Authorized Instructor, he is authorized to teach ESRI’s Introduction to ArcGIS I and II classes.  In addition to the official ESRI classes, Tripp has provided customized training for ArcView 3.x, AutoCAD, and Autodesk Map.

Tripp is an active member of the GIS community. He is a member of several GIS and mapping related organizations including Georgia and Florida URISA, the Surveying & Mapping Society of Georgia, Georgia Association of Assessing Officials, and the Seven Hills Regional Users Group. Tripp is currently serving as Vice President of Georgia URISA.

Posted in ESRI | Tagged: , , , , , | No Comments »

More ArcGIS Geoprocessing Concepts - Enumeration Objects (Part 3)

Posted by epimpler on February 8, 2008

Other posts in this series on scripting your ArcGIS geoprocessing tasks:
Scripting Your ArcGIS Geoprocessing Tasks (Part 1)

Scripting Your ArcGIS Geoprocessing Tasks with Cursors (Part 2)

We all make lists in our daily lives.  Perhaps we create a grocery or shopping list, a “to do” list, a list of goals, or wish lists.  Whatever the case may be we are all familiar with the concept of lists.  Enumeration objects in the geoprocessing framework are essentially the same concept in that these objects contain lists of objects.  These may be lists of feature classes, fields, indexes, rasters, toolboxes, and many others.  As you can see below the GpDispatch/arcgisscripting object contains a number of methods that can be used to generate these enumeration objects.

We’ll start first with the ListFields and ListIndexes methods which return specific enumeration objects. 

ListFields Method
The ListFields method on GpDispatch takes three arguments as you can see below.

  • InputValue - a string representing the path to a feature class or table
  • wildCard - an optional parameter used to limit the fields returned.  If no value is given, all fieds are returned.  Using a combination of * and characters can be used to limit the fields returned
  • fieldType - an optional parameter used to limit the fields returned by data type (i.e. integer, string, date)

A Fields object is returned by the ListFields( ) method.

The Fields object is a type of enumeration which contains a list or collection of individual Field objects.  What you’ll notice about each of the enumeration objects is the existence of the Next and Reset methods.  These methods allow you to navigate the structure of the enumeration, and return the objects contained within as seen in the diagram below.

 

 Below you will see a visual depiction of the process for navigating an enumeration.  Although we are depicting the navigation of a Fields enumeration, the same process occurs in any other enumeration object.  In this example, we’re using the ListFields method to return an object named lstFields.  This object contains a list of individual Field objects for the shapefile that we specified in the ListFields method.  Each enumeration object contains a pointer that is used to access individual members of the collection.  This pointer is initially set just above the first object in the collection.  The first call to the Next method return the first Field object in the collection.  In this case, we’re returning a field named Pop1990.  A second call to the Next method will return the Pop2000 Field object.  Each successive call on the Next method will return the next Field until the end of the collection is reached at which point a None reference will be returned.  These are forward moving enumerations meaning that you can’t move back through the list.  You can however use the Reset method to move the pointer back to the top of the list.

Once the individual Field objects are retrieved from the enumeration you have read only access to the field information.  Notice on the figure below that each of the properties have a single sided barbell indicating that they are read only properties.  You can obtain a lot of information about the individual field objects including the name, aliasname, domain, length, type, and several others.

ListIndexes Method
The concepts that we discussed above in relation to the ListFields method and the Fields enumeration object returned as a result also apply to the ListIndexes method.  Instead of returning a Fields object we get an Indexes object which is also an enumeration object with the same Next and Reset methods.

 

The only difference in the method signatures between ListIndexes and ListFields is that ListIndexes does not have the optional dataType parameter. 

As you can see above the Indexes enumeration object contains individual Index objects which you can access from the collection.  Each index has a number of read only properties including the name, ascending and unique status, and the Fields on which the index operates.

Other Enumeration Methods
The remaining enumeration methods on GpDispatch return a generic enumeration object containing objects of type featureclass, raster, table, dataset, workspace, environment, toolbox, or tool.  One important thing to note on these methods is that you will need to specify the workspace before calling this methods.

import arcgisscripting
gp = arcgisscripting.create()
gp.toolbox = “analysis”

# Set the workspace
gp.workspace = “c:\\Houston\\CrimeData”

# Call ListFeatureClasses
fcs = gp.ListFeatureClasses( )

#loop through the feature classes and buffer
fcs.reset()
fc = fcs.next()

while fc:
     outName = “buffered_” + fc
     gp.buffer(fc, outName, ’500 Feet’)
     fc = fcs.next()

More Information
We will be presenting a new Virtual GIS Classroom course, “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” starting March 24th and ending April 18th.   This class has a maximum size of 10 students and is filling up quickly.  We do offer a 15% discount for government, educational, and non-profit entities.

We also offer an e-learning course entitled “Introduction to Geoprocessing with Python” which contains even more detailed information on ArcGIS geoprocessing with approximately 200 slides of audio and video lectures, visual software demonstrations, exercises and data.

During our February sale when you purchase our “VBA & ArcObjects Bundle” you can receive a free copy of “Introduction to Geoprocessing with Python“.

Posted in ESRI, Geoprocessing | Tagged: , , , , | No Comments »

Scripting Your ArcGIS Geoprocessing Tasks with Cursors (Part 2)

Posted by epimpler on February 6, 2008

In our last post we gave an overview of some basic ArcGIS geoprocessing concepts.  The next few posts will cover the functional groupings of geoprocessing objects, and we’ll start with the cursor objects which are displayed in an orange color on the Geoprocessing Object Model Diagram.

In database terms a cursor refers to a subset of records that is obtained by applying an attribute and/or spatial query on a feature class or table. This subset of records is held in memory rather than visually displayed. Do not confuse cursors with selections sets. Selection objects are used to display the currently selected features or rows in the ArcMap display, while cursors are not used for display purposes. For instance a search cursor could be used to programmatically generate a mailing list of all parcels of land with a property value greater than $100,000. The Geoprocessing framework provides the ability to obtain cursors from geographic datasets (Feature Classes) as well as regular database tables. These cursor objects allow you to manage a subset of records in a single object. In this article we will explore the Geoprocessor classes, methods, and properties used to manipulate cursors as specified through the Geoprocessor Object Model Diagram which you can see in the figure below.

Types of Cursors
There are three distinct types of cursors that can be created through the use of corresponding methods found on the GpDispatch object. The most commonly used type of cursor is the “Search Cursor” which is used in query operations to return a subset of records that meet the query conditions. Search cursors are read-only cursors which you can iterate through to obtain information. You can not use a search cursor to insert, update, or delete records from a table. A second type of cursor is the “Insert Cursor” which is specifically used to insert a new record in your table or feature class. Finally, the “Update Cursor” is used to update or delete records in a table or feature class. The records returned in an update or search cursor can be constrained to match attribute criteria.

It is important that you create the proper type of cursor for the operation that you are performing. For example, don’t create a search cursor if you are attempting to update data in a table. As we mentioned, search cursors are read-only structures so you won’t be able to update the data. We’ll explore each of the cursor types in more detail later in this article.

Cursor Objects in the Geoprocessor Object Model Diagram
The GpDispatch or arcgisscripting object, also called the Geoprocessor Object, is the point of entry for all scripts accessing the Geoprocessor objects.

 

Among many other properties and methods, the GpDispatch object contains three methods that can be used to create cursor objects.

Each of these methods return a cursor type that corresponds to the method name on GpDispatch.  For instance, calling the InsertCursor method would return an instance of an InsertCursor that can be used to insert new rows in a table or feature class. Each method takes a required “InputValue” parameter that points to a data source (table, feature class, etc). In addition, the SearchCursor and UpdateCursor methods take an optional “WhereClause” parameter that allows you to constrain the records that are returned through the use of a where clause.

InsertCursor Class
The InsertCursor method on GpDispatch is used to return an InsertCursor object which is used to add rows to a table.

 This class contains three methods. The NewRow( ) method is used to create a new row object as seen in the figure below.

Once a new Row object has been created you can use the FieldName property in conjunction with the SetValue( ) method to populate data for a particular field name in the new row. After you’ve created a new row with the NewRow( ) method and optionally set the values for the fields in this row you’ll need to call the InsertRow( ) method on InsertCursor to add the row to your table or feature class.

To add a new row to a feature class, you must populate the Shape field as well. You can use the Point and Array objects which are also found on the Geoprocessor Object Model Diagram to accomplish this task.


Take a look at the following Python code example that shows how you can use the InsertCursor object to insert a new record in a table.

SearchCursor Class
The SearchCursor method on GpDispatch is used to return a SearchCursor object which is used to obtain a read-only subset of records from a table or feature class.

This class contains two methods which are used to iterate through the collection of rows that are returned. Remember that the SearchCursor( ) method on GpDispatch can include an optional “WhereClause” parameter that can be used to restrict the number of records that are returned in this class. For instance, perhaps you only want to return the hydrant inspections done by an employee by the name of Steve Smith. You could call the Search Cursor( ) method as follows to accomplish this limitation on the records returned.

searchCursor = gp.SearchCursor(“Hydrants”,”Ins_By = “Steve Smith”)

After the SearchCursor( ) method has been called and returned a SearchCursor object, you can access the individual Row objects within the SearchCursor object through the Next and Reset methods.

When the SearchCursor is initially created, a pointer is placed at the top of the rows returned, just above the first record. To obtain the first Row in the cursor you will need to make a call to the Next( ) method similar to the code example below.

row = searchCursor.Next( )

Each successive call to the Next( ) method will return the next Row in the cursor until the end of the record collection has been reached at which point the row variable will be set to a value of “None”. Cursor objects are referred to as “forward-moving” objects which simply means that you can move forward one record at a time, but not backwards. However, you can use the Reset( ) method to reset the pointer back to the top of the cursor.

You will notice that the Row object returned by a Search Cursor is slightly different than a Row object returned by an Insert or Update Cursor. Rows returned in a SearchCursor object do not have a SetValue( ) method. The reason for this is that SearchCursor’s are read-only objects so you can’t update or insert values into these records.

Take a look at the following Python code example that shows how you can use the SearchCursor object to obtain a read only set of rows from a table.

UpdateCursor Class
The UpdateCursor method on GpDispatch is used to return an UpdateCursor object which is used to update or delete records from a table or feature class.

This class contains Next( ) and Reset( ) methods for navigating through the records that were returned along with an UpdateRow( ) method for updating values in the table or feature class and a DeleteRow( ) method for deleting records. Similar to the SearchCursor( ) method, the UpdateCursor( ) method on GpDispatch can also include an optional “WhereClause” parameter that can be used to restrict the number of records that are returned in this object.


Rows can be updated in an UpdateCursor through the SetValue( ) method and the FieldName property.

Take a look at the code example below to see an example of how you can use an UpdateCursor to delete records from a table.

Geometry Class
Each Row object in a FeatureClass has an associated Geometry object containing the geometric content for the row. This is more commonly known as the “Shape” field. When you access the “Shape” field from a Row object a Geometry object is returned, and contains a number of read only properties that give you geographic information about the current row. Notice the relationship between Row objects and Geometry objects in the figure below.

Some of the more commonly used properties include:

  • Type - data type (point, polyline, polygon)
  • Extent - geographic extent (bounding box) of the feature
  • Area - area of a polygon feature
  • Length - length of a polyline feature

Conclusion
Geoprocessor cursor structures provide you with the ability to query, insert, update, and delete records from Feature Classes and Tables. These easy to create and flexible cursor structures are in-memory collections of records that can be constrained through the use of a “WhereClause” parameter that can be used on the GpDispatch methods that create these cursors. Once generated, these cursor structures provide an easy to navigate, forward-moving structure that can be used to investigate the contents of individual records.

Cursor objects are but one small section of the Geoprocessing programming library. To obtain more information on these objects as well as other functionality exposed by this library please see our comprehensive virtual training course “Introduction to Geoprocessing with Python”.

More Information
We will be presenting a new Virtual GIS Classroom course, “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” starting March 24th and ending April 18th. 

We also offer an e-learning course entitled “Introduction to Geoprocessing with Python” which contains even more detailed information on ArcGIS geoprocessing with approximately 200 slides of audio and video lectures, visual software demonstrations, exercises and data. 

During our February sale when you purchase our “VBA & ArcObjects Bundle” you can receive a free copy of “Introduction to Geoprocessing with Python“.

Posted in ESRI, Geoprocessing | Tagged: , , , , , , , | 1 Comment »

Scripting Your ArcGIS Geoprocessing Tasks (Part 1)

Posted by epimpler on February 5, 2008

This week I’ll be starting a new series of posts covering the use of  scripting for the automation of ArcGIS geoprocessing tasks.  In particular we’ll be covering the use of the Python language to automate many of your common tasks.  In this first post we’ll take a look at the Geoprocessor Object Model Diagram.  Before you can begin scripting your geoprocessing tasks with any language you need to have a fundamental understanding of the objects you’ll be working with and how the interrelate.

An Object Model Diagram graphically portrays the classes, methods, properties, and events that are available in the class library as well as the interrelationships between the objects.  This is a high level document that allows you to research the functionality available on each class.  You can think of the Geoprocessor object model diagram as a blueprint for writing ArcGIS geoprocessing scripts.  In this diagram, notice that each class is color coded by functionality.  For example, the Geoprocessor (arcgisscripting/GpDispatch) class is a cyan color.  This is not always the case as the ArcObjects OMDs are not color coded. 

Click here to see a demonstration of the functionality contained on the Geoprocessor OMD.

OMD Symbology
Let’s discuss some of the symbols that you will see when looking at the object model diagram.  Each class is represented with a colored box that helps group the objects by functional category.  The class name is listed at the top of the box.  Below, the GpDispatch or arcgisscripting class is shown in a cyan color.

Class Properties are symbolized by barbells.  Some properties have a single barbell while others have two.  A single barbell represents a read only property whereas a double barbell represents a property that is read-write.  Read-write properties allow you to change the existing value of a property by assigning a value.  Read only property only allow you to read the current value stored in the property.

Class Methods are represented as arrows on the object model diagram.  Methods are actions that an object performs, and can optionally take arguments.  For example, the Describe(InputValue) takes an input value that represents a path to a dataset and performs the action of returning an object containing descriptive information about the dataset.

Geoprocessor Object (also called GpDispatch or arcgisscripting
The Geoprocessor object, also known by its technical names, GpDispatch and arcgisscripting, is the highest level object in the Geoprocessor library.  This object is the entry point for writing all geoprocessing scripts in Python, and can be used to accomplish many GIS tasks.  The Geoprocessor object has many methods and properties some of which are dynamic.  All geoprocessing tools (i.e. Buffer, Merge, Dissolve, etc) are dynamic methods found on Geoprocessor.  Because they are so numerous and dependent upon the software license level in use, these methods are not included on the object model diagram.  For example, the Buffer Tool is a frequently used tool in ArcGIS, but no reference to this tool is found on the Geoprocessor OMD.  Instead, the OMD has a reference to Dynamic Methods and Properties found at the bottom of the GpDispatch object.  The dynamic Tool(tool parameters) method is a generic reference to all tools currently available at your ArcGIS license level. 

Because it is the entry point for all geoprocessing tasks you must obtain a reference to GpDispatch in each geoprocessing script that you write.  To access this object you must follow a two step process.  Below you will see a code example of this process using both the ArcGIS 9.2 native module and the dispatch method (pre ArcGIS 9.2).  Since ArcObjects was built on the COM protocol and Python supports COM through the win32com.client module, you must first import the Python module, and this is what the first line of each script accomplishes.  The second step of the process creates the Geoprocessor object.  This is accomplished through the create( ) method on arcgisscripting or the Dispatch method on win32com.client.

We’ll have more to say about this object in coming posts.

Cursor Objects
I have covered cursor objects previously, and will repost this to the blog in the near future.  For now I’ll briefly state that cursors are in-memory objects that contain records from a Table or Feature Class.  Three types of cursors exist: search, insert, and update.  Search cursors are created for read-only access to records.  Insert cursors are used to insert new records, and update cursors are used to update or delete data.  We’ll cover cursors in much greater detail in a coming post.

Enumeration Objects (Lists Methods)
Enumeration objects hold lists of some type of object.  This list could includes the fields or indexes available on a feature class or table or simply a list of all the raster datasets within a given workspace.  As you will see there are a number of enumeration methods available in the geoprocessing framework.

As their name implies, List methods on Geoprocessor are used to create lists of various objects (fields, indexes, datasets, feature classes, rasters, tables, etc).  Here are the list methods available on Geoprocessor for creating these enumeration objects.

Describe Objects
The Describe method on GpDispatch is used to obtain detailed information about your data including data type, name, spatial reference, and many others.  This method returns a describe object containing descriptive information about the data type.  For instance, calling the Describe( ) method on a Feature Class would return a FeatureClass object.  This object is often used to test for the type of data (either point, line, or polygon) before further processing.  Various read-only properties are available through this object including ShapeType which returns the basic data type such as point, line, or polygon, ShapeFieldName, Fields, and Extent. 

Miscellaneous Objects
The Geoprocessor OMD contains a number of additional miscellaneous objects including SpatialReference, FieldMappings, FieldMap, Result and a few others.  We’ll cover these objects in a future post.

More Information
As you may have read, we will be presenting a new Virtual GIS Classroom course, “GIS Programming 101: Mastering Python for Geoprocessing in ArcGIS” starting March 24th and ending April 18th.  We also offer an e-learning course entitled “Introduction to Geoprocessing with Python”. 

Posted in ESRI, Geoprocessing | Tagged: , , , , | 2 Comments »

Import Google Earth KML Files to ESRI Geodatabase with Arc2Earth

Posted by epimpler on December 17, 2007

Arc2Earth was initially created as a tool for exporting your existing ArcGIS data to Google Earth, but has since evolved into a robust tool that is also capable of importing KML/KMZ, GeoRSS, and Atom files into an ESRI geodatabase format.  With the release of Arc2Earth version 2, the data import functionality has been rewritten to be more flexible, and includes the ability to import KML/KMZ, GeoRSS (simple, GML), and geo-enabled AtomPub files. The import process can create a new feature class to store the data or update an existing feature class in a personal or enterprise ArcSDE geodatabase.

Click here to see a demonstration of using Arc2Earth to import an existing KML/KMZ file into an ESRI geodatabase. 

 

The “Import KML/KMZ” and “Import GeoRss/Atom” items on the Import menu item open the same Import KML dialog.  The General tab contains a number of options related to the file that will be imported as well as the geodatabase export parameters.  By default, the Import KML dialog is assumed to be KML.  If the importer can’t discern the file type of the source document you will need to know the feed type (GeoRss, Atom) and check the option indicating the file is of type GeoRss if necessary. In the event that you need to import all files in a folder you may specify a folder by using the browse button.  The target layer for your import can be stored in a personal or enterprise ArcSDE geodatabase and can be an existing or new feature class.  In the event that you will be storing the target layer in an ArcSDE enterprise database you must specify the correct connection string for the database.  Three feature classes are created, one each for points, lines, and polygons with the root name of each feature class defaulting to the KML/KMZ file name along with an extension of _points, _lines, or _polys.

 

 

Import options can be saved into an import file (*.a2ei) for later use for commonly used import operations by clicking the “Save” button and specifying a filename and directory path. Both import menu items open the same window, but different options are set for each type of import.

 

The Schema tab on the Import KML dialog contains options for importing KML extended data values, a description templates schema, and the option to only import placemarks.  The “Description Templates Schema” option can be used to pull attribute data from existing description tags in KML Placemarks.  Normally description tags are free form text making them difficult to cull meaningful information.  Schemas allow you to define where in the description text your attribute data is hidden. The “Only Import Placemarks” option can be used to limit the import to only those Placemarks that match the filters on your Template Schemas and are good for targeting specific data in a large KML file.

 

 

The Options tab on the Import KML dialog contains some general options related to KML/KMZ files.  The “Update existing features using Placemark ID’s” option is used with a Placemark ID to find an existing record to update.  When exporting KML, you can specify which field to use for the Placemark ID.  The “Delete all records” option removes existing records from a feature class before the import takes place. This option is useful when you need to re-use a feature class.  In the event that you need to download data loaded in Network Links contained within a KML/KMZ file you can use the “Download all Network Links” option. This option follows nested Network Links and downloads all data associated with these Network Links.  The “Ground Overlays” option downloads all ground overlays in a KML/KMZ file as raster images, and you may specify a folder to place the downloaded images and associated world files.

 

 

Click here to see a demonstration of using Arc2Earth to import an existing KML/KMZ file into an ESRI geodatabase. 

 

For more detailed information on Arc2Earth, please see our new e-learning course.

 

Take advantage of special holiday savings of up to 20% on GIS e-learning courses from GeoSpatial Training Services.

 

Posted in Arc2Earth, ESRI, Google Earth | 1 Comment »