Update/Add Z values for the vertices of a polyline - How to?

2960
1
07-28-2012 11:11 PM
AnthonyGangemi
New Contributor
For creating a polyline feature class from xy coordinates, I�??m able to follow the example python script given at the ArcGIS 10 help library...Writing Geometries.

I want to take this a step further. Assuming an existing polyline feature class has the ability to store Z values in the geometry field, how one would craft a python script to iterate the vertices of the polylines and add/update Z values to them.

As I understand it, the process would involve using the UpdateCursor and InsertCursor at the same time.  I have found an old example but I'm struggling to make sense of it.

Can anyone provide a very simple Python example that demonstrates how this could be done under an ArcGIS 10.x platform?   I just need a simple example that explains the basic concepts and steps involved.

Regards,

Tony G
Tags (2)
0 Kudos
1 Reply
KimOllivier
Occasional Contributor III
The old example is as simple as it gets. 8-) You need to define a new featureclass that is Z-aware so that you can iterate through the features, parts, vertices to extract the coordinates and then roll back the process to create new features from arrays.

If you have x,y,z points then the easiest way would be to use the tool PointsToLine to rebuild a series of lines.
0 Kudos