views:

375

answers:

3

Im just starting off with GDAL + python to support operations that cannot be done with ArcGIS python geoprocessing scripting. Mainly I am doing spatial modeling/analysis/editing of raster and vector data.

I am a bit confused when ArcObject development is required versus when GDAL can be used? Is there functionality of ArcObjects that GDAL does not do? Is the opposite true too? I am assuming that ArcObjects are more useful in developing online tools versus Desktop analysis and modeling where the difference is more to do with preference? In my case i prefer GDAL because of python support, which I believe ArcObjects lack.

thanks!

+2  A: 

GDAL is included in ArcGIS to work with some raster data formats. They do not use the GDAL utilities to do any geoprocessing. I would imagine ESRI have implemented most, if not all, of the functionality in GDAL with their own geoprocessing functions. In summary there is a big overlap in functionality between the two.

The ESRI geoprocessing functions can all be run and scripted through Python. The geoprocessing tools are higher level abstractions (a simplification) of ArcObjects, and have been built using ArcObjects. They should cover your requirements of "spatial modeling/analysis/editing of raster and vector data."

http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?id=596&pid=592&topicname=Geoprocessing_framework

What function do you find is missing in the ESRI geoprocessing tools?

The GDAL utilities can also be manipulated with Python (and other languages). If there is a utility in the link below that meets your needs then you can use this.

http://www.gdal.org/gdal_utilities.html

geographika
hey, thanks for the reply.There are many geoprocessing functions that i want to customize, hence why i have started to learn GDAL with python to do this. What i do not fully understand is if there is any disadvantage to using GDAL with python or c++ over using ArcObjects and c++? Are these two routes equally "low level" programming? Basically: is there anything that ArcObjects with c++ could do that GDAL with python or c++ could not do? (or vice versa?) it is my understanding that most ArcObjects actually largely use the GDAL library?
ArcObjects only uses GDAL to read certain image formats NOT for any geoprocessing. Many raster image formats are read using ESRI code, but there are some that are read using GDAL code. The same way a program may use Adobe code to export a document to a PDF. If you are doing geoprocessing then you can either use the ESRI tools (which use ArcObjects at the low level), or GDAL utilities (which use C++ libraries). Your question is similar to asking if MS Word can do the same as Open Office Writer - they have two very different implementations of similar functionality.
geographika
A: 

ArcObjects and geoprocessing add a lot more functionality than GDAL and is mostly aimed at the desktop. Another option for looking at Python is also using QGIS which has a python API, is Free and Open Source, and an active developer community.

There are also plenty of python libraries for doing spatial work, such as Shapely. I would say for raster that GDAL is your best bet but for vector you might want to use something like shapely.

TheSteve0
+1  A: 

geographika's answer is superb. I'll only add that I use gdal/ogr when simplicity and speed is wanted in conversions. Examples include one format to another, adding image pyramids, simple merging and coordinate transformation (raster & vector). When all you want to do is jam a bunch of shapefiles together or convert a large series of rasters to a common projection gdal/ogr is faster to startup and run as it doesn't need to load the whole ArcObjects COM library to access one or two functions. (I've been told ESRI has the largest MS COM system on earth, by a large margin, including all of Microsoft's offerings.) Or check for a valid license. In one test I ran comparing ESRI arcgisscripting to GDAL ogr2ogr processing time went from 6 minutes to 10 seconds.

The only significant thing, in the realm of conversion and projection, that I feel is missing from gdal is the ability to log geoprocessing activity in the Lineage section of the metadata. ESRI tools do this automatically (most of the time).

When moving beyond conversion and getting into proper analysis though there really is no place outside of ESRI. In my experience that is. Before you dig into ArcObjects directly I'd spend some time learning what can be accomplished via arcgisscripting (arcpy in v10), which is python, and dot net.

matt wilkie