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

learn more… | top users | synonyms (7)

2
votes
3answers
552 views

arcpy.mapping.MapDocument(“CURRENT”) fails when running python script in background as tool

The engineers I work with have requested an autosave feature for ArcGIS, so I thought I'd make them a python tool that routinely saves. The script works fine when run in the foreground, but fails when ...
0
votes
1answer
56 views

Update Description of Feature Class in SDE or GDB

I need to add a Description to a Feature Class using arcpy. The feature class lives in our enterprise geodatabase. The Feature Class does not live in an MXD file, nor will it ever for this script's ...
3
votes
4answers
139 views

Debugging ArcGIS Python scripts

I am new to Python and coding generally, and I cannot figure out how to set up a debugger that will work with Arcpy. I am trying to use PyCharm, but it always gets caught up with the fact that it ...
1
vote
2answers
280 views

Arcpy.da.SearchCursor to retrieve the min and max measure values from Polyline-M shape

Is there a way to use a search cursor in ArcGIS to read the minimum measure and maximum measure values of a linear referenced route layer using arcpy? My goal is to build a route event using the start ...
0
votes
1answer
104 views

Copy shapefile to SDE feature class using arcpy

Is it possible to copy shapefiles to SDE geodatabases using ArcPy? I have tried using Copy_management, but it says that it cannot copy between different workspaces. Is there a different function that ...
1
vote
1answer
105 views

Check fields data type before insertion to table

I am trying to insert a python list of tuples to arcgis table. there is type mismatch which is obvious. Each Value in tuples have different type and fields in table have different data types. So, ...
2
votes
1answer
78 views

Calculate Row if Row Value Equals Value in List

I have a folder of photos named with a building ID that corresponds to a building ID in a building footprints feature class. Not all rows in the footprints feature class have a corresponding photo. ...
1
vote
1answer
43 views

How do I batch input alias names from a table for a large dataset in ArcMap or ArcCatalog?

I would like to populate the alias names for the fields in the ACS 2014 5 year estimates file geodatabase (all 11439 of them). The ACS fgdb comes with the short_name and long_name in the metadata ...
0
votes
3answers
130 views

How do I go from the WKT results of Calculate UTM Zone (Cartography) to a spatial reference object?

Calculate UTM Zone (Cartography) assigns a UTM zone to each feature within a feature class as a field value. The value returned is a 'UTM spatial reference string', which is a long string that looks ...
2
votes
1answer
86 views

Convert feature class names to lower case?

I'm simply trying to loop through the first immediate set of folders in a directory, then the GDB's, and finally the feature classes, however, now I get "ERROR 000840: The value is not a Data Element. ...
0
votes
0answers
64 views

Creating a point file with python from a pdf file

I have a 1500 pdf document that I need to extract latitude and longitude coordinates from. The Lat and long are formatted as one attribute so they need to be split plus there are a few other columns. ...
3
votes
1answer
293 views

How do I figure out the length of polyline features in a feature class with a WGS 1984 coordinate system?

I'm trying to figure out lengths of polyline features in a feature class with a WGS 1984 coordinate system. Here's code to list lengths: >>> import arcpy >>> inFc = ...
0
votes
0answers
29 views

Create individual feature classes for every record in a single feature class [duplicate]

I have arc desktop 10.3. I have a feature class (nycd) with 59 records in it. I'm trying to create a simple map with an inset that shows where each community district is located in that borough. I'd ...
0
votes
0answers
20 views

What is the default mosaic_method value for MakeMosaicLayer_management?

What is the default mosaic_method for MakeMosaicLayer_management (see help here)? Usually, the docs say This is the default after the default value. And that is usually first option listed. Is the ...
3
votes
1answer
99 views

Creating python script to split selected lines at a set length

I have been having trouble trying to come up with a python script that will go through a polyline feature class representing a river system and split all the streams intersecting with a central river ...
3
votes
1answer
152 views

Why does arcpy.ListFeatureClasses() take so incredibly long?

I'm having an issue where calling arcpy.ListFeatureClasses() in a workspace with 400 shapefiles takes a very long time (more than 10 minutes). Using the os module to achieve the same effect takes ...
1
vote
0answers
46 views

How do you use the setErrorMessage(message:string) within the ToolValidator Class?

