ArcGIS Python Geometry

855
3
05-03-2012 11:49 PM
JohanSmith
New Contributor II
Hi Community,
I was wondering if anyone here could recommend me some good references to help start learning how to create geometries within python for arcgis feature classes (trying to create perpendicular lines at the centroid point of another line by taking the arctangent of that line). I am sure there are scripts that already do something similar but I really want to learn how to do this for future reference ArcGIS Resource Center is of little help to me unfortunatley I need something more detailed.

As python is relativley new in arcgis I suppose there aren't any good books on the subject? otherwise blogs and articles would be most useful.

Thanks
J
Tags (2)
0 Kudos
3 Replies
magdaw
by
New Contributor
Hi JohanS11,

Couple of useful links for you:

https://www.e-education.psu.edu/geog485/node/142
https://www.e-education.psu.edu/geog485/book/export/html/139

The script close to your requirements exist under the following link:
http://arcscripts.esri.com/details.asp?dbid=15756

Hope that helps...
0 Kudos
JohanSmith
New Contributor II
Thanks for those suggestions... I did try that perpendicular script but as it was built for 9.3 I tried to convert it to 10.0 without success.

I had to change
feat = row.Shape
firstpoint = feat.FirstPoint
...
firstpoint = firstpoint.split(" ")

to
feat = row.Shape
firstpoint = feat.firstPoint
...
firstpoint = firstpoint.split(" ")


but subsequently that gives me the error that "Point object has no attribute 'split' " when "firstpoint = firstpoint.split(" ")" is executed.


***UPDATE***

Solved my own problem by implementing the following instead

fpx = firstpoint.X
fpy = firstpoint.Y
0 Kudos
DianeWhited
New Contributor
Would you mid sharing your updated script for creating perpendicular lines?  Thanks in advance.

Diane
0 Kudos