Tagged Questions

A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

0
votes
0answers
20 views

Python script suddenly freezes and start to consume memory

I have a Python 2.7 script that generates multiple polygons around certain polygon (see picture). The meaning is determinate the effectivity of windbreaks. I don't know if my solution for this problem ...
3
votes
0answers
26 views

SetNull in Python script for Arcgis assign 0 value

I am writing a script in Python where I assign to few Tiff defined in a function as inputRaster a NoData value as follows: whereClauseSetNull = "VALUE > 100" outSetNull = SetNull(inputRaster, ...
1
vote
0answers
11 views

Change Data Source of Raster Layer Added to Map Display? Unexpected default

I have a script that I'm using to generate raster maps and automatically add them to the map display, but when they are added they are sourced to a temporary location. I use the same code for ...
2
votes
2answers
22 views

ArcGIS 10.2 : How to prompt a “parameter window” during the execution of a script tool (or model)

I am pretty new to ArcGis and ArcPy, so I apologize if my question seems straightforward. However, I have been looking on the web for quite a while and didn't find any answer so far. I am using ArcGis ...
1
vote
1answer
51 views

ArcPy SearchCursor getValue leads to NoneType object has no attribute lstrip?

I am having a little bit of a dilemma. I am having a problem with using getValue() and striping the value that is returned. For instance, take the following code. import arcpy as ap mxd = ...
1
vote
1answer
16 views

Trouble inserting name of feature in TOC into attribute table using arcpy.calculateField

I currently have about fifty rivers and creeks in a map, and none of the features contain the name of the waterbody. However, the features are named correctly in the table of contents Ideally, I ...
1
vote
0answers
31 views

set extent for jpeg programmatically

I feel like this should be easy, but how can I set coordinates for a jpeg image using Python? I have a python add-in that draws a polygon and then uses its geometry to post a query request to a REST ...
2
votes
0answers
38 views

Bug in arcpy mapping?

Has anyone else had this problem? I have an mxd file with two layers in it, one of which is fairly 'heavy' (i.e. takes a minute or so to draw). All layers are visible by default. I have the ...
4
votes
2answers
82 views

Why does arcpy.da.SearchCursor() class not autocomplete within Eclipse?

I am very new to GIS. I just installed eclipse luna with pydev plug-in and ArcGIS 10.1 for Desktop. When I write a script, trying to import arcpy.da.SearchCursor I see that no SearchCursor is ...
2
votes
1answer
75 views

How I can do event with two clicks using python add-in wizard?

How I can do event with two clicks using python add-in wizard, I have found a way to do event with one click by adding a New Tool in the wizard, but I need "first click To copy the attributes from ...
0
votes
1answer
12 views

Problem in adding raster layer from arcpy

I am using the following code to add the raster layer using arcpy in arcmap def AddRasterLayer(path,layerName): layer=os.path.join(path,'new'+str(layerName)+'.lyr') ...
1
vote
2answers
36 views

How to change field defined as REQUIRED to NON_REQUIRED in ArcGIS Geodatabase

I have created some feature classes in a geodatabase and also some fields using this sample code: arcpy.AddField_management("schools", "ref_ID", "LONG", 9, "", "", "refcode", "NULLABLE", "REQUIRED") ...
0
votes
1answer
31 views

Tools/Software for QA/QC of data

I currently have written a few custom scripts that run basic checks (null values, geocoding errors, fullness of metadata) using Arcpy(10.2 with almost all licenses) and gdal. I'm interested to know ...
2
votes
0answers
26 views

Using arcpy.da.editor on a transactional version raising errors

I've run up against a wall trying to get an edit session to work on a version. These are the scenarios Ive gone through in the code and their error mesages: Setting up an edit session not as a ...
3
votes
1answer
25 views

ArcPy Slope Script - Trouble Saving

I have an ArcPy script that applies the slope function to raster files in ArcGIS. I tried running the script with two raster files in the table of contents, and the script runs, but only saves one ...
2
votes
0answers
32 views

ArcGIS tool validation: How to add an error message to a parameter if a seperate multivalue parameter is empty

I have three tool parameters; an input point feature class, a (multivalue) list of fields derived from the input feature class and an output file location to export to Excel. I have filtered ...
0
votes
0answers
15 views

buffering one feature class by different distance, the result is the buffer distance become same 100 feet.

try: # Import modules import arcpy from arcpy import env # Set the workspace env.workspace = r"C:\Esripresspython\GISTPython\Data\City of Oleander.gdb" # Create a variable with the name of ...
1
vote
2answers
31 views

Automating procedure to add shapefile to multiple map templates using ArcPy?

I have a project that has me create a package of about a dozen maps for a client and I do this multiple times per week. I am trying to figure out if there is a way to automate this with python. I am ...
1
vote
1answer
34 views

slow Python script pulling from an iSeries database

I've converted and updated some python scripts that exported data from an iSeries database (HTE) to Access to export the same data to a fgdb. My biggest issue is the time it's taking to export the ...
-2
votes
0answers
44 views

How to use arcpy.GetParameterAsText? [on hold]

I am using arcpy.GetParameterAsText in a script with ArcToolbox . I am new to using Python and the script is part of a pattern I want to do with ModelBuilder. The aim of this script is to make a ...
4
votes
2answers
76 views

Best way to get a bounding polygon of all features in a file .gdb

I have an arcpy script that dynamically creates a filegeodatabase and its featureclasses from uploaded spatial data, currently point and line features and possibly polygons in the future. I am ...
1
vote
1answer
37 views

ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Layer Name or Table View: Dataset L does not exist

Hi I am trying to create a loop so that each layer is produced in its own map. This is my code: import arcpy path = "C:\Users\Et\Documents\ArcGIS\Default.gdb" mxd=arcpy.mapping.MapDocument(path ...
1
vote
1answer
20 views

Wrong coordinates after Usage of NumPyArrayToRaster(…)

My Project I am currently working at should enable cellvalue manipulation on raster files using ArcPy. My Script works fine except I am not getting the right Y-Values (northing values) for the ...
3
votes
0answers
40 views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class,from point to point. TopoHeight_Field_Name='Comment' def ...
4
votes
1answer
44 views

SQL-query in arcpy - SELECT WHERE feature between two values

I need to select features between two values in python with arcpy. However, whenever I try to run the code below, it returns with error message "An invalid SQL statement was used". whereclause = ...
2
votes
0answers
56 views

Error with da.UpdateCursor and SDE feature classes

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
1answer
34 views

Arcpy PointGeometry does not carry forward the ID

I used this as starting point I have the following code: Test data data = numpy.array([(0, 51.1047664, -114.3722785, 1205, ...
0
votes
1answer
64 views

How to list attributes in a field using Python?

I'm using ArcGis 10.2.2 and I'm creating a model in ModelBuilder. I want to know how I can list the attributes of a field and then make a selection for each unique attribute using Python. I have a ...
3
votes
1answer
102 views

ArcGIS 10. Convert dbf to csv or similar in ArcPy without cursors

I have many dbf's created by the Spatial Analyst Sample tool. I would like to convert those dbf's into csv's or space delimited (or any text for that matter). I can't seem to find the ArcPy equivalent ...
2
votes
1answer
63 views

How to use the tool “Polygon to Raster” with arcpy when the polygon is a row from a Shapefile?

I tried to iterate over the rows from a Shapefile with the search cursor. Every row is a polygon and I want to make a raster out of this polygon so I tried this with arcpy.PolygonToRaster_conversion. ...
2
votes
0answers
24 views

A list of layer names that you want to be turned off when Layers name are in Right to Left Such as persian

When I ran this code I got "UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal" error I don't know why I tried many way but I ...
1
vote
2answers
32 views

How to read page size from a MapDocument object

I hope this isn't a duplicate question, I have had a look but couldn't find an answer. I have a set of 30 MXD's with different page size. I would like to export maps with their name file which include ...
3
votes
1answer
21 views

Clearing data frame projection of current mxd using ArcPy?

I am required to open a bunch (50 per week) of mxd's and 'Clear' the Coordinate system from the data-frame to make sure my students have all of their data projected in the same (correct) Coordinate ...
1
vote
2answers
35 views

Specify a GDB feature class using Python Tkinter dialogue box

I tried to specify a feature class from a GDB dataset through Python Tkinter tkFileDialog.askopenfilename. Below is the script. It worked for me in the past when I was dealing with .txt or .las files. ...
0
votes
1answer
27 views

Error Applying Symbology to Shapefiles

I'm trying to apply symbology to my dataset after it is populated to the map display, but I am getting the following error. Have I placed the ApplySymbologyFromLayer code incorrectly? Traceback ...
0
votes
2answers
23 views

Con function loop doesn't calculate for all the fifty rasters in a list

I have been trying this for hours and I know it should be easy but I can't make it work yet. I have a list of 50 rasters that I need to change the NoData to "0" values. I have the right arcpy ...
1
vote
1answer
17 views

Add Layers to Map Display from script with default symbology

I have a script that runs IDW iterations and I'd like for the files to be automatically added to the map display after they are produced and contain the default symbology that ArcMap generates when ...
0
votes
1answer
31 views

Convert python from arcpy.da.SearchCursor to work in 10.0

I am using code such as for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): # create inner buffer polyBuff = row[0].buffer(buffNum * -1) # create hull rectangle to ...
1
vote
0answers
45 views

Mosaic many rasters in ArcGIS is slow

I am trying to merge 166 tiles into a single world raster (500 meters resolution) through ArcGis "Mosaic to new raster" tool with a simple Python script. The process seems incredibly slow. Before ...
2
votes
1answer
33 views

Clip_Management seems to delete shapefile?

We have some python code that clips a very large shapefile for further processing. We can see the process create all the output files, but then just as the process is finishing, they get deleted. ...
4
votes
2answers
39 views

How to get arcpy to work with Anaconda?

I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth, in ...
1
vote
0answers
42 views

Combining duplicate points while preserving their associated attributes

I'm working with building routes for a lit of technician's stops. In some cases, they have two "stops" at the same customer location -- turning on two types of service at a house, for example, is ...
0
votes
1answer
41 views

How to copy layers between MXD's with arcpy?

In ArcGIS I need to being able to have a couple of MXD documents open and copy-paste groups of layers from one MXD's table of contents to another with python script. Is this possible and, if so, how? ...
1
vote
0answers
23 views

Field mapping for append crashes python

I am trying to append multiple feature classes to a new one. As they come from different sources, the fields are all different, so I have to map the fields of the input feature classes to the fields ...
1
vote
1answer
29 views

Multivalue input from a chosen field gives patchy inputs strings

I made a small tool that can be run from a toolbox. It has a validation code to choose multiple values from a specified field from a specified feature layer. It looks quite ordinary: The validation ...
0
votes
2answers
58 views

Same python code works in arcgis python window, but fails in pyScripter

This code works in the arcgis python window but in PyScripter, this warning message had been written: Traceback (most recent call last): File "", line 16, in File "C:\Program Files ...
1
vote
1answer
35 views

Arcpy ListFeatureClasses in same workspace differs when run from ArcMap VS IDLE

This Works The following python script works when connecting to my dev ArcGIS server, from both the ArcMap python window and the IDLE python GUI/shell running on my dev workstation: import arcpy ...
0
votes
1answer
52 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
2
votes
1answer
40 views

Trying to preserve attributes using SearchCursor

I am writing a python script for ArcGIS. I'm fairly new to this so I hope I'm not missing something very obvious. I am having trouble preserving the attributes of a polyline feature class when ...
3
votes
0answers
50 views

Most efficient way to intersect overlapping polylines

I have 4 multipart polyline shapefiles (download a sample dataset here). The geometries are identical, except for the length of segments in each shapefile. They represent 4 variables describing an ...