The Programming ToolValidor Class ArcGIS Help menu states that: the following method: setErrorMessage(message:string) "Marks the parameter as having an error (a red X) with the supplied message. Tools ...
3
votes
1answer
339 views

Converting large rasters to NumPy

I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large, in some cases up to 3GB per raster dataset. I ...
0
votes
1answer
45 views

arcpy.da.SearchCursor, cannot read preceding zeros from csv

I'm using arcpy.da.SearchCursor to read a csv that has a column with preceding zeros, e.g.: myCSVColumn 0124578 12598 04589 012568 ... When using the arcpy.da.SearchCursor it returns the value w/o ...
3
votes
1answer
32 views

Set up tool to only accept the name of a specific feature class?

I'd like the red x to show in the corner of the tool if they try to load the wrong feature class. That way we can prevent possible errors with the output. I've tried using the error messages arcpy ...
2
votes
2answers
404 views

Copying features from 'in_memory' to 'in_memory' using ArcPy?

I came across this post and found out about Copy_management(). Is it possible to copy an in_memory feature to another in_memory feature? I tried to test it using the following code, which fails: ...
0
votes
1answer
175 views

Debugging RuntimeError: Object: Error in getting parameter as text from arcpy.GetParameterAsText()?

I am trying to get this tool I've been writing for the past month operational. I think it should all work, but I'm getting caught up on the parameters of the code. Here is the start of the code that ...
0
votes
1answer
81 views

Making multiple fields NULL using Python in ArcGIS?

I have a repetitive task here at work. It requires that I make multiple fields NULL as I update the geodatabase. Is there a script I can write that I can input the fields and the feature class. Then ...
1
vote
1answer
300 views

Select from a list of string variables in a custom Python ArcGIS tool?

I've made a few Python tools for ArcGIS lately and haven't had to use this idea in my tools until now. I am making a looong tool that will deal with 13 different districts worth of data. I want the ...
0
votes
0answers
44 views

python (arcpy) command for Construct Polygons

I am looking for a python (arcpy) command for Construct Polygons. I am unable to find it in Esri help. So Is there a python command for Construct Polygon that I may have missed? OR Is there an ...
1
vote
2answers
120 views

How do I generate an image of each polygon in a shape file? [closed]

I have shapefiles containing areas (states, counties, bodies of water, etc.) and need to generate an image (png / jpg) of each area. How can I do this? In my mind, the manual workflow would be: ...
1
vote
0answers
142 views

Speeding up ArcGIS arcpy.Merge_management for MANY files? [closed]

I'm currently running a script that is using the arcpy.Merge_management function to merge roughly ~1500 shapefiles together. When I tried this with much smaller test runs, it ran perfectly. Now ...
2
votes
1answer
121 views

Creating subfolders in ArcPy's 'in_memory'

Is there a way to create a subfolder in memory in ArcPy? For example, instead of temporarily saving a dataset under: r'in_memory/bufferOne' I would like to save it under: ...
0
votes
1answer
129 views

how to update values from python list into feature class

I have a feature class and python list. Feature class has 80 fields and 500 records. List also has 80 sub-list and 500 elements in each. So basically they are same dimension so to say. I want to ...
1
vote
1answer
78 views

Access ArcGIS Server directories in geoprocessing service

I would like to save a file in the output folder on the ArcGIS Server and then provide a link for the user so he can download it. I have two problems: I can't figure out how to access the output ...
4
votes
1answer
180 views

How to access the feature extent of a feature class using arcpy?

How can i access to feature extent of a feature class and change the extent using arcpy ?
0
votes
0answers
42 views

Achieving consistent RGB Composite Settings using ArcPy?

Does anyone know if there is an arcpy tool so that when I bring in raster imagery (Specifically Landsat) into ArcMap it will automatically adjust the settings of the RGB composite? I know under ...
3
votes
1answer
218 views

Creating a ValueTable with a column that has dependency

I am creating a python tool which looks like the figure below. Input feature: It asks for a input feature class. Valuetable(Lookup tables): It has two columns - one for look up tables and another ...
1
vote
2answers
210 views

Python Installation and accessing Arcpy Libraries without ArcGIS Setup Installer?

