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

learn more… | top users | synonyms (7)

0
votes
0answers
12 views

Cannot access/store to default gdb from arcpy

I have a python script executing spatial joins for x input shapefiles from the user. The output should be stored in the default geodatabase - this is, because the join is done multiple times and the ...
1
vote
1answer
52 views

Determine rasters particular area's within ranges using python

My directions: Create a script that determines what areas meet the following conditions: Moderate slope — between 5 and 20 degrees Southerly aspect — between 150 and 270 degrees Forested — land ...
3
votes
1answer
17 views

MakeXYEvent setting values in CSV with numbers as text in result?

I thought I had a working ETL script going that was writing a CSV from a non-spatial Oracle DB to ArcGIS gdb when one day it broke. I whittled it down to the MakeXYEventLayer process. Basically I ...
0
votes
0answers
17 views

Batch Clipping Shapefiles using Argparse

Is there a way to batch clip shapefiles in ArcPy using an argument-Argparse (which calls a shapfile or group of shapefiles) specified by an outside user in command line?
0
votes
0answers
12 views

Execute Built-In Command in ArcMap using Python Add-Ins Extension Event?

Is it possible to execute an ArcMap built-in command programmatically, using the Python Add-ins framework? Can ArcMap built-in commands be exposed to and executed using the event methods found in ...
2
votes
1answer
33 views

Repoint feature layers from one SDE to another

I am trying to repoint layer (.lyr) files to a new SDE connection. In a test project folder I have two test layer files. When using lyr.findAndReplaceWorkspacePath() the script runs with no errors, ...
1
vote
0answers
26 views

Spatial Join - Field mapping to delete and rename fields

I have a python script where the user can enter a study area (Polygon shapefile) and multiple point Features of interest (Point shapefiles). The point shapefiles are looped through and joined with ...
1
vote
1answer
54 views

How do I load a .shp file using a button with ArcPy?

I have created a python addin where the user should be able to select a shapfile and then load, but I've not been able to put in the current workspace. import arcpy import pythonaddins import os from ...
1
vote
1answer
14 views

Creating composite band mosaic of sentinel 2 data with arcpy

I previously useda simple script that went through many Landsat satellite images, and for each folder it found it made a composite band raster. The script was as follows: import arcpy import os ...
1
vote
1answer
17 views

Spatial join for multiple shapefiles (loop)

I have the following two datasets: - polygon shapefile containing administrative boundaries of a City - multiple point shapefiles What I want to do is to spatially join the point shapefiles with ...
-1
votes
1answer
28 views

Creating a Map Outside of ArcGIS Environment in Python

How would you create a batch of maps in Python from shapefiles that the user specifies and implement features (preferably user specified) used in 'Layout' view in ArcGIS such as adding legends, ...
2
votes
1answer
61 views

deleting Broken Source from arcgis toc with python addin

i have created one python addin tool. which create some layers in Memory. at the end of the script it deletes the In memory layer. but such layer still remains in TOC with a broken link how can i ...
2
votes
0answers
42 views

ArcGis' python library (arcpy) are imported so long

python -c import time; t1 = time.clock(); import arcpy; print('{0} seconds'.format(time.clock() - t1)) 3.60283379862 seconds It takes this long each time i launch my script or test. Is there any ...
3
votes
1answer
16 views

Change map element order in ArcPy

I am trying to change the order of text elements through arcpy, such as sending them to the front or to the back. I know I can change the position of text elements using arcpy, but I can't find any ...
2
votes
0answers
28 views

Output from geoprocessing service

I am using ArcMap 10.3.1. I have created a custom tool using a python script, the code for which is listed below, that uses a lookup table to reclassify vector data. When run on the local machine the ...
2
votes
0answers
10 views

Problem Importing CAD features using arcpy.MakeFeatureLayer_management?

When importing multiple CAD drawings using "arcpy.MakeFeatureLayer_management" and "arcpy.Merge_management" I encountered a problem. Drawings that have line weights and elevation values assigned to ...
0
votes
0answers
23 views

Arcpy.mapping.MoveLayer can't find the RefLayer [duplicate]

