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

learn more… | top users | synonyms (8)

2
votes
2answers
275 views

Trace Geometric Network won't execute in custom script tool

I'm trying to make a Python script tool which uses the Trace Geometric Network tool (10.3). My script works in the Python window, but as a script-tool, it runs and NOTHING HAPPENS. Messages state: ...
7
votes
3answers
461 views

Performing Feature to Point (no advanced license) using ArcPy?

I have a set of polygons I have calculated the centroids of, but am having trouble finding a way to output these values to a point shapefile. I dabbled with arcpy.MakeXYEvents_management, but it only ...
1
vote
1answer
74 views

Error when writing polygon feature

I have created this array: array = ([arcpy.Point(-103.85769159, 32.181106371), arcpy.Point(-103.85769159, 32.182755629), arcpy.Point(-103.85575241, 32.182755629), arcpy.Point(-103.85575241, 32....
0
votes
2answers
132 views

Using Python Search Cursor results to Select Features by Attributes

I would like to preface this by saying that I am very new to python and its capabilities. So my problem is that while using the in_memory work space I encountered some limitations in querying the ...
2
votes
3answers
61 views

Stacking multiple selected points in ArcGIS

I would like to find a way to stack multiple selected points in ArcGIS, either using the field calculator or python script. For example, I want to snap all points representing houses on a street into ...
0
votes
0answers
44 views

return _NumPyArrayToRaster(*args, **kwargs) ValueError

I am trying to make an array to raster from the defined array below. However, I keep getting this error: return _NumPyArrayToRaster(*args, **kwargs)ValueError: Argument in_array: A two or three ...
1
vote
1answer
54 views

extracting time information from arcpy.da.searchcursor and Tuples

So I have a feature class in a GDB that contains time data that I wish to carry out calculations through arcpy. This data was entered from a string to a datetime format into the featureclass through a ...
0
votes
3answers
194 views

Get the first and second row with searchcursor

I have a shapefile with only 4 rows in it. I already could filter it so I have only 2 left. I need these sorted by the 'length' field, then take the first and second row to save in to individual files....
1
vote
1answer
36 views

Converting tuple into records in blank feature class using ArcPy?

Here is the code block that I am using with ArcGIS 10.2 for Desktop, it all works great except for the bottom part. I am not sure how to turn the tuple into records on a blank feature class. The tuple ...
2
votes
2answers
57 views

Delete records in feature class that have same ID in CSV table using arcpy cursors

So I have a csv table with records that have an ID. I want to find the same IDs in a feature class/shapefile and delete those records in the feature class/shapefile using Python. I've messed with ...
0
votes
1answer
52 views

Is there a way to turn a data frame off in ArcMap 10.2?

I have an mxd with three data frames. I've written a python script that loops through a list of user-specified coordinates and scales for each data frame before exporting the mxd as a pdf. Is there a ...
0
votes
0answers
50 views

Trying to print classLables in symbology type UNIQUE VALUES

I have a classified image of 10 classes stacked together. Once I put them into ArcMap they don't appear as 10 individual classes, they look like one big class. When I click on unique values the ...
1
vote
0answers
116 views

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.ndarray'

I am trying to insert a value for different group of percentile eg (0- 10 percentitle) value = 1. I saw an example over here and went to try it out How do I Calculate Grouped Percentiles or Batch ...
0
votes
1answer
84 views

Return FeatureLayer in geoprocessing REST service

I have created a Python Script Tool that returns a FeatureLayer using the following two lines of code: arcpy.MakeFeatureLayer_management(scratch_fc, "GeocodedZIPsLayer") arcpy.SetParameterAsText(1, "...
8
votes
1answer
187 views

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames?

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames? The reason I ask is that I am stuck when trying to do the following: Start ArcGIS Pro 1.1.1 Create a new project - I ...
1
vote
2answers
257 views

Error while Geoprocessing with Geometry Objects

I'm trying to use the distanceTo() mehtod to return the distance between the centroid of a polygon and a line, but I keep getting this error: "AttributeError: 'Point' object has no attribute '...
2
votes
0answers
92 views

arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data failed

I am working on PuTTY and trying to create service definition file in server. My Python script is creating .sddraft but I am receiving 'Consolidating the data failed' error when I run stage service ...
3
votes
4answers
663 views

Get Parameter as Text and select layer by attribute

I have written a python script tool wherein a user specifies a feature class (e.g., Landuse) containing different attributes (e.g., parcel size, landcover etc.), name of the attribute field from which ...
-1
votes
1answer
46 views

raster calculator (spatial analyst) tool not working in arcpy [duplicate]

I am using arcpy and while running the script it is unable to find RasterCalculator() method? Even after imporiting arpy module >>> RasterCalculator("IDSI_2002.img + IDSI_2007.img","D:/...
3
votes
1answer
87 views

Choosing and zooming to features using SQL query in ArcPy with ArcGIS Pro?

When using ArcPy with the ArcGIS 10.x architecture there is a simple coding pattern that I find I use frequently: import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping....
1
vote
0answers
65 views

How to select specific rows in attributes table by using ArcPy? [closed]

With the zonal statistics as table I made a "park_dem.dbf" file which shows in 28 rows the name of polygon and also several information about the (max-min-range-area) so my question is, have can I ...
1
vote
1answer
54 views

Select points situated on zero degree slope

I need to choose points from SHP file, which are positioned on raster cells with 0 degree slope. Creating a slope raster from DME is not a problem, but I don’t know how to write a script that chooses ...
3
votes
2answers
81 views

Select point(s) from given coordinate and move to new coordinate using arcpy

Goal: Move address points to their correct location. Plan: I have a layer of AddressPoints of which some need moved to a new location. I want to take a line layer (called ...
0
votes
0answers
23 views

Selection Based on Range of Values from another table

I'll try to explain this is as simply as possible. I've figured out how to create this table in SQL, no problem. But I'd like to have this done in python as part of a larger model. I have a feature ...
0
votes
1answer
65 views

python code multirasters zonal statistics

env.workspace = "C:\Users\\Documents\pythonMODIS\extract" # Set local variables inZoneData = "mask.shp" zoneField = "Classes" inValueRaster = "mi1511171_clip.tif" outTable = "zonalstattblout02.dbf" ...
1
vote
2answers
45 views

Inputs for building composite address locator from address locators created in for loop of Python script tool?

I'm building a script tool that creates up to 3 address locators and then uses the output address locators as inputs to the final output composite address locator. The tool executed perfectly prior to ...
0
votes
0answers
33 views

Is it possible to create TIN layer and add to Data frame?

I have list of TIN. I basically want to add TIN using arcpy.mapping so that when I open .mxd, TIN is added. tin_list = arcpy.ListDatasets('', 'Tin') for tin in tin_list: arcpy....
0
votes
1answer
84 views

How to append Extent object to existing dictionary key values?

I have a dictionary whose keys are map segment names, and whose value is a list of 3 field values. Using an arcpy.da.SearchCursor on the map segments FeatureLayer, I have extracted the extent object ...
2
votes
2answers
117 views

Formatting SQL expression for calculate field (management) tool?

I am trying to take the population census tract and calculate the percentage of population by each census tract in the field (Populati_2). To do this I'm creating a new field with the total sum of the ...
0
votes
0answers
39 views

Creating an .mxd Thumbnail JPEG

After creating a Map Document Object and calling the .makeThumbnail() method, how do i create and save a JPEG of the Thumbnail image i just created?
0
votes
2answers
79 views

Python select by attributes, location, copy features [closed]

Python script is failing. It's supposed to make a selection from a lyer based on attributes value and then select intersecting features of that selection and then make a copy of the selection as a new ...
0
votes
1answer
77 views

Output Feature Class empty after trying to display it on map using arcpy.mapping?

I am trying display the output of my script on an mxd once it is created. To do this, i created a function at the end of my class that handles all mapping. I have tested the code up until the ...
3
votes
2answers
135 views

Optimizing arcpy.da.Walk performance?

I'm trying to automate a workflow that currently costs a co-worker about 45 minutes. General run down is this person copies files from a network drive onto a local one, and process it through four ...
2
votes
0answers
56 views

Arcpy.sa NoData issue with saving TIFF

Similar to the poster here, I am attempting to convert numerical NoData values to actual NoData cells. The solution in the linked question doesn't work for me, however, as when I use the save method ...
0
votes
1answer
63 views

Automating ArcGIS append Geoprocessing Tool [closed]

I have about 100 feature classes inside twenty feature datasets inside a geodatabase. We have about 50 individual geodatabases. I want to load all geodatabases one by one in a one single master ...
0
votes
1answer
108 views

script for auto registration

I have a large list of raster images (>600) I would like to automatically georeference to a source image. I can do this in ArcGIS 10.2 using the Auto Registration tool for each image but looking for ...
3
votes
1answer
87 views

Changing Dataframe Projection of .MXD to UTM Zone matching each polygon in ArcPy cursor?

I have a polygon shapefile. I used ArcPy scripts to: add a new field to the shapefile use Calculate UTM Zones on each polygon. It spits out UTM projection information into the field I've added. ...
1
vote
1answer
111 views

Deleting selected features with ArcPy?

I am having trouble deleting the features I have selected using 'arcpy.SelectLayerByLocation_management' tool. To use the select layer by location tool, you much pass in a .lyr file. My script ...
2
votes
1answer
63 views

Complex polyline traversing with searchcursor

I have a very specific question about searchcursor traversing complex polyline. My setup is: I imported public transport routes as a single polyline with length in meters. Along this polyline I want ...
0
votes
0answers
35 views

ArcPy FeatureCompare vs. FileCmp

I have a huge number of shape files that I receive on a recurring basis. I want to be able to compare the new version to the current version, and then only update the db with those that are different. ...
0
votes
1answer
53 views

Cell Statistics failing to read rasters in list

Heyo. I'm trying to get the rasters from a list (about 32 rasters) and then sum them up with CellStatistics in arcpy. I'm using Python 2.7.8 and ArcGIS 10.3.1 I got it to work the first time around ...
0
votes
2answers
104 views

Migrating ArcGIS for Desktop script to ArcGIS Pro? [closed]

Recently I've been considering switching my department over to ArcGIS Pro in an effort to stay ahead in the ever-advancing world of GIS software. Currently we run ArcGIS 10.3, and have many daily ...
0
votes
2answers
35 views

update cursor based on location

I'm working on a python script for ArcGIS 10.2/10.3. What I want is to automatically fill in a field of a point layer based on the location of that point in relation to a polygon layer. Say I have a ...
1
vote
0answers
46 views

Using arcpy.Geometry() and attribute table?

I have Polygon layer (*.shp) and I need to calculate shortest distance between every polygon's and save it into a txt file with ID (it is in attribute table) for every polygon. example of txt file - ...
1
vote
1answer
149 views

Using arcpy.GetParametersAsText() into Text file? [closed]

I've just started using Python for ArcMap. I'm trying out a script that works before I put arcpy.GetParameterAsText(0) into it. Does anybody know what I'm doing wrong? (I put the parameters on the ...
0
votes
0answers
18 views

Nested Set Model for Spatial Data?

How can I create a nested set model for a spatial line dataset? The nested set model is a technique for respresenting hirarchies of a tree (see https://en.wikipedia.org/wiki/Nested_set_model). If ...
0
votes
1answer
60 views

How to export joined feature classes without losing field name?

I want to export a feature class uisng arcpy that join with other feature class.I use the below code to join and export feature class. The problem is that field names of the result feature class have ...
0
votes
2answers
76 views

How to edit the capabilities with python when publishing map services

Publishing map service the normal way is done here using arcgis desktop. But I decided to do it with python so I can automate the process or something like that but first off I need to edit some of ...
2
votes
1answer
156 views

How to set up geoprocessing tool and geoprocessing service to produce downloadable output in Web AppBuilder

I want to create a simple application in ArcGIS Web AppBuilder which uses geoprocessing service to generate output file. I have a simple Python script which generate a TIFF image from a complex map ...
1
vote
1answer
75 views

Set up definition query with variable

I am writing a script which supposed to get a value for a field from user and use that value for a definition query. If I write it without variable, it works: my_Layer.definitionQuery = "...