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

learn more… | top users | synonyms (7)

1
vote
1answer
63 views

arcpy and ArcGIS Pro: update Z values of a pointMZ geometry

I am trying to "reverse" the values of Z in a pointMZ geometry with arcpy.da.UpdateCursor. Anyway, I am not able to find a way to achieve this, although my script seems to work (no errors, printing ...
1
vote
1answer
108 views

Open popup dialog window on button click in Python AddIn?

I'm trying to figure out a way to display an image in a dialog box that will be used for a help menu for my toolbar addins. The best scenario i've found is using the pythonaddins module and the ...
0
votes
2answers
55 views

How to get the specified point coordinates of a Polyline

lines_cursor = arcpy.da.UpdateCursor(lines,["From_id","To_id","SHAPE@"]) for lines_row in lines_cursor: from_id = lines_row[0] to_id = lines_row[1] if from_id in points_dict.keys(): ...
0
votes
1answer
57 views

Add mxd path to csv by Python

I'm trying to write a python script that adds to a csv file the date, time and mxd path. I tried to run the script from the Python IDLE without the mxd path and I succeeded to add the date and the ...
1
vote
1answer
70 views

Export PDF from a folder having multiple single mxd and mxd's having data driven pages

I have folder having multiple single mxd and mxd's having data driven pages. I am trying to get the pdf's of each of these MXD's.if mxd's has a data driven pages then all the pages from a same mxd ...
0
votes
0answers
12 views

Converting RGB values from CSV to ArcMap Save As Layer File? [duplicate]

I would like to Convert RGB values from a CSV to a ArcMAP save as a layer file. I have a csv file with 4 columns. First column shows Depth in feet and second, third, Fourth column shows that RGB ...
2
votes
1answer
51 views

Trying to understand updateCursor() for python

I am using ArcMap 10.2.2. I am attempting to write a script that will cycle through the classes in a database and change the attribution of 1 row. Is my variable "lyr" being recognized as the classes ...
1
vote
1answer
65 views

Selecting group layer using arcpy.GetParameterAsText()?

I have a script that allows me apply a single SQL Definition Query to all feature classes within a particular Group Layer. For ease of input for others in the office, I changed this into a model ...
0
votes
1answer
42 views

Adding file geodatabases as group layers?

I have a couple hundred file geodatabases (GDBs) each containing several feature classes. Is there a way for me to move the GDBs into an mxd such that each GDB is imported as a group layer ...
1
vote
1answer
230 views

Increase python script speed [closed]

for row1 in cursor1: if row1[0] != None: num3=row1[0].upper() custx=row1[4] custy=row1[5] num2=row1[8] try: ...
0
votes
1answer
28 views

Where Clause looking at two Columns and a RANGE Expression

Using ArcPy I'm Trying to Set up a Where Clause with a RANGE in my "FeatureClassToFeatureClass_conversion" This {Where Clause} needs to Query Two Columns in the data: FEATURE = 'ENVIRONMENT' and ...
0
votes
2answers
49 views

Drawing map from XY coordinates in CSV and exporting it to JPEG using ArcPy?

I have a csv file containing about 40,000 rows of data with X, Y (longitude and latitude) data. It is US data, and I have downloaded a state.shp file on which the X, Y points can overlay. I am able ...
1
vote
2answers
68 views

Alternative to nested Con statements in python

I have a nested con statement that I'd like to put into a script, as it's hard to follow in its current form. The raster it produces is incorrect, so it'd be easier to debug in a script. The ...
0
votes
1answer
92 views

How to set parameter dependencies in ArcGIS python toolboxes

I'm trying to build a python-toolbox where the user selects a layer and then specifies a column in that layer. According to the documentation, that is done via the parameterDependencies attribute of ...
0
votes
1answer
59 views

Copying content from one Portal for ArcGIS to another using Python?

I am trying to copy content from one portal to another with python only, without using AGO assistant https://ago-assistant.esri.com/, as this doesn't work behind our firewall in our test network. I ...
0
votes
1answer
20 views

Divide broken line layer in seperate clusters based on location

Building on a earlier asked question on this forum I would like to ask an additional question in getting the task done I asked here: Divide polyline layer in clusters with specific requirements in ...
1
vote
1answer
23 views

Querying two Separate Columns in ArcPy SQL {where clause}? [duplicate]

Using ArcPy I'm Trying to Set up a Where Clause in my "FeatureClassToFeatureClass_conversion" This {Where Clause} needs to Query Two Columns in the data: FEATURE = 'ENVIRONMENT' and TEMPERATURE ...
1
vote
1answer
85 views

convert dbf file to txt file using arcpy

I have a series of dBase files and I'd like to convert them to text files Anyone can help me? I've tried table to table, doesn't seem to work. The idea is to get ASCII files so I can do further ...
1
vote
1answer
39 views

How to write a python code for Add Feature Class To Terrain using interface?

I am trying to write a code that creates a Terrain from lidar data (LAS). The problem is that the inputs are in Feature Dataset in GDB but I don't know how to write code so that using an interface. I ...
0
votes
0answers
15 views

Creating Bookmarks in Map Document (*.mxd) using ArcPy? [duplicate]

I've poked about the internet pretty deeply this afternoon for this one and i would seem that there is not a way to write / save a bookmark using Python in ArcGIS Desktop. I see how one can read the ...
0
votes
0answers
40 views

Problem with arcpy.MakeFeatureLayer_managament running in script

I am exporting pdf maps using data driven pages based on radial buffers around multiple location, one map per buffer. In some cases, there are overlapping buffers that need to be turned off based on ...
5
votes
2answers
174 views

Data Driven Pages with Movable Legend/Inset Map

I have created a script tool for ArcMap 10.3.1 that will move a legend around a data frame so as not to obscure a specified map layer when using data driven pages. However, I'm encountering an ...
0
votes
1answer
65 views

ArcPy Dissolve Statistics Fields

While running a Dissolve, when using statistics fields, I keep getting an error that the parameters are not valid. Here is my code: toBeDissolved = ...
1
vote
1answer
101 views

From featureclass (or shp) to WKT e GeoJSON

I use ArcGIS 10.1 without Data Interoperability extension and I want to convert some feature classes (point, lines and polygons) contained in an .mdb. I read some posts but can't convert my file. ...
2
votes
3answers
73 views

Updating coordinates of vertex in polyline using Python and ArcGIS for Desktop?

I want to update the point coordinates which are not correct on polyline. I tried many times to update it using python, but my script didn't work. The first attribute table is the station_id and its ...
1
vote
1answer
45 views

How to use LIKE clause/condition in Arcpy.Exists/Delete

I would like to delete several raster files in an ArcSDE SQL Server database. I would like to do so with Arcpy. How can I succesfully use a LIKE condition to delete all files in my database that ...
1
vote
1answer
50 views

Can script using arcpy.mapping.MoveLayer() be made to run faster? [closed]

We're running ArcGIS 10.0 and using a python script to move layers, turn on the correct layers, zoom to the correct extent and export a pdf map. The script normally takes 30 - 35 seconds to finish. ...
1
vote
1answer
108 views

Arcpy - Out of memory [closed]

I'm new at making scripts and I´m having some issues in my first arcpy script. I've created a code that automates maps creation, and it's running ok but gradually increases the memory consumption ...
-1
votes
1answer
62 views

Running custom geoprocessing tools written for ArcGIS 10.x for Desktop in ArcGIS Pro?

I am developing geoprocessing tools for Arcgis Desktop 10.3. I also have ArcGIS Pro installed . Can I run geoprocessing tools (written for 10.x) in ArcGIS Pro? Is it theoretically possible? Can ...
0
votes
1answer
27 views

Finding & correcting missing layer in MXD using ArcPy? [duplicate]

Am struggling with ArcPy. Can someone help with a script to identify missing layers (red arrow in TOC) and then to search for the correct file locations & then update the mxd.
0
votes
1answer
12 views

Combining DataFrameTime object with ExportReports function in ArcPy?

using python in ArcGIS, I'm trying to combine the ExportReports function with the DataFrameTime object. For every date interval, an image of the Layoutview is exported and all the visible layers are ...
1
vote
0answers
31 views

Dividing points into Polygons based on an Attribute of that point and its relative distance to other points and a facility

I have random point data (school locations) that I need to divide into 'n' polygons (regions) based on: their distance to a facility, their relative distance to each other, and an attribute of that ...
0
votes
1answer
37 views

Is there an Export All Features in View Extent equivalent with ArcPy?

I would like to dynamically classify a layer's symbology based on the current view extent. As in, quantities of a specified field will be classified into quantiles based on the range of values of the ...
1
vote
0answers
47 views

How to create 10 day averages of a multiyear daily raster time series?

I have a set of daily modis LST rasters (.tif) over a roughly 13 year period (2002-2015). I would like to group them by 10 day periods, i.e. bin 1 = julian day(jd) 0-9, bin 2 = jd 10-19, etc so that ...
1
vote
1answer
22 views

arcpy.SubsetFeatures_ga output not saving in correct feature dataset

I am using SubsetFeatures_ga to create a random dataset within a file geodatabase and am trying to save the output feature class in a feature dataset but it keeps getting saved in the root of the file ...
3
votes
1answer
80 views

Merge connected lines IF they share adjacent polygon(s) (arcgis/arcpy)

I have lots of lines that I need to merge IF and only if they share the same polygon(s). All lines are made from the polygons (copy-paste into line) so they all snap. In this little example line ...
0
votes
0answers
11 views

How to define matrix values fishnet polygons [duplicate]

I have created a fishnet shapefile in which all cells have a unique identifier (Cell_ID). I also now need define in which column and which row the cell appears. Thinking logically, if a I have a ...
3
votes
2answers
105 views

Deleting line vertices inside polygon using ArcPy?

Is there a way to automatically delete vertices in line features using a polygon file in ArcGIS so that it wouldn't cut up the line but just straightens the line inside the polygon? The lines are ...
2
votes
2answers
74 views

Numpy error when computing scores based on percentiles

I want to calculate scores in one field based on the percentile (in steps of 10) the row falls into in another field. I found a solution here (Calculating Percentiles in ArcMap?) that I tried out, ...
6
votes
1answer
83 views

Automatic creation of polygons from Feature Class points in ArcGIS for Desktop?

I have two point feature classes, let's call them A and B. They are well-spaced and the points are non-overlapping: My objective is to create a topology using these two sets of points by connecting ...
0
votes
1answer
27 views

arcpy: read color value of shapefile loaded in ArcGIS Desktop

I've got various polyline shapefiles loaded in ArcGIS, each using the default line style with different colors. For a python addin I'm working on I would like to use arcpy to read the RGB value of ...
1
vote
1answer
29 views

Extract metadata with arcpy from orthoimagery

I'm very new to ArcGIS, and GIS is general. I am trying to build a script that will extract metadata from orthoimagery .tifs. Below is my test code to see if I can get the metadata from one file. It ...
2
votes
1answer
79 views

Python script: “points to polygons” skipped fourth vertex

Using ArcGis 10.2 I have a script converting the nodes of a net into polygons. The polygons should be either triangles or rectangles but the script doesn't build polygon as rectangle, skipping the ...
2
votes
1answer
57 views

Check if night hours (TimeWithinDay; AreaSolarRadiation)

I am creating a script that uses AreaSolarRadiation. Currently arcpy gives a cryptic error during the night hours. arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Failed to ...
2
votes
0answers
52 views

Extracting Multivalues to Points from NETCDF4 Raster using ArcPy seems imprecise?

I'm getting some strange results in a multivalues to points extraction from a NETCDF4 layer from the MERRA reanalysis product. In particular, it seems like the values being assigned are way off in ...
1
vote
1answer
37 views

Copying schematics layout through ArcPy

I'm trying to hack a Python script together that simulates the "Copy Layout..." that's in the context menu when you right-click a Schematics diagram in ArcMap. If I copy the Shape and Rotation (for ...
0
votes
2answers
73 views

How can I change which python ArcGIS uses

I have a couple of python installations on my windows 7 machine. I have the one that was installed by ArcGIS, in a folder called "ArcGISx6410.2", and another I recently installed myself directly from ...
5
votes
2answers
246 views

Compute total area of several polygons within a polygon

I have joined a dataset containing the polygons of green spaces, with a dataset containing vegetation polygons using intersect. The result is a dataset with separate entries for each vegetation ...
1
vote
1answer
43 views

Compare and modify changes amongst GIS and MIS data

import arcpy import sqlite3 # the column names columnNames = ["ASSETNUM", "DESCRIPTIO", "INSERVICE", "ENGINEID"] data = [] with arcpy.da.SearchCursor(r'E:\mypathtoshp\Fire_Hydrants.shp', ...
1
vote
1answer
53 views

Export/Import Shp file records to sqlite table

I am new to python and ArcPy. I need to transfer all the records of a single shapefile to a table created in sqlite3 without the geometry. So far I was only able to retrieve the records using ...