A site-package created by Esri to expose ArcObjects to Python.
4
votes
1answer
38 views
Finding duplicate records in a field via Python in field calculator
im looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates.
I would ...
2
votes
1answer
28 views
How to re-arrange attributes of a polygon based on attributes of polyline file?
I have a polyline (subrivers) and polygon (subshed) shapefile with both of them are shown along with tables.
Their FID index don't overlap spatially, e.g. surivers second row attribute doesn't ...
1
vote
1answer
33 views
Why does copying ArcSDE datasets and features in Python give ERROR 000732 & 000735?
Go easy, I'm new to python
I keep getting a kick back that says this:
ERROR 000732: Output Geodatabase: Dataset
Supporting_ND.DBO.Environmental does not exist or is not supported
ERROR ...
7
votes
1answer
42 views
How to determine if point is surrounded using raster processing?
I am attempting to improve a currently extremely cumbersome vector/python process for a natural hazard model. At the moment we have a lengthy script which generates distance/bearing lines from a given ...
5
votes
1answer
33 views
How to select specific row in attribute table using ArcPy (without iterating through whole table)?
I am using ArcGIS 10.2 and have assumed until now that it is possible to select a specific row in an attribute table. However, I can't seem to find a way to do this. The only available methods seem to ...
0
votes
0answers
26 views
recording pixel value with Python script in ArcGIS 10.x
A scripting newbie question...
I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
2
votes
1answer
53 views
Generating a multivalue choice list in ArcGIS using Validation [Not availalbe for Standard License]
I'm trying to adapt a model and script combination found on ESRI's blog site titled
'Generating a multivalue choice list'.
However, I've concluded that part of the validation used in the embedded ...
2
votes
2answers
41 views
Python Def Query Help for multiple layers
I have Three layers in a .mxd, all three layers have a common value I can use, but a different Label in each Layer.
As an example, the Value I want to use is "100"
In Layer A, the Value is in [Name]
...
1
vote
2answers
40 views
Copy rasters slow, increases file size
I have a folder with ~1200 aerial photos in both jp2 and tif format, of which I need about 380. I wrote a python script to get the names of the files I need, which works fine. But when the script ...
1
vote
2answers
37 views
How to programmatically change raster symbology after reclassification?
I have created a code in Python that I will use for a custom tool in ArcGIS, the code will create a Eucledian Distance of 6000m around a point and Reclassify the distance from 0-2000, 2000-4000, ...
3
votes
1answer
46 views
Can folder connection in ArcMap Catalog window be added using python?
I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
3
votes
1answer
33 views
Creating a polyline from point data that represents multiple linear features in ArcGIS 10.0
I have a problem where I have to somewhow create a polyline feature class in ArcGIS 10.0 from points that were collected in the field using a Trimble GeoXT that represent the start and end of multiple ...
2
votes
1answer
20 views
How to define a Feature Set parameter for an ArcGIS python toolbox tool?
I'm trying to create an ArcGIS python toolbox tool which use a polygon for input. I want the user to be able to create the polygon when the tool is run.
I know how to do this using both a ...
1
vote
1answer
35 views
How to get sum of table column values into Python variable?
Im creating a script to calculate some new fields in Arcgis10.1 using the arcpy library. I need to sum the total of a table column in order to calculate a new field. I wanted to ask if it is possible ...
0
votes
1answer
47 views
Best way to use arcpy.GetParameterAsText() or arcpy.GetParameter() to pass a datetime.timedelta to a script?
I have a function that takes a datetime.timedelta as an argument in a script that I want to use in ModelBuilder. I don't see an option for that as a parameter type, so for now I have a solution that ...
2
votes
1answer
25 views
How to get Network Analyst data from script file back into Model Builder?
I am running a script which takes some input parameters and runs some Network Analyst processes. The script is imported into a toolbox and is setup in Model Builder with the necessary input and output ...
0
votes
0answers
20 views
Why Add Join does not work in ArcMap and Arcpy?
I have problem with joining feature class with table from the same location (GDB) using Python script.
When I use join Join and Relates -> Join... in ArcMap TOC it does not work because I do not get ...
3
votes
1answer
75 views
How to calculate angle of polyline at its midpoint using Python/ArcPy?
Trying to calculate the angle of a line at its mid point using python; this will be used to display flow direction on a water network.
I've developed this script, which works in terms of generating ...
3
votes
1answer
43 views
How to Create Feature Layers and Search by Location for all Feature Classes in Geodatabase?
I'm very new to python, but I'm having trouble finding the answer on my own.
I need to loop through a given file geodatabase, select any features that intersect a project polygon and then search the ...
2
votes
2answers
54 views
How to merge dbf files in Python or arcpy?
I have over one hundred dbf files to merge. Each of files have two columns: ID and another field which differs from one file to another. I want to merge those fields based on ID such that each raw ...
0
votes
1answer
15 views
How to use the local macro to do ZonalStatisticsAsTable in batch
I have a series of files named as 'rawfile200101', 'rawfiles200102',...,'rawfile201104'. I want to do ZonalStatisticsAsTable for each of them with names corresponding to the time of the raw files, ...
2
votes
1answer
71 views
How to convert arcpy.InsertCursor to arcpy.da.InsertCursor in Python code?
I have some working code using arcpy.InsertCursor which I want to convert to arcpy.da.InsertCursor. This I want to do primarily as ESRI claims that da methods are more optimized. The code I have is ...
2
votes
1answer
36 views
ArcPy: Drop fields from list of fields for arcpy.da.SearchCursor
I have a feature class with several fields in the attribute table, and I want to export a few but not all of those fields out to a tab delimited text file. The code below sort of works, half of the ...
2
votes
1answer
36 views
Create lines from points arcpy
I have a points shapefile, and a file that tells me which of the points have a line between them. I am using arcpy to create a new shapefile to hold the lines and then create the lines based on the ...
5
votes
1answer
62 views
Is there a way to find out which pixel values are around the current pixel?
I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on.
Is there in arcpy such a function ...
1
vote
0answers
28 views
Is there a way to test if a feature class is registered with geodatabase?
I've got feature classes inside an Oracle 11g ArcSDE geodatabase.
I'd like to perform the arcpy method RegisterWithGeodatabase_management on all those feature classes.
But before that, I'd like to ...
2
votes
1answer
22 views
GDS Workspace Path resovles as owner not user
I am having trouble retrieving the correct path to the current map layer dataSource path. I am using ArcGIS Desktop 10.2 (10.2.0.3348)
The workspace path that gets returned is correct apart from the ...
0
votes
1answer
52 views
How do I edit a Direct Connection Workspace using arcpy.da.Editor?
How to start editor to edit version data for ArcGIS 10.1 direct connection. I tried as given below code but it is throwing an error "Operation only allowed by the owner of the version [SDE.DEFAULT]". ...
4
votes
1answer
61 views
end execution of script and send email if schema has changed
I would like to append the data from one feature class to another after confirming that the schemas match in both feature classes.
I can append the data from one FC to another by using this simple ...
-3
votes
2answers
62 views
How to get layer extension info via Arcpy
I want to get file format of a layer with using Arcpy. I am writing a tool that needs to take raster or feature extension like SHP, TIFF etc. Which functions should i use ?
Note: I use ArcGIS 10
2
votes
1answer
80 views
arcpy FieldMappings for Spatial Join
I'm trying to create a python script tool to use within ArcMap 10.1. I created a Model and exported it as a python script and added custom field mappings for the first Spatial Join by reading through ...
2
votes
1answer
25 views
How to copy values from field to another using arcpy?
Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy?
I have found lots os example on web which they all used extra expression and they were ...
0
votes
1answer
21 views
How to delete Field From Shapefile by Arcpy [closed]
I am using the following code to delete a field from a shapefile but I am getting an error!
def main():
# Import arcpy module
import arcpy
# Local variables:
point_shp = ...
0
votes
1answer
31 views
How to Add Field Between Two Existing Field in Shapefile
Can you please let me know if it is possible to add a new Field between two existing field using ArcPy?
For Example if I have "Name", "Area", fiels already in my shapefile can I add a new field called ...
4
votes
1answer
71 views
Issue on using Pyscripter with ArcGIS 10.2
Can someone please let me know how I can set the Pyscripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS?
what I did was:
1- I installed the ArcGIS 10.2
2- I installed Pyscripter ...
4
votes
1answer
78 views
Is it possible to store a default symbology layer in an arcpy add-in?
Since arcpy is limited in how symbology can be manipulated, I was curious to know if a symbology layer can be stored in an arcpy add-in. Does anyone know if it is possible to store a .lyr file, or ...
2
votes
1answer
29 views
How to specify units when using SelectLayerbyLocation_management WITHIN_A_DISTANCE?
Can anyone help by suggesting how to specify the units when using the SelectLayerbyLocation_management tool. I am selecting by "WITHIN_A_DISTANCE" and the ArcGIS resources do not suggest how to do ...
6
votes
1answer
46 views
Is setting the env.workspace var necessary for python add-in buttons in ArcMap?
I made a custom add-in for ArcMap (10.2 in my case) and was reviewing my code with a colleague. We're not sure if the setting the workspace is required in the code since the button's script is only ...
1
vote
2answers
61 views
Fastest way to Join tables in python automation
My issue comes form the fact that doing Joins manually is actually relatively quick (5mins), but python automation of this process is 6hrs! Here is my code:
import arcpy
GDB_MARK_TO_MARK_VECTOR_VIEW ...
3
votes
3answers
85 views
How to convert Midpoint of Polyline into Point Feature using ArcPy?
I am trying to write a python script to determine flow direction on a water pipe network. I've used this script to find the mid point along each polyline, now i need to convert this data into a point ...
2
votes
2answers
59 views
How to determine stream channel Reach locations?
I have a stream network and want to determine stream reach locations
In attached figure, Reach 4 is at the junction of sub2 and sub5, and Reach 3 is at the junction of sub1 and sub4. Any suggestions ...
0
votes
1answer
64 views
NameError: name 'Con' is not defined
I have 365 rasters with the same extent, and I am trying to sum them together by month. I have the script below, which was working until I added the line out1 = Con(IsNull(raster), 0, raster) which is ...
1
vote
1answer
83 views
Insert Cursor fails to write results to table
Insert Cursor fails to write results to table. The Search Cursor is returning the results, but errors when trying to insert into field.
# Insert Cursor for GDB table to GDB table
# Import modules, ...
2
votes
1answer
47 views
Why cant I use SelectLayerByAttribute_management while a cursor is set
I've been having a problem with arcpy in that the simple line:
arcpy.SelectLayerByAttribute_management ("TEMP_LINES")
produces this response: Runtime error : ERROR 000358: Invalid expression Failed ...
1
vote
0answers
54 views
Data loss after compressing geodatabase in ArcSDE
I suffer sometimes from data loss after compressing ArcSDE geodatabase, this geodatabase contains versioned feature classes, so the compressing script reconciles and compress the geodatabase:
# ...
1
vote
1answer
10 views
Why does FeatureClassToFeatureClass field mapping create shapefile with no attribute values on local machine from ArcSDE?
I have inherited taking over and supporting and ArcSDE GIS database. We have a process that we must do every 6 months to export certain features from the ArcSDE database into shape files so that they ...
2
votes
1answer
22 views
Automatic calculation in one attribute table based on values in another attribute table using python
I am trying to fill the fields of one gdb table based on some statistics over the attributes of another shape file. As it was not possible in ARCgis directly, I am trying to use python coe for this ...
1
vote
1answer
39 views
Why does ListLayoutElements give IndexError: list index out of range?
When trying to create a legend on ArcMap use the following Python/ArcPy code I received an error message:
import arcpy
mxd = arcpy.mapping.MapDocument(r"E:\cities\MyProject.mxd")
df = ...
0
votes
2answers
34 views
What causes ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute) on shapefile? [duplicate]
My script runs perfectly for feature classes, but not shapefiles. It crashes at the point of selection, provided there is a query.
gp.Workspace = "C:/someworkspace"
fc = "featureclass.shp"
query = ...
0
votes
1answer
61 views
Python problems with select by attributes and user input
I am attempting to create a tool where the user can input a census tract number within the city of Plano (there are 77 tracts) and it ultimately creates a map layout showing the population density. I ...