Tag Info

Hot answers tagged

5

# I know I repeat myself. Any idea to avoid it ? Move secteur = row.secteur outside the if/else statements (before if nbrow > 0:). Move rows = arcpy.SearchCursor(pochoir) inside the for loop (after for fc in fcList:) I think that you aren't accessing the geometry properly. Reference Reading Geometries and Working with geometry in Python. # tells ...


2

Here's how you can get Shape.area to display acres if it's in another unit. In ArcMap, go to the layer properties and the Fields tab. Under "Appearance", click "Number Format". Click the little button with the ellipses that is now displayed. Or right-click a field name in the table view, go to Properties, and click the little ellipses button next to ...


2

The rows of the pochoir cursor can only be read once with a for loop. You need to recreate the cursor for each new feature class. Therefore the code needs to be modified to: arcpy.env.workspace = r"Z:\Documents\SIG\tests\synthese_tocorrect.gdb" fcList = arcpy.ListFeatureClasses() pochoir = r"Z:\Documents\SIG\tests\decoupe.shp"#Clip layer with multiple ...


1

Creating a layer file for your clip shapefile and using selection would be how I would accomplish this task. Remember that when a geoprocessing tool is used it will only perform the process on selected features. In the below script, I first create a feature layer from the clip shapefile, to allow for selection. I then iterate through each feature class to be ...


1

In the absence of a python parser your only real option is: replace(ltrim(replace( [field] ,"0"," "))," ","0") This assumes that you don't have any spaces inside your text, if you do then you need another two replaces: replace(replace(ltrim(replace(replace( [SourceFC] ," ","~"),"0"," "))," ","0"),"~"," ") Again, assuming that you have no ~ characters ...


1

I'm assuming that you are using ArcGIS 10.1 for Desktop or later, but this may also work with 10.0. Open up the Properties of your layer to the Labels tab. Make sure Label features in this layer is ticked on Change the Parser to Python. In the Expression area, if your field is called Name and your data is stored in a file geodatabase feature class, type: ...


1

Try this: CadastreOut = "C:\\" arcpy.MakeFeatureLayer_management(Cadastre, "cadastre_lyr") arcpy.MakeFeatureLayer_management(Buffer_5km, "buflayer") field = "SiteName" cursor = arcpy.SearchCursor("buflayer") for row in cursor: geometry = row.getValue("Shape") out = str(row.getValue(field)) ...


1

The where clause is currently evaluating stepos literally as the value stepos, not the variable value 22. Move the stepos variable outside the where clause string, casting the numeric value to a string, like: arcpy.UpdateCursor(stefile, ' "POSITION" = ' + str(stepos))


1

I see that the question and answers are quite old, but still will post my answer as it could help someone in the future. I get this error mostly because invalid characters in the paths and file names. Keep your whole path strictly in ASCII without spaces and the filename under 13 characters.


1

While this is an old question, the other answers are not appropriate. Converting Distance (Measured Depth), Dip (Inclination), Azimuth to 3D coordinates depends on how you interpret what is happening between the locations where measurements were taken (survey stations). The standard practice today is "Minimum Curvature" where the assumption is that a ...


1

You have to use the 32-bit version of python. I know this is an old post but someone might stumble on it looking for an answer. See https://geonet.esri.com/thread/94637.



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