I've tried this several ways and don't know why ArcMap won't find the ref layer. Here is a code snippet. import arcpy if lyr is not None: del lyr #Add constants mxd = ...
3
votes
0answers
18 views

Is there any way to capture ArcMap Drawing Errors inside of a python script?

Is there any way to capture ArcMap Drawing Errors inside of a python script? Through python, I would like to iterate through each layer inside of an MXD, make the layer visible, refresh the table of ...
4
votes
1answer
38 views

Writing points to a file

Trying to write the city name and point coords to a file. The following works with a polygon shapefile but not the point shapefile. I know I'm missing something basic. import arcpy # Set up the ...
0
votes
0answers
31 views

PackageLayer_management failing within script, needs to run outside arcmap session

I'm automating a workflow that requires outputting a layer package, it throws the general ERROR 999999 when executing and breaks. It does, however, generate a folder in the correct directory, with ...
1
vote
1answer
28 views

Arcpy - read out input shapefiles in table view

I have created a python script, where the user should be able to input a set of shapfiles. I have achieved this by using the data type "Table View" (see screenshot attached). Now I am wondering how ...
3
votes
2answers
43 views

Change part of text element using ArcPy

I work with multi MXD, and the title in all of them start with "The plan on the" and then i write the map's subject, for example: "The plan on the land use", etc. I need to change just the sentence ...
0
votes
1answer
28 views

Select by location and copy features to new shapefile

I have been asked to select point features that fall into a polygon in its own shapefile then copy the points selected to a new shapefile. There are around 300 shapefiles with an indiviidual polygon. ...
1
vote
1answer
25 views

How arcMap tool run in async mode with arcpy?

I am using python in arcmap 10.0 to execute "Topo To Raster" tool. I am successful to execute this in blocking/sync mode. but I want to execute this tool with python in async mode. workspacePath = ...
2
votes
1answer
54 views

Grouping polygons by spatial attributes

I'm working with a dataset that contains millions of polygons representing leased properties. In many cases, there are multiple polygons that are drawn on top of one another (representing multiple ...
1
vote
1answer
40 views

Switching out layers but keeping the order the same (see figure) with ArcMap and Arcpy

I need to update the table of contents for a given .mxd by keeping a certain order but switching out the contents. I can bring in the new feature classes as map layers, and delete the old map layers ...
0
votes
0answers
21 views

Automatic Dynamic symbology or Attribute driven symbology? [on hold]

I have looked for a while now on this issue! There seems to be multiple leads dating back over eight years! ...
3
votes
2answers
33 views

Using Arcpy to Turn on Maplex Label Engine

I've been attempting to automate a number of processes into one script using arcpy. I've got everything working and am wondering if there's a way to use arcpy to toggle on/off the Maplex Label Engine. ...
2
votes
1answer
64 views

How to SelectLayerByAttribute Xcoordinate and Ycoordinate

I am having trouble selecting by attribute when I am trying to select by the Xcoordinate and Ycoordinate. For example ...
0
votes
2answers
46 views

Creating series of lines offset from starting points (ArcGIS, arcpy)

I've got a series of points representing generalized locations of trawling activity over many years. A single XY location can represent many trawling records. I'm attempting to create a series of ...
1
vote
1answer
36 views

Calculate Field throws an error when parsing python with backslashes

I have an FTP I need to access through a python script. It works fine with forward slashes, but I don't need it to be read as an html. Below are both sets of code: Working: ...
2
votes
1answer
37 views

Joining a csv table to the attribute table of a feature class in arc gis 10.3

I am new to arcpy. I was trying to join a csv table to the attribute table of a feature class. Here I would like to share what i was trying to do. import arcpy, csv from arcpy import env ...
4
votes
1answer
69 views

Using UNC pathname with Calculate Field tool in ArcPy?

This question is different to Using Calculate Field to fix hyperlinks in ArcPy gives Cannot use VB for services? which was asked previously because it is using the Python parser specifically, rather ...
3
votes
1answer
38 views

Using Feature Dataset with ReplaceDataSource gives ValueError: Layer: Unexpected error?

