Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [arcpy]

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

0
votes
0answers
11 views

Trying to use a SelectByAttribute_mangement after I made the XY Event layer

I imported a CSV file using the MakeXYEventLayer_management and trying to use the SelectlayerByAttribute_management function, but I am getting error message saying on "Object ID(OID)" is present.. Is ...
4
votes
0answers
26 views

Python Script Performance as an ArcGIS Tool Versus Stand-Alone

Has anyone studied the difference in running a Python script in ArcToolbox versus as a stand-alone script? I had to write a quick-and-dirty script to convert a set of RGB images to single band by ...
0
votes
1answer
14 views

Identifying intersections in ArcPy

I have two shapefiles: one containing a single polyline feature, and the other containing a number of polygons. I'm trying to use ArcPy to identify which polygons are crossed by the line, and then ...
0
votes
0answers
35 views

Making ArcPy script quicker?

The script below is used to update a shp which is missing values from another .shp using a spatial reference. It's taking about 19 minutes to run through ~53,000 rows. Any ideas on how I can make it ...
1
vote
1answer
18 views

Extracting field value from Info table( .info ) in ArcGIS

I am working on a Python snippet try to use arcpy.da.SearchCursor() to extract value of certain field from a Info Table which generated by executing arcpy.Statistics_analysis().Here's my code: arcpy....
1
vote
1answer
46 views

ArcGIS Pro Python arcpy.CreatePersonalGDB_management

