AnsweredAssumed Answered

Convert polyline shapefile to point shapefile using Python

Question asked by Liberator on Aug 28, 2014
Latest reply on Aug 28, 2014 by Liberator

I would like to convert polyline shapefile into point shapefile using Python.

First I shall create a list of polyline points from polyline shapefile and second write point shapefile from previous list.

There is a lot of pieces of code for first and second step apart but not put together.

I think problem is because of list formatting.


1 step:

fc = "polyline.shp"
array = arcpy.Array()

with arcpy.da.UpdateCursor(fc, ("OID@", "SHAPE@")) as curs: 
        for point in row [1].getPart(0):
          # Make some points
            point = arcpy.Point(point.X, point.Y)
            # Put the points in the array


2 step:

for x, y in array:

    point= arcpy.Point(x,y)

    pointGeometry = arcpy.PointGeometry(point)


arcpy.CopyFeatures_management(pointGeometry, "point.shp")


I am using Pytohn only sometimes so any help would be appreciated.