Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using ArcPy and using a cursor to step through one polygon feature class. For each of these 'source' polygons, I am creating a SearchCursor to find all polygons in a second feature class that share a common attribute. For each of these matching polygons, I want to measure the distance between it and the search polygon. I also plan on measuring other geometry differences (to determine if it has just been shifted, rotated, scaled, etc).

The purpose of this work is to build up a change history between polygon datasets representing features at different times.

I've seen the ReturnDistance method mentioned in ArcObjects, but can't figure out how to run this using ArcPy. Is it possible, and if so, can anyone help with some rough sample code? If not, I'll probably resort to measuring the change in centroid position between the polygons.

Thanks, Steve

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This answer may not be considered as correct as it exclude use of ArcPy. I am not sure, if you can access ReturnDistance in ArcPy. However, you can access ArcObjects from Python directly. This guide by Mark Cederholm will help you start http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf. It will require from you some object orientated programming skills, if you do know basics, should be enough. Otherwise read the guide. In references you'll find some links to code snippets, if you are patient enough you'll figure it out.

Here you'll have some different approaches to ArcObjects in Python: How do I access arcobjects from python?

And here is an example of ArcObjects in Python (my struggle with this problem): Arcobjects in Python: assign interface to objects with feature (shape) geometry

It took me roughly 3 days to write my own program and I did not have any clue about object orientated programming, good luck.

share|improve this answer
    
I suspected this might be what I needed to do. Thanks for all the links and the info about your experience with this. Will give it a go myself. –  Steve Dec 14 '11 at 22:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.