Questions tagged [arcpy]

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

719 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
45 views

Getting ArcMap layer with symbologyType = “UNIQUE_VALUES”?

I am trying to write an automated mapping script to set new categories for a layer on each iteration, however I have encountered a problem. If I understand it correctly may layer's symbologyType ...
1
vote
0answers
43 views

Arcpy multiprocessing arcpy.Select_analysis

I have the following script: import arcpy from arcpy import env import datetime import os env.workspace = r"Q:\\SDE\Direct Connection to Contours.sde" dataFC = arcpy.ListFeatureClasses("","","...
1
vote
0answers
41 views

Extracting image attachments from geodatabase with image names according to attributes in certain field using ArcPy?

I have data from the field survey using Survey123 for ArcGIS in the geodatabase format. I want to extract all attachments from the geodatabase. I want the name of the image in the extraction to follow ...
1
vote
0answers
18 views

Jump to specific folder in catalog pane using Arcpy

I am developing a Python add-in for ArcGIS Desktop. As a part of this add-in there is a button that I would like to jump me to specific folder in the Catalog Window. Is there any way to do this?
1
vote
0answers
29 views

arcpy.da.ListSubtypes returns empty IOError on 64bit

I'm trying to use “ListSubtypes” function in ArcGIS Python. It works on 32bit environment (f.e. - Desktop), but it does not work in 64bit (f.e. - Server) and returns IOError without any information –...
1
vote
0answers
34 views

ArcPy failed to draw?

My ArcMap 10.6 Python code for creating a specific raster isn't working. The code is fine but the output keeps saying failed to draw. import arcpy from arcpy.sa import * arcpy.env.workspace = r'C:\...
1
vote
0answers
31 views

Creating Near Table between points in one layer that share an attribute with points in another layer?

I am trying to calculate the distance between some geographic features (point layer) and the capital of the country that they fall in. I have a shapefile of "features" and a shapefile of "world ...
1
vote
0answers
25 views

Getting error from Arcpy Tabulate_area

I am trying to get the area of land use in each pixel of the fishnet file. I used the following script: arcpy.gp.TabulateArea_sa("fishnet_layer","FID","lulc.tif","Value","lulc_tab","1.1E-3") Here ...
1
vote
0answers
32 views

Creating loop in raster algebra which compares each cell to values of other rasters in time series?

I have a list of rasters representing NDVI values (and plan to do similar thing with some other index values as well) and in that raster I also set all values representing clouds to NoData. Now, for ...
1
vote
0answers
44 views

ArcPy Script Tool multi-value re-order buttons

I'm trying to set the values of one control (Multi-value, data type: string ) to another parameter control (Multi-value, data type: "any value" which produces a drop down with grid for items entered ...
1
vote
0answers
66 views

ERROR 000338 when appending two datasets into one with arcpy

In an enterprise geodatabase with three datasets I'm trying to append two of the datasets into the third, however I get an error which states that Inputs must be either all Feature Classes, Tables or ...
1
vote
0answers
53 views

Reclassify raster conditional on attribute values in R

My raster has nonsensical values (based on combination of multiple rasters in previous steps), with attributes maintained (again, due to combination of rasters in previous steps), see below for sample ...
1
vote
0answers
46 views

Raster output symbology differs in tool vs. Python

I have a bunch old DOQQs from the 90's that are projected in NAD27, giving them the black angled collar you see in the image. I am trying to set the collar to null by running SetNull on Value = 0. If ...
1
vote
1answer
174 views

Calculate percentile value of raster

I want to set null all raster values that fall below the 75th percentile value. E.g. If you classify the raster by quantile method into 4 classes I want to be left with the top 25% percentile. For the ...
1
vote
0answers
18 views

Snap pour points not recognizing sample sites as valid points when using ArcPy?

I am trying to go from a CSV of sample sites and a DEM to creating watersheds. I can process the DEM fine to stream networks and can import the points (first to event layer, then convert them to a ...
1
vote
0answers
71 views

How to fix error 000840 the value is not a raster dataset for Mosaic?

I'm trying to to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second raster to mosaic ...
1
vote
0answers
34 views

How to add rules to the topology from a .rul in ArcPy

I am trying to create a new topology using and ArcPy script and I have a lot of rules inside a .rul archive. The function to do that is: arcpy.AddRuleToTopology_management(out_topo, rule_type, in_fc1,...
1
vote
2answers
72 views

Getting Erase ExecuteError 999999?

I've made an arcpy script which worked last week, but I placed it somewhere different on my computer. I've made sure all the source files etc. are connected. However now I keep getting an error ...
1
vote
1answer
72 views

Using ArcObjects in ArcPy to change map grids in Data Driven Pages

I'm a newcomer to Python and have been working on using ArcPy scripts to automate Data Driven Pages in ArcGIS. I would like some help please to use ArcObjects in ArcPy and change map grids in DDP with ...
1
vote
1answer
57 views

Using data from SQL Table instead of File Geodatabase Table

Does anyone know of a method to use the table from SQL Server table using OS Authentication, instead of a File Geodatabase Table in ArcPy? I have been using the below to reference the table ...
1
vote
0answers
46 views

Merge dbf files from different folders in Python or Arcpy

I am new to Python. I have over one hundred dbf files to merge in two diffrent workspaces. Workspace 1: PCPT100100 PCPT101101 PCPT102101 Workspace 2: s100100 PCPT101101 s102101 I want to merge "...
1
vote
0answers
67 views

arcpy.SummarizeWithin_analysis error: error in executing tool

I am trying to identify and sum the lengths of line segments within a polygon boundary using the arcpy tool: arcpy.SummarizeWithin_analysis('my_gdb.DBO.gridzones', 'my_gdb.DBO.lines', 'my_gdb....
1
vote
1answer
36 views

Running convert Raster to Point Features in arcpy returns an error

I'm trying to convert a bunch of rasters to point features to further build a regression of those. Is it possible to do that without a conversion using arcpy? If not what am I doing wrong converting? ...
1
vote
1answer
85 views

Getting for loop which stops after first one to iterate properly?

I originally asked UpdateCursor can't acquire lock, but can acquire lock in TestSchemaLock and got some help about why my code wasn't acquiring a lock. My new problem is that my code isn't fully ...
1
vote
0answers
41 views

TableToTable_conversion using PostgreSQL and ArcPy

Currently, I am trying to convert a geodb to a table in my PostgreSQL db with arcpy as such. I've tried both with the parcels table being created and the parcels table not being created arcpy....
1
vote
0answers
28 views

Checking Shapefile type (Point, Line, Polygon) in ModelBuilder using python script?

I am creating a model and would like the input to branch off to different tools within the model based on the shapefile type (point, line, polygon). I haven't found a tool in ModelBuilder that will do ...
1
vote
0answers
25 views

Polygon Clip While mainting Ratio Policy

In my project, I am using drivetime polygons to clip block group data to get the population in that drive time. The drive time shapefile I am testing on has 5 polygons. I want to update the population ...
1
vote
0answers
41 views

AGOL: Overwrite existing tile service - Invalid min scale in the specified source item

I'm trying to automate updating a tile service where: TPK is generated from a feature class in an .mxd (data frame is web mercator) TPK is pushed up to AGOL Tile Service is published TPK is deleted ...
1
vote
0answers
83 views

Copying tables results in duplication of some tables, feature classes and relationship classes

ArcGIS Pro 2.2.3. I have a file geodatabase called "supportSource.gdb" with 3 tables, 2 feature classes and 3 relationship classes. I just want to copy the contents of this file geodatabase to ...
1
vote
0answers
56 views

Efficiently Searching MXDs for Folder Connection

We are currently trying to restructure some of the companies GIS data. It is located on an internal network drive (no SDEs). For each year, there are 1000+ MXDs with map layouts that still need to be ...
1
vote
0answers
23 views

What happens to .dbf file with TableToDBASE?

I have been trying to use TableToDBASE without success. I looked at this help link: http://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/table-to-dbase.htm. The code runs fine but it does ...
1
vote
0answers
50 views

Appending polygon features from file geodatabase table to SDE table?

I am facing an issue while appending the feature class to ArcSDE feature class. All the I am trying to append the gdb feature classs data, I can see that the geometry is either changed and some cases ...
1
vote
0answers
68 views

Using Null Values in Raster To NumPy?

I am trying a convert a raster dataset [a simple 4 x 4] into a numpy array using RasterToNumPyArray. Here is my sample raster dataset: RasterToNumPyArray however, returns zero for Null values: ...
1
vote
2answers
132 views

replaceDataSource() works in ArcMap but not as stand-alone script

I have one script (and one alternative) that I want to use to replace a broken data source. Neither is working outside of the ArcMap Python Window. Has it something to do with the MapDocument object? ...
1
vote
0answers
193 views

Arcpy InsertCursor inserting geometry into Shape field

I'm trying to write a script that reads geometry for each row in feature class, then create a new feature class and insert into it that geometry. It has to work with ArcGIS 10.0 so I have to use arcpy....
1
vote
0answers
125 views

Encoding issues in Arcpy, appears unicode?

I have a column that has Greek characters: Example: Like "*\u0395\u03a*") What can I do to make it appear as it should? What I have tried: import sys reload(sys) sys.setdefaultencoding('utf-8') ...
1
vote
1answer
40 views

Copying attributed relationship with ArcPy?

Is there a way using arcpy to copy an attributed relationship and only the attributed relationship ? I can recreate a non attributed relationship with: arcpy.CreateRelationshipClass_management(arg1,...
1
vote
0answers
92 views

Updating min and max values with ArcPy on stretched raster symbology in ArcGIS Pro?

I have a map I am making where all I want to do is change the source layer for a raster to a new layer. I would then like to apply the same symbology as the original layer, but change the min and max ...
1
vote
0answers
57 views

Use selected feature in MXD as selector in python?

I am quite new to ArcPy. However, I want to write a script that: uses an existing SELECTED FEATURE of a feature class in a data frame of an existing MXD (on an SDE Server) for a SELECT BY LOCATION ...
1
vote
0answers
181 views

Uploading mxd to ArcGIS Online with Python?

I need to create a Python script to upload an MXD to AGOL. I have created an script in arcpy to create a service definition file (*.sd) from the mxd. I have not been able to upload the sd to AGOL ...
1
vote
0answers
57 views

Exporting several maps with excel sheet using Arcpy

I try to export 20 maps with this python code in ArcGIS 10.3.1 for Desktop. Each map has excel sheet (not attribute table) in the layout view. The excel sheet file located in G:\Users\test\Downloads ...
1
vote
2answers
189 views

CreateTable_management as part of a script tool fail

I am trying to create a table as part of a script tool, and it always fails with error 999999. The general idea of the script is that it is calculating proportional coverage of things in a series of ...
1
vote
0answers
45 views

How export geodatabase version differences in ArcPy?

With ArcObjects I have this code in C# to export the differences to a XML file: ESRI.ArcGIS.GeoDatabaseDistributed.IVersionDataChangesInit pVDataChgs; var pvTemp = new ESRI.ArcGIS....
1
vote
1answer
72 views

Identifying source of reference mosaic dataset in ArcPy?

I want to check the source mosaic dataset for a reference mosaic dataset within Python. Using: arcpy.Describe(reference_mosaic).referenced I can confirm that the reference mosaic is indeed a ...
1
vote
0answers
114 views

Adding compression variable to CopyRaster_management for TIFF Raster Dataset?

I am using ArcGIS Desktop 10.1. I need tiff orthos to have NO compression. I'm using a python script to parse through directories and add 4-band data to the images. It works great ... but the ...
1
vote
0answers
213 views

Running spatial analysis using ArcPy in PyCharm failed with error code 1073740791 (0xC0000409)

I'm running spatial analysis using ArcPy in PyCharm (Windows 10 64bit environment) failed with error code 1073740791 (0xC0000409). Specifically, i'm trying to run Expand within the spatial analysis ...
1
vote
1answer
76 views

Specifying trusted SSL certs in ArcPy?

I know that you can do an https request in python, passing in a cert or bundle to requests.post(), with the verify argument. Is there any way to do something similar in ArcPy? I'd like to fully ...
1
vote
0answers
29 views

Using Copy Raster in ArcPy gives different result to tool dialog?

I am trying to convert 16 unsigned bit tifs to 8 unsigned bit BMPs. When I used the Export Raster in ArcGIS, it works well. But when I used arcpy arcpy.CopyRaster_management(each, ...
1
vote
0answers
44 views

Retrieve subtypes from feature service using arcpy

Within a python toolbox, I'm trying to retrieve subtypes from a feature layer in ArcGIS Pro using arcpy.da.ListSubtypes(). The feature layer is a hosted feature service on ArcGIS Online. Rather then ...
1
vote
0answers
18 views

Multiprocessing GALayerToRasters

I'm new to ArcPy and am creating a script to automate some interpolation work. I have multiple GA Layers outputted by an Empirical Bayesian Kriging interpolation (using arcpy....