As part of developing scripts and to save the other services/resources accessed by ArcGIS, is there a way or separate installer to install Python and ArcPy libraries alone without installing ArcMap?
0
votes
1answer
41 views

Identify polygons greater than n-th percentile and perform further analyses using arcpy

My goal is to identify tracts that are above the 99 percentile of a variable (xvar), to dissolve contiguous tracts by summing a variable (yvar), and to get the coordinates of the centroids ...
0
votes
2answers
44 views

Turning code into a script and parameterizing?

I have python code that I want to turn into a script. I want the end user to be able to navigate to the feature class the code should be run on. The code I have currently speaks to a specific ...
4
votes
2answers
200 views

Shapefile Naming conventions in ArcPy?

I have shapefile named `band-tailed_pigeon.shp which is fine and no problem on displaying or geoprocessing on Desktop but in ArcPy when I try to merge some layes to it I am getting this error ...
0
votes
2answers
155 views

Dynamically creating lyr file in ArcPy (for use with group layer)?

I'm trying to create an mxd that can dynamically create and name group layers, and populate them with various feature layers. I've seen some examples of how to do this, such as : Creating empty group ...
0
votes
2answers
87 views

ArcGIS add attribute table to PointGeometry using arcpy

I'm trying to add an attribute value to a new PointGeometry before I write it into the new file. How do I do that with arcpy? Let's say in this example I want to write the ID of the line feature into ...
1
vote
1answer
41 views

Issue on Removing Index From Field by Arcpy

Using ArcGIS 10.2 Desktop, I am trying to remove an attribute index from my shapefile (marten.shp) as: import arcpy from arcpy import env env.workspace = "D:\\Map\\Data" ...
2
votes
3answers
85 views

Finiding Duplicate in buffer distance?

i am desperately looking for solution for one problem. i am having one Point Shape file, i need to check that if there is any duplicate point nearby(lets say 10 meter). i am not familiar with ...
2
votes
4answers
138 views

Select polygons one by one and export them using arcpy

I have a shapefile that contains 200+ metropolitan cities. In each city, there are some tract polygons. The dbf table looks like: tract city xvar 1 0040 20 2 0040 12 3 0040 ...
2
votes
1answer
251 views

Debugging ERROR 000725: Output Dataset: Dataset … already exists?

Using ArcGIS 10.2 Desktop I am trying to run a Merge function by Arcpy as # Set environment settings env.workspace = "E:\\GIS\\ROR" path = "E:\\GIS\\Data\\" featureClass = "band-tailed_pigeon.shp" ...
1
vote
1answer
119 views

How to use da.UpdateCursor with dictionary?

I'm working through some da.UpdateCursor scripts to make updates to a fgdb. Although the script below works successfully, I want to use the dictionary that I have created rather than the manual [ ] ...
2
votes
1answer
78 views

Expanding raster extent with ArcPy?

How can i expand extent of a raster image with Python as the image shown in below. I have the coordinate information of a raster image such as Xmin Ymin Xmax Ymax,how can i expand its extent based on ...
3
votes
1answer
243 views

Using Square brackets in ArcPy update cursor?

I am looking for guidance regrading the usage or meaning of the square brackets in arcpy update cursor (Win 7, ArcGIS 10.2, Python 2.7.5) Although I have serched long and hard with various web ...
1
vote
1answer
432 views

Removing ZM From Geometry Column Polygon Using ArcPy?

Using ArcGIS 10.2 for Desktop, I have some Shapefiles which I have no idea why their Geometry column (shape) contain ZM! now I need to remove all those ZM and get a clean polygon instead. I thought I ...
2
votes
2answers
146 views

Calculating geometry for feature class with x/y and Lat/Long values in different projections?

I have a feature class with x/y values populated on the native projection of the feature class (state plane). In the same feature class I also have Lat/Long fields that I need to populate (WGS 84 in ...
1
vote
1answer
271 views

Change Field Type using Field Mapping for List of Tables using Python

I have a collection of about 200 tables, and I would like to make sure that all the fields are text before merging them into a single table using python. There is at least one field ("Number_of") ...
1
vote
1answer
166 views

How to publish python toolbox with lots of tools in ArcGIS Server 10.3?

I have python toolbox with like 40 tools and I need a quick way to publish the whole toolbox. I found some instructions in the documentation, they state that every tool should be executed and their ...