A site-package created by Esri to expose ArcGIS for Desktop (and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

learn more… | top users | synonyms (8)

1
vote
1answer
56 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
vote
1answer
61 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 NAME....
-1
votes
1answer
38 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
176 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
63 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
24 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 ...
5
votes
1answer
52 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
91 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
48 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
72 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 = r"m\...
0
votes
1answer
103 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
99 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
133 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
27 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
75 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
55 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
96 views

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

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 to ...
0
votes
3answers
86 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
34 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
3answers
75 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
1answer
94 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
55 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
36 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
66 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
43 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: ...
3
votes
1answer
78 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
35 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
46 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
83 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
55 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
22 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 ...
1
vote
4answers
84 views

Run a model in arcpy

I have been looking at ways to run a ArcGIS model directly in arcpy, without having to export it and correct all sorts of things in the code. But somehow I can't seem to make it work. This is how I ...
0
votes
1answer
69 views

Spatial Reference not working with If-Else

I'm attempting to use a script to check a folder of data sets to see if they match a projection of another data set in a target folder. I need to be able to re project any that don't match the same ...
3
votes
1answer
37 views

Automate map symbology using varying input data in ArcGIS/arcpy?

I'd like to generate a series of maps, where each map displays graduated colors based on a different variable in the feature's attribute table. The geographic area is the same in each map. I'm using ...
0
votes
1answer
108 views

permissions problem with creating a new text file from the python interpreter in ArcMap? [closed]

I'm attempting to create a .txt file as the output from a larger python script I'm running within ArcMap. The code I'm having trouble goes like this: x = open('adfd.txt', 'w'), and my error message ...
0
votes
0answers
8 views

Map export templates locale

I have created a map export template, where labels and scalebar labels are shown fine when the map export service is published on gis servers where the windows language is english. However, when ...
0
votes
0answers
47 views

Offset and scale of netCDF rasters using Python and ArcGIS

I'm using the arcpy.MakeNetCDFRasterLayer_md command in Python to convert a netCDF archive into multiple rasters, one for each date. Below is a minimum working example of my code, that I've written ...
1
vote
1answer
79 views

Python for ArcGIS: Code refuses to accept a defined variable as input

I'm learning to use arcpy, and I am starting to try and script some geoprocessing tools. While trying to use arcpy.Select_analysis, I found that the code does not accept a defined variable as input. ...
0
votes
1answer
56 views

arcpy.Intersect_analysis using Geometry object as input

Is there a way to run arcpy.Intersect_analysis using an arcpy.Geometry object as one of the input datasets? I've tried different variations of the following, but I can't seem to get it to work. with ...
0
votes
3answers
94 views

Searching for changes of 2 layers based on geometry, Arcgis for desktop (ArcEditor

I´m trying to make a tool that would be able to compare 2 layers of any type (polygon, point, polyline) and find differences between them. Lets say i have a layer of roads (Polyline) from 2005 (layer ...
0
votes
1answer
44 views

Accessing one feature at time to do netwoprk analysis from ArcPy?

I am a bit stuck with my code right now. I have a two feature classes, one for schools, one for residential buildings. So far I have built a model with the modelbuilder, whichs works perfectly as well ...
0
votes
1answer
20 views

Changing coordinate system in which WMS is served using ArcPy?

I am trying to change the coordinate system of a WMS. what i have tried is: prjFile = lokaal + "opmeting_straatkolk.prj" sr = arcpy.SpatialReference(prjFile) mxd2 = arcpy.mapping.MapDocument("CURRENT"...
3
votes
1answer
191 views

“ ”.join(list) not inserting spaces when calculating field

I have a Python script where I'm trying to take the values from three fields (street address data - direction, street name, street type) and combine them into one field, e.g. S, Main, St should be S ...
0
votes
1answer
47 views

Monitor open sde connection

How can I monitor the open ArcSDE database connections without sdemon? I need to see at any time how many sessions are consumed from my app and if they are related to ArcGIS. I use Oracle 10.2.
0
votes
1answer
51 views

python addin manager validation of code

I have a toolbar (in ArcGIS) set up with two buttons using python addin manager, can someone help me make sure this works, when I run these buttons nothing happens. import arcpy import pythonaddins ...
1
vote
0answers
43 views

Arcpy cannot find shapefile attribute [closed]

I want arcpy to perform the following: load a shapefile, prepare to edit it, open its attribute table, perform a numpy.digitize using the values of a certain attribute and some bins provided ...
0
votes
4answers
93 views

Count Points on Points using arcpy

I have a point feature class which contains features scattered around the city, with some of the points intersecting other points. These intersecting features are correctly different features (they ...
0
votes
0answers
42 views

Mosaic Rasters Arcpy

I am trying to mosaic numerous rasters with the following code: import arcpy import os arcpy.env.workspace='H:\Sheyenne\Normalized_Indices\Fuzzy_Overlay' List1=arcpy.ListRasters('*.tif') arcpy.env....
1
vote
1answer
113 views

Arcpy Calculate Geometry (coordinates)?

Does anyone know if it is possible to Calculate Geometry with Arcpy? I need to replicate the command > Right click field and Calculate Geometry except with Arcpy as I need to integrate this into my ...
3
votes
1answer
61 views

How can I overwrite files in a geodatabase (outside the workspace environment)?

I initially set the workspace environment to a directory and included the option, arcpy.env.overwriteOutput=True, but at some point in my script, I convert a shapefile in that directory to a ...