And you are saying that after the code to create the geometry list that when you loop through the geometry list and process each individually that you get 5 feature classes each with one feature with unique geometry and if you process the whole geometry list you can one feature class with 5 features each with the same geometry?
Also just to verify you might want to try running the code below just to get more of an idea of the geometry in the list. If the extents are different then the geometries you are creating are different and I am not really sure why they would not be outputed that way when passed to Copy Features.
# make a new geodatabase feature class for the streams: for i in range (0, len(upstream)): ln = upstream arcpy.CopyFeatures_management(ln, "line" +str(i)) arcpy.CopyFeatures_management(upstream, "streams")
for g in upstream: print "Min X: {0}, Min Y: {1}, Max X: {2}, Max Y: {3}".format(g.extent.XMIN, g.extent.YMIN, g.extent.XMax, g.extent.YMax)
upstream =[] # for each sampling site a polyline shall be added to this list (one stream contains several branches that are dissolved to one polyline with the dissolve tool in the end) # do for each sampling site: for streamsegment_list in sampling_list: lineList = [] # for each branch a polyline shall be added to this list # do for each branch of the actual stream: for segmentlist in streamsegment_list: # streamsegment_list contains the points for all branches of one stream, segmentlist gives one branch pointList = arcpy.Array() # the points for one branch of the stream-polyline shall be added to this list # do for each point of the actual branch: for segment in segmentlist: # segmentlist gives one branch of the stream, segment is an object that contains the x/y coordinates PS_pt = arcpy.Point(segment.firstx, segment.firsty) #firstx and firsty contain the coordinates for the points pointList.add(PS_pt) # add the point to the list ln = arcpy.Polyline(pointList) # make a polyline out of the pointlist (one branch) lineList.append(ln) # append this polyline to the linelist ln = None line_geom = arcpy.Geometry() lines = arcpy.Dissolve_management(lineList, line_geom) # dissolve the branches of one stream to one polyline upstream.append(lines[0]) # append this polyline to the upstream-list # make a new geodatabase feature class for the streams: arcpy.CopyFeatures_management(upstream, "streams")
line_geom = arcpy.Geometry() lines = arcpy.Dissolve_management(newline, line_geom) upstream.append(lines[0])
[<Polyline object at 0x107918d0[0x104daaa0]>, <Polyline object at 0xbebd770[0x104ce278]>, <Polyline object at 0xbdf6cf0[0xba9c980]>, <Polyline object at 0xbe0e750[0x104dad58]>, <Polyline object at 0x573d770[0x104ce338]>]
for i in range (0, len(upstream)): ln = upstream arcpy.CopyFeatures_management(ln, "line" +str(i))
import arcpy g = arcpy.Geometry() geoList = arcpy.Dissolve_management(r'C:\Data\ArcGIS\TemplateData.gdb\USA\states', g) arcpy.CopyFeatures_management(geoList, r'C:\Data\ArcGIS\TemplateData.gdb\USA\statesDiss")
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.