I'm attempting to replace the data source of a unsourced layer with a mxd. The issue I'm having is that the Featureclass "APPL" is contained within a Feature Dataset. When the feature class is outside ...
1
vote
2answers
50 views

Run model in MXD using Python

I'm very new to python so please bear with me. I am trying to run a model that exports a .wm feature to a geodatabase feature class. The .wm file extension is for software that is used to update ...
0
votes
1answer
36 views

Arcpy: creating a line on an existing line based on points' coordinates

I have a point which is some meters away from an existing line: This point should be snapped to the line (to the closest part) and then, based on the points' new coordinates, a new line Feature ...
0
votes
1answer
53 views

Reading shapefile directory in Python? [on hold]

I am developing tool on ArcGIS ArcMap 10.0 with .NET and Python technology. In TOPOTORASTER tool , I give a line feature class. the line feature class path something like this: inputOne = ...
0
votes
0answers
39 views

What is a polygon, a ring, a part in arcpy, ArcMap-editor for the OGC and in GIS generally

I ran in some difficulties to the definition of the term polygon as i tried to understand arcpy's geometry model. (ArcPy getPartCount always returns 1 on multipart polygons?) I ended up in consulting ...
6
votes
1answer
91 views

Geoprocessing in violated convention environments (Microsoft Windows)

Our MapInfo and ArcGIS users have self managed file shares. I do my best to educate our users about windows naming conventions but years of violating basic conventions and personalities that don't ...
1
vote
2answers
48 views

Using Calculate Field to fix hyperlinks in ArcPy gives Cannot use VB for services?

Getting an error while trying to script it, specifically "Cannot use VB for services." Snippet and VB code block as follows: Raw block (works within ArcMap): "\ftp\raw\YYYYMMDD\Files\Charles" ...
3
votes
1answer
106 views

Append List not working

Trying to create a list of well counts. In the code below, wellCntList only contains the current county count and not a list of ALL the counts. Sure I'm missing something simple. for cname in ...
3
votes
1answer
67 views

ArcPy getPartCount always returns 1 on multipart polygons?

in this post Why does the method partCount in ArcGIS always give back a value of 1? a problem occured that could easily be reproduced. partCount is always 1! Is it a wrong usage of partCount or did ...
2
votes
1answer
36 views

Add shp attribute data to column with python script

If feature column (feature is the name of the column) in table is ferry crossing in the attribute data then I need to add Yes to the Ferry column that I have already added to the table. If the ...
0
votes
1answer
37 views

Arcpy get point feature at start and endpoint of Line feature

I am having trouble getting a feature that is at the start and end point of a line. I can get the start and end point of the line but I am not sure how to grab the Point feature that is at the start ...
2
votes
1answer
34 views

ArcPy - Syntax Error when using reclassify tool

I have been writing a code to automate a variety of processes in Arc Toolbox. I have used a line to reclassify before but this time when using it I am coming up with a Parsing Error (SyntaxError). I ...
3
votes
1answer
46 views

arcpy.da.SearchCursor(fc,[“SHAPE@”]) has no firstPoint object

I am having trouble getting the start and end point of a line using the code below. import arcpy with arcpy.da.SearchCursor("Lines",["Material","SHAPE@"]) as curs: for row in curs: ...
3
votes
3answers
69 views

python script tool validation checkboxes to radio boxes?

I am trying to build a tool in arcmap, which uses radio buttons in its gui. Since I read, that radio buttons are not supported, I figured, it couldn't be too hard changing the behaviour of simple ...
1
vote
1answer
27 views

Script for running Feature Class To Coverage tool runs into error on arcgis server

I have created a script for converting feature classes to coverage and it runs fine in arcmap. But after publishing and running it on the server, it fails to execute and returns the following error ...
2
votes
2answers
46 views

IOError: “[u'Hospitals',u'Parcels',u'Roads']” does not exist

I was wondering if someone could help me figure out what's going wrong with my code. It's at the very end of a code that, once a link to a geodatabase is inserted, will print the name, directory, ...
1
vote
2answers
49 views

Using Python to select records by date field

I am trying to write a python script to select records created within the past 7 hours (date field - database time) using a where-clause within arcpy. The table is ArcSDE database (Microsoft SQL ...