I have an ArcGIS Pro Python script (please note it's version 3+ and to be precise shows as 3.66) and when I run the following command, I get an error. arcpy.CreatePersonalGDB_management(...
1
vote
1answer
13 views

Closest Facility routes do not align with network dataset

I am running both Service Area analysis and Closest Facility analysis using the same network dataset, StreetMap Premium 2017R3. The service area lines exactly line up with the underlying street ...
0
votes
0answers
16 views

Error in FillSinks with Python

I'm trying to use FillSinks from ArcHydroTools with Python My code is: >>> import arcpy >>> import ArcHydroTools >>> fill = arcpy.GetParameterAsText(0) + '\\fill' >>...
0
votes
0answers
13 views

Problem with Fill Sinks - ArcHydroTools

I'm getting use FillSinks of ArchHydroTools with Python but some problems are happen My code is: Import arcpy Import ArcHydroTools ArcHydroTools.FillSinks('projectraster.tif','fil.lyr', "10", "...
0
votes
0answers
6 views

Repoint enterprise geodatabase connection using ArcPy in ArcGIS Pro

I have an ArcPy script that changes the connection parameters for every item in a layer file from a SQL Server connection to a PostGIS connection. This script works perfectly in ArcGIS Python version ...
0
votes
0answers
11 views

ArcGIS is importing orginal numpy while VirtualEnv is activated

I could activate ArcGIS's python command windows to use VirtualEnv by "execute execfile(r'C:\Users\jason\myenv\Scripts\activate_this.py', {'file': r'C:\Users\jason\myenv\Scripts\activate_this.py'})" ...
0
votes
0answers
5 views

Get Feature Service syncCapabilities with ArcPy

I'm working on an ArcPy script to test layers. I have either an arcpy mapping module layer object, or a feature service URL as a text string. I wish to get the feature service's capabilities, in ...
-1
votes
1answer
37 views

Taking data from a CSV file to create points on a shapefile

I am trying to import data from a CSV file and write a script that will generate points on a new shapefile. I am running into issues for when I try to update the InsertCursor. I get an error of "not ...
0
votes
0answers
9 views

Providing multiple inputs to Create TIN tool in ArcPy?

The documentation has a field where you can list the name of your shape, the field, and other variables, but does not give examples of multiple features. The standalone tool supports multiple features....
1
vote
0answers
16 views

Controlling field names with arcpy.Combine?

If I run the arcpy.Combine command as such: result = arcpy.Combine(["CDL/raster07", "NHD/raster07", "OtherRaster"]) The resulting raster has an attribute table with fields [f.name for f in arcpy....
0
votes
1answer
26 views

Creating new layer/shapefile from each element using ArcPy?

How can I create a new layer (shapefile) from every element in another layer? I have point shapefile 'przystanki.shp' (in Polish mean bus stops) with 19 point and some attributes in table. What i ...
3
votes
1answer
25 views

Converting from custom projection northing/easting coords to lat/long in decimal degrees

I've got a custom projection file that's applied to all data (per request of a client), and another team is requesting ids/coordinate pairs for assets. I tried ripping out X/Y off the point data, but ...
0
votes
0answers
20 views

Auto filling column using ArcPy? [on hold]

I need to fill automatically the column "CoeffQté" with the result of the previous columns. Like this way CoeffQté = column 3 * column4 This is an image of the input table . How can I do this? what ...
1
vote
0answers
16 views

Inserting fake data in ArcGIS database automatically? [on hold]

I am making a demo database for property search web app. I want to insert fake names (Ethiopian names), geographical location, and other user information. How can I populate the fields with fake ...
0
votes
1answer
23 views

ERROR 000732: Output Location: Dataset results does not exist or is not supported?

I'm trying to use MosaicToNewRaster but a lot of errors are appears. One of them is: ERROR 000732: Output Location: Dataset results does not exist or is not supported My code is: import ...
1
vote
0answers
23 views

Adding Raster Layer to CURRENT Map in ArcPy of ArcGIS Pro?

I am updating some ArcGIS toolboxes that contain python scripts to ArcGIS Pro. In many of them, I add the geoprocessing results to the map and symbolizes the layer for future processing (these are ...
0
votes
0answers
22 views

Working with object inside editing session using Python AddIn? [on hold]

I'm trying to realize a python addin who checks attribute before to save edits (using the extension before save edits). for example if the object have a field empy the addin show a dialog box. My ...
0
votes
1answer
29 views

If elif ArcPy If feature class equals then alter field / delete field [on hold]

I have multiple feature classes in a geodatabase. I want to run a script that checks if a specific feature class exist within the geodatabase and if it does, modify specific fields found in that ...
0
votes
1answer
23 views

Save output raster and automatically open in ArcMap? [on hold]

I want to reclass (by Table) raster files, then perform raster addition of the output (reclassed) rasters, then automatically display the final output (raster SUM) in ArcMap. This is the code that I ...
0
votes
1answer
25 views

Getting “ERROR 000999: Failed to get raster”?

I'm trying create a raster with arcpy.MosaicToNewRaster_management and this message appears in the end of the process: Runtime error Traceback (most recent call last): File "", line 1, in ...
1
vote
1answer
51 views

ArcPy Geocode Addresses works in ArcPy window but not in a standalone script

This issue sounds like a repeat of ArcPy function works in ArcMap Python window but not from standalone script? but I am receiving a different outcome so this is why I am posting here. The following ...
0
votes
0answers
17 views

Performing raster neighbour analysis? [on hold]

I am currently working on a raster dataset with height values. The dataset represent a bathymatric profile of a coastal area. I need to identify sandbars within the dataset, by its shape. (So higher ...
0
votes
0answers
30 views

Forming designed clusters of points in ArcMap or ArcGIS Pro [on hold]

How can I make clusters of 7-10 points that should not be more than 1 mile of themselves. There are over 1000 points and I've always made the clusters manually but its time consuming. How can I do ...
0
votes
1answer
20 views

Spatially constrained multivariate clustering in ArcPy gives AttributeError?

i want to use the Spatially constrained multivariate clustering tool for a point shapefile. I'm using PyScripter. The shapefile is named "LITO2016_area_modelli_20190312_v2" and the attribute fields i ...
0
votes
0answers
11 views

Converting bodies of water to polygons [closed]

I'm relatively new to GIS, and I'm wondering if there's a centralized dataset that maps the names of bodies of water (i.e. "Black Sea") to polygons, so that I can have an exact outline of the place in ...
0
votes
0answers
13 views

Aligning two polygon shapefile based on attribute field value in ArcGIS Desktop? [closed]

I have a two polygon shapefiles which features are similar (usually rectangles) but not identical. Each similar feature from both layers have the same ID value. Now I want to align features from one ...
1
vote
1answer
24 views

Using Update Cursor to categorize crash ratios? [on hold]

I'm new to coding and I need to somehow use an Update Cursor that I can convert the rates of crashes in a block group into 3 separate categories. The crash rate is the difference between the number ...
0
votes
0answers
22 views

Invalid MXD while trying to convert MXD to PDF using ArcPy?

I am trying to convert an MXD using a script from this link https://www.arcgis.com/home/item.html?id=4ddd1323ae0d4ebe8f8250992faab0f4 When I run the script I get the following error: Invalid MXD ...
0
votes
1answer
24 views

ArcPy geocode address geocoding syntax

Currently I am trying to run a "custom" composite address locator through script and I cannot seem to figure out the proper syntax. I can run the geocoder through the Arc Geocoder Tool (Runs Manually)...
0
votes
0answers
18 views

How to read and use attribute values of a feature class in a calculation using arcpy?

I have a table of 6900+ attributes within a feature class. I want to use the values of these attributes, specifically the fields 'DIST_Port' and 'Num_trips'. I want to run through these and provide a '...
0
votes
1answer
23 views

Creating IDW-rasters from each field in large point feature set using ArcPy for ArcGIS Pro? [closed]

I am using ArcGIS Pro 2.3.2 I am trying to automate the process of making a raster (IDW tool) in model builder by iterating through fields as z-value. I saw some other question asking the same, and ...
-1
votes
0answers
12 views

Making a layer with a query to extract single suburbs in arcpy [closed]

I am trying to use one shapefile to update missing fields (suburbs) in another file and am trying to make a layer containing the single suburbs so I can then use selectWithin and then update cursor, ...
0
votes
0answers
15 views

Changing particular value of raster dataset to zero using ArcPy?

I try to change a particular value of raster dataset to zero using python script. When I deal with one raster, it works. Python scripts as follow: import arcpy from arcpy import env from arcpy.sa ...
0
votes
0answers
17 views

Projecting many raster files in folder and then putting them into ArcGIS Pro project using ArcPy?

I want to project many raster files in a folder (but they appear in the content of my ArcGIS project). Here is the screenshot. These raster files have an unknown coordinate system. When I try to ...
0
votes
1answer
59 views

Parsing CSV data and updating a dictionary and creating a polyline

I am a little stuck on my code. I am new to Python and am learning as I go, but have usually been able to figure it out till now. The code was working up till I put the dictionary part in and now ...
2
votes
0answers
44 views

Creating features from JSON without writing to disk first using ArcPy?

In ArcPy, I want to use JSONToFeatures_conversion, but I'm working with data that I pulled from a web service. I have no need to save the data to disk. So, I thought I could do something like this: ...
0
votes
0answers
15 views

Create segmented line based on attributes [closed]

I'm using ArcGIS Pro (basic) to create lines from points. The points are from a GPS plotting at an interval. Occasionally the GPS goes to sleep and is woken up by an event. The sleep and event moments ...
2
votes
1answer
35 views

Checking field is empty and then adding new row with zeros?

I created a table with three fields but there are no values in these fields. Here is the screenshot of these fields. I want to add a new row with zeros for all these three fields. Here is my code. ...
1
vote
0answers
30 views

Accessing additional CAD annotation fields

I'm trying to read certain values from the annotation layer of a CAD file (MicroStation.dgn). It seems like for certain entities (Cell) the text isn't stored in the field 'TxtMemo' or 'Text'. When I ...
0
votes
1answer
28 views

Trying to use layer saved as .lyr file with arcpy.mapping.Layer function results in error?

I am fairly new to the ArcGIS development world. I am attempting to write a script that will have an end result of selecting features by proximity to a selected portion of a different feature. So far, ...
0
votes
0answers
19 views

Compare Specific Points of Line Features in two Feature Classes using FeatureClassToNumPyArray

I am looking to compare the first and last point between features in two different feature classes. The features share a common ID. My thought was to create two arrays via FeatureClassToNumPyArray. ...
0
votes
0answers
15 views

ExecuteError when loading rasters using ArcPy Mosaic to Raster tool and Python multiprocessing

I'm attempting to merge thousands of rasters into a smaller more manageable number using the Mosaic to NewRaster_management tool in ArcPy. The code I've written works just fine when I run it the ...
0
votes
1answer
18 views

List data sources from multiple .mxds contained in one folder using Arcpy

I have a folder containing multiple .mxd files. I wish to list all of the layer names and data sources for each .mxd from the folder. I am using the following code which lists the above for one .mxd ...
-1
votes
0answers
16 views

Python script for extract variables from Modis data [closed]

I am using Modis data, of LAI and Fpar which I want to extract separately, like LAI and Fpar both variables I want to separate. I am using ArcGIS for this but the tool takes only one tails for input ...
-1
votes
0answers
14 views

ArcPy Near Tool not reporting distance [closed]

I am trying to use the Near Tool in ArcPy. The tool has populated the NEAR_FID field, but unfortunately the NEAR_DIST field is 0 for all rows. This problem was reported in 2016 (https://community....