New answers tagged

1

The main issue here is that you're trying to reinvent the wheel. ArcGIS already has a fully functional Well-Known Text generator built into the da.SearchCursor and Geometry objects. This generator handles both polygons with sub-parts (aka holes), and multi-polygons (potentially with sub-parts), so using the shape@WKT column tag removes the need for list ...


2

One possibility is to create another list which then contains your individual a variables. Finally, we then concatenate those outside the loop. Hence: outer_list = [] with arcpy.da.SearchCursor(fc,['OID@','SHAPE@']) as cursor: for row in cursor: myList = [] array1=row[1].getPart() for vertice in range(row[1].pointCount): ...


1

Just declare your variable a outside of the main loop and de-indent the final print like so (not tested): import arcpy fc=r'D:\GIS Data\TOOLS\EV calc in Python\Data.gdb\PolyWGS842' with arcpy.da.SearchCursor(fc,['OID@','SHAPE@']) as cursor: a = "((" # ADD THIS for row in cursor: myList = [] array1=row[1].getPart() for ...


5

You have the general idea in place already -- just move your print of the list into the loop, and remove the print for each vertex. import arcpy fc=r'D:\GIS Data\TOOLS\EV calc in Python\Data.gdb\PolyWGS84' with arcpy.da.SearchCursor(fc,['OID@','SHAPE@']) as cursor: for row in cursor: myList = [] array1=row[1].getPart() for ...


2

Just by way of an update, you can now achieve some form of order within aggregate functions in QGIS 3.8 (see changelog entry here) by specifying the order_byparameter. You can order by two fields by concatenating them in the order_by parameter. However the order will be alphabetical so if you are using integers make sure to pad with leading zeros so that e....


Top 50 recent answers are included