A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

1
vote
0answers
19 views

Classifying a Raster with Unique Values from Existing Layer File and Dynamically Change Labels - How to Create a UniqueValues Raster Layer File?

I'm creating a python tool that needs to have the output raster added to the current map and symbolized using unique values. I have been able to accomplish this by creating a template layer file and ...
3
votes
1answer
35 views

Building a tool to both geocode and do topology check on the geocoded point (ArcGIS)

Never built a tool in ArcGIS. Would someone tell me if it's feasible to create a single tool (preferably using Python) which: Geocodes an address Checks to see if geocoded point falls within a ...
1
vote
1answer
25 views

string u' encoding problem

the goal of my program is to retrieve data from a field one after another at the end to compare with other values of another table when I execute the code that allows me to point to the values of the ...
2
votes
3answers
121 views

arcpy codes to write ranked values

I have a dataset with ranked attributes(e.g. very low, low, moderate, high, very high). I would like to write a python code using arcpy to give a numeric values to each rank, such as 0,5,10,20,50,100. ...
1
vote
0answers
65 views

Command works in Console, but not in Python Toolbox

I want to create a memory layer with points in ArcGIS with Python Toolbox. I found an in_memory function. Here is the question: Why this command works in Python Console in ArcGIS, but not in Python ...
0
votes
0answers
14 views

Using Python to output table of intersecting polygons in ArcGIS for Desktop? [closed]

I have two polygon layers: routes in a transit system with a quarter-mile buffer draw for each route and the number of daily trips on that route, and Census data at the Block Group (BG) level. ...
0
votes
0answers
29 views

Python script iterator to interpolate accross multiple fields of attribute table

I interpolated precipitation data in ArcMap (ver. 10.2) using a surface-fitting tool [e.g. Global Polynomial Interpolation (GPI)]. I built a GPI model using model builder in ArcGIS 10.2, but the model ...
2
votes
0answers
45 views

Arcpy code only works when run in two chunks, not as one piece

I have a weird thing happening with my script. When I copy/paste it into the python cmd line within ArcMap, I get error messages. However, if I run the first part, then copy in the very last line by ...
1
vote
2answers
22 views

Changing ArcSDE version of *.mxd in ArcPy?

Is there a way to switch the version a .mxd data source is pointing at without using arcpy.mapping.findAndReplaceWorkspacePaths? I have a script that automates map book production that works very ...
2
votes
2answers
44 views

editing and manipulating tables with python

I’m new to ArcMap and was wondering if anybody could help me out. I have a shapefile with counties and wells in that county. In the table I’m trying edit it so that for each county calculate the total ...
-1
votes
0answers
38 views

print doesn't work. ArcGIS [closed]

My python doesn't read the print lines. I can't get any print printed. It seems that the line with the print command is just ignored, consistently (no error is produced, just ignored). Instead I've ...
6
votes
2answers
130 views

How can arcpy to be interactive?

I'm developing an interface with arcgis and python. When I have only python, I can become my script interactive using: S = float(raw_input( 'Please enter the value: ')) I can open and run my ...
1
vote
0answers
20 views

Scripting cursor updates to ArcGIS Online feature is somehow failing

I'm charged with maintaining QA logs embedded in a feature on ArcGIS Online. Basically I just have to change some fields in the feature. The problem is that I wrote scripts using cursors to update ...
-3
votes
0answers
34 views

Properties of Spatial Projection [closed]

How can I write Python script to merge shapefiles, and defining in the same script a spatial reference to the output shapefile? my code is here: import os, ogr, osr outputMergefn = 'merge.shp' ...
2
votes
1answer
36 views

Multiple Input Feature Classes with Different Names - Model Builder

I have created the model below to create "straight lines" from a route (Feature Class is the Route in the model). This model will save me a lot of time compared to doing it manual. The manual steps ...
1
vote
1answer
37 views

Using Editor tools in Arcpy script

I would like to create a custom merge tool that merges 2 polygons within 1 feature class together. I want to have a tool that merges 2 polygons and adds up a specific attribute. Is there any way to ...
-1
votes
1answer
22 views

ArcPy Customize Legend Error - NameError “Not Defined”

