Tag Info

Hot answers tagged

6

Yes, it does exist. Use polyline.measureOnLine(point_geometry).


6

In addition to using the new arcpy.da cursor, I would also suggest: You have many different search cursors on the same layer, see if you can eliminate some of those and pull your attributes from one or two Apply an Add Attribute Index on any column that you are querying against See if you can remove the select layer by attribute logic and apply that query ...


3

In the looong list of types there is GPValueTable which has an example here: def getParameterInfo(self): param0 = arcpy.Parameter( displayName='Input Features', name='in_features', datatype='GPValueTable', parameterType='Required', direction='Input') param0.columns = [['Feature Layer', 'Features'], ['Long', ...


3

In addition to the answers about changing your cursor and reducing the number of them, you can also parallelise this a little by using subprocesses. Subprocesses in Python get around the limitation of the Global Interpreter Lock (GIL) - as opposed to multithreading in Python (a different thing to multiprocessing). Although ArcGIS 10 uses multiprocessing ...


3

You need to create raster objects when working with many of the spatial analyst tools, including Con (Spatial Analyst). Try the following changes: import arcpy from arcpy.sa import * arcpy.env.overwriteOutput = True arcpy.env.workspace = r"D:\Projekt\Testprojekt\Daten\Ergebnisse" arcpy.CheckOutExtension("Spatial") remaped2 = Raster("remaped2.img") slope = ...


3

You may use Describe Object property dataType: desc = arcpy.Describe("C:/base.gdb/test") if desc.dataType == 'FeatureClass': print 'fc' elif desc.dataType == 'Table': print 'table' else: print desc.dataType


1

Theres a bunch of things I'd suggest changing. I'm not being picky, I'm listing them all because if you get past the problem you're having, you don't want to get stuck in another section of code. 1) Why are you loading your input into a featureset? I can't think of why this is necessary. Just pass whatever value you're getting directly into buffer. Input = ...



Only top voted, non community-wiki answers of a minimum length are eligible