I'm trying to use ArcPy to apply a custom .style template in a map legend. First, the code uses a for loop to search the layers in the map and, if the name of the layer is called "Temperature", ...
1
vote
1answer
38 views

Comparison between two fields of two tables using ArcPy cursors?

I would like to make a comparison between two fields of two different tables with a Python script. Fields for comparison are ROAD_NAME and NAME.ROAD. The idea is to check whether each element of ...
-1
votes
1answer
25 views

Script Convert KML to Layer [closed]

I have a KML file (https://meocloud.pt/link/a60a4408-0b89-4163-9a4d-c91c181bbab4/ROI.kml/) and I want to convert to SHP in ModelBuilder using this script that I found on-line, but it doesn't work. Can ...
4
votes
1answer
166 views

Generic error on an “if” in arcpy

My code has to check if a value in a shapefile attribute table belongs to a certain group of landuses. Below I paste my code: cursor = arcpy.SearchCursor(buf_intersect) fields = ["GTYS_Branc", ...
1
vote
0answers
54 views

Debugging looped python script (updating picture element link)?

Can anyone help with the following script? It's goal is to list every mxd in a folder, list picture elements in them and the change the path for a specific element. Here's an update version of the ...
0
votes
0answers
22 views

Reprojection script failing after running once

This is related to Getting Error 999999 from arcpy.SpatialReference.name? @Aaron gave me a workable solution. I refactored the script afterwards and it ran once successfully. When I reran it in the ...
3
votes
1answer
31 views

Auto-generated field in ArcSDE for end user

The objective: Create a process where a coworker can open an .MXD, start editing, add a feature to represent a complaint, then add records in a related table to represent an inspection. Along the way, ...
2
votes
2answers
85 views

Remove tables - not just layers - from the map document

How do you remove tables/table views from the table of contents (TOC) in the map document? I've written code that cleans things up after each tool run, but I cannot figure out how to get rid of the ...
1
vote
1answer
38 views

arcpy.TableToExcel_conversion works on layer but not if layer is variable

I'd like to loop through a bunch of mxds, on every layers, and from them I'm trying to export excel files. If I use a layer in arcpy.TableToExcel_conversion it works, but as I set a layer as a ...
1
vote
1answer
57 views

Recalculate fields value using ArcPy and Calculate Field tool?

Im not sure how to pass through a list of fields within the calculate field tool.I have a list of fields and each of them need to be divided by 1000. My code is as follows: import arcpy shp = ...
0
votes
1answer
99 views

How to find identical street names with consecutively numbered addresses using Arcpy

I am trying to write a python script that will only select multiple rows with the same street name if they have consecutively numbered addresses and then place those street names in a list. For ...
1
vote
1answer
71 views

Getting Error 999999 from arcpy.SpatialReference.name?

I'm trying to build a set that consists of spatial reference names using .name method from the arcpy.SpatialRefernce() class. When I do this for a single prj file there is no issue, but when I try to ...
0
votes
0answers
43 views

Arcpy Intellisense in Visual Studio Code - pythonVSCode extension

I'm looking for help on the correct way to setup Intellisense for ArcPy under Don Jayamanne's popular PythonVsCode extension for Visual Studio Code. The project wiki details configuration of ...
1
vote
0answers
26 views

Arcpy Result object - status Waiting, Cancelling, etc?

This is a question similar to Using ArcPy Result object associated with Currently Running Script. I'm curious about how result objects in arcpy can have certain statuses that indicate a geoprocess ...
1
vote
1answer
40 views

Pass sql expression with GetParameterAsText to SelectLayerbyAttribute in .py script

With Arctoolbox and python scripting I'm creating long tool, but one of the steps is to select by attributes with SQL expression. Let's imagine that: featureCar = arcpy.GetParameterAsText(0) is Data ...
0
votes
1answer
31 views

Automation KeyError using Search Cursor / Data Dictionary

I recently received help in modifying a previous code for structures as part of project. The first time I ran it the code worked fine, but when I went to double check it. I keep receiving: ...
2
votes
2answers
61 views

Determining whether point is on left or right side of road using ArcPy?

Is there any way to determine the left or right side of road using arcpy? I was able to find if road is going from north to south,south to north,east to west or west to east.link that helped:- How ...
0
votes
3answers
61 views

Extracting value of raster for specific points (with X and Y coord) and write to column in Attribute Table?

I have specific points in shp file and list of rasters in the same coord system and want to extract values from rasters for each point and place these values in column in Attribute Table of ...
1
vote
1answer
28 views

The same value for X and Y in Attribute Table

I want to extract X and Y coordinates of points from shp file - infc, and put them to corresponding columns in Attribute Table. My code just give the same X and Y for all points in Attribute Table: ...
-3
votes
0answers
26 views

Can't display my attribute rows as points in ArcMap using arcpy [duplicate]

I have a part of my script that you'll find below. I used searchcursor to get X, Y coordinates from a table and insert it into my second table which one should generate row with new records. New row ...
3
votes
3answers
64 views

Using Copy (Management) from GetParametersAsText() in ArcPy?

Having some issues getting the arcpy.Copy_management to work. Essentially I simply would like to be able to have a user select a folder which contains multiple shapefiles and copy them to another user ...
-3
votes
0answers
17 views

Where clause works with value but when replace by variable it doesn't work [duplicate]

I have my script with searchCursor below. When I'm running it, it works with values 'Avenue Ruel' and 119 as you can see the result after print statement but when I'm replacing them by their variables ...
3
votes
1answer
64 views

Change Map Title Block Information through ArcPy

I am new to python, but I'm currently working on a script tool to loop through all MXDs within a folder and change their associated title block information(Map Title, Report Title, Date, Charge Code, ...
1
vote
0answers
33 views

Creating button on Python AddIn toolbar to run python script when clicked? [closed]

I need to create a button on toolbar of arcgis 10.2 who run a python 2.7 script created before when I click. Then I need to know if it's possible in this button that script write results to an excel ...
2
votes
1answer
30 views

save as Layer script not working

I've created script in Python for ArcGIS to save shape file as layer file..the code throws an error ERROR 000732: Input Layer: Dataset D:\core i 5 data\symon assignment\Swat\clipped\buffer.shp ...
-1
votes
1answer
47 views

Insert Cursor not creating polygon

I used this code to create a polygon in my map, but the polygon isn't showing up anywhere. Does anyone know why? Here is my code: fc = "U:\BuildingFootprints.gdb\BuildingFootprintsCopy" cursor = ...
2
votes
0answers
37 views

ListFeatureClasses isn't returning anything in GDB [closed]

I am writing a script that performs a series of operations on line, point, and polygon files in my file geodatabase matched through a unique number in their filenames. My geodatabase looks like this: ...
0
votes
0answers
41 views

Arcpy expression using date field and today's date?

I would like to create an expression similar to the following to incorporate into the arcpy.SelectLayerByAttribute_management function. It's not correct, I just wrote down what I would like it to do. ...
3
votes
1answer
54 views

Transfering features class from ArcSDE to File Geodatabase using ArcPy?

I would like to know if it's possible to use python to transfer features class from SDE into a GDB and then transfer it back to SDE without losing SDE parameters such topology, versionning, ...
1
vote
2answers
27 views

Add raster attribute table to raster using arcpy

I have downloaded US soil raster data by state from https://gdg.sc.egov.usda.gov/GDGOrder.aspx at 10m resolution. I am now trying to add a modified raster attribute table to tif that was exported ...
1
vote
2answers
38 views

Arcpy Reclassify by Standard Deviation

I would need some help with the Reclassify tool. I have written a script that produces rasters which I need to reclassify. My problem is, I want the values to be reclassified by standard deviation ...
2
votes
2answers
70 views

Update Cursor for automation of tedious data entry which keeps crashing ArcMap

I coded the Update Cursor for automation of tedious data entry where I am applying a previous Survey Company Identification Data to STRUCTURES_15096.shp from "OFFICIAL_STRUCTURES2015.shp" and it keeps ...
0
votes
1answer
34 views

How to list features “in_memory”

I have a script that creates a number of features "in_memory." Once I have them in memory I need my script to create a list of everything "in_memory" - I'm not sure how to achieve this. Is anyone ...
0
votes
0answers
21 views

Save update feature class (Python toolbox)

I created a Python Toolbox tool to reorder fields I am trying to save the feature class determine path,any advise? here is acode I'm trying: import arcpy import os class Toolbox(object): def ...