A site-package created by Esri to expose ArcGIS for Desktop (and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

learn more… | top users | synonyms (8)

4
votes
3answers
1k views

Additional Parameters for PrintTask?

Hi Guys I'm writing a custom GP tool for printing with 10.1. I need to pass some additional parameters into GP tool. I'm using printTask from jsapi and I couldn't add more parameters just by adding to ...
4
votes
2answers
2k views

Append or merge consecutive line segments (contours) as one single line of the same elevation value

Is there a way using python (ArcPy) or ArcGIS 10.1 tools to collect consecutive line segments having the same elevation value and appending/merging/generating one single line from them? Each resulting ...
4
votes
2answers
1k views

How to efficiently check for feature overlaps with Arcpy?

In an effort to reduce processing time, I am looking for ways to pre-process data within my script. I have ~18,000 featureclasses with ~500 features each (all simple circle polygons) from which I want ...
4
votes
1answer
414 views

How to create Shapefile on ArcGIS Server side?

I am developing a script which gets an JSON array with point coordinates. This array is encoded to a python dictionary. From this I filter all points (latitude and longitude) and an ID. This ...
4
votes
1answer
399 views

How to set page size in ArcPy?

It is possible to set page size in ArcPy? I'm looking for any tricky way to set the page size, using pure Python or ArcPy. I'm using ArcGIS 10.1 for Desktop.
4
votes
1answer
1k views

Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()

I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values... CINPT1 = "...
4
votes
2answers
3k views

Getting values from attribute table and inserting another table using ArcPy?

I have line feature class of a river network and “FromTo” table. Lines are dissolved so they are not segmented from junctions. I need to write a Python script in ArcGIS to do following: Begin from ...
4
votes
2answers
2k views

Python script to implement a batch import of CAD files into Geodatabase?

Does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase. I have one I wrote here, but it is only able to import one CAD file at a time. It imports ...
4
votes
1answer
1k views

ArcPy performance issues with an UpdateCursor when sorting

I'm hoping that someone will be able to help me here. I have written a short ArcGIS Python script (mainly cobbled together from other examples) that sorts a feature class ascending based on two fields ...
4
votes
3answers
2k views

Converting *.xlsx datasheet with point feature data into POINT feature class using ArcPy?

I am trying to create a script tool to automate this process, eventually it will be used for batch processing but at the moment I can't even get test data to work. This is pretty basic at the moment, ...
4
votes
3answers
2k views

arcpy join field tool is not licensed

I am using ArcGIS and arcpy to process some shapefiles. When I try to use the function arcpy.JoinField_management() the program stops and Python says that the tool is not licensed. This confuses ...
4
votes
2answers
1k views

How to use Matplotlib in Python 2.6 installed by default ArcGIS 10.0 installation?

I am wondering if anyone has successfully run Matplotlib with the default installation of Python 2.6 that comes Arcgis 10.0. It does not seem to work with the python version installed by Arcgis 10.0. ...
4
votes
2answers
662 views

ArcGIS Spatial Join Options Missing

The ArcGIS SpatialJoin online help page has a long list of match_options when joining data spatially, including HAVE_THEIR_CENTER_IN. However running the arcpy.SpatialJoin_analysis tool in Python ...
4
votes
2answers
4k views

Arcpy Insert Cursor not inserting all rows

Good morning all, I have a script here that takes data from a cross-tabulated non-spatial dataset where monthly values are stored in a single table row for a given year and linearizes those data so ...
4
votes
2answers
2k views

Dynamically change zoom level of overview map to fit with current extent in DDP

I am using DDP pages in a large mapset with pages ranging from 1:7500 to 1:130,000 and the overview map is zoomed out to far to see some of the smaller zones. Is it possible to set the overview map to ...
4
votes
1answer
946 views

Can I delete only tables, or only objects sharing a string of text, from a geodatabase?

I've got about 1000 tables in a geodatabse that I need to delete. They are named IntersectedBuffers_1, IntersectedBuffers_2, etc, and they're the only tables in the database. Could someone please ...
4
votes
1answer
6k views

How to add field in attribute table using ArcPy?

I have researched How to add attribute field to existing Shapefile via Python without ArcGIS? but could not implement it. Can give me examples of how to add field name in attribute table? I have ...
4
votes
4answers
731 views

Unable to save selected layer by attribute for ArcGIS Geoprocessing

I am troubles using the SelectLayerByAttribute() function for arcgis geoprocessing. I have a layer and I want to select everything that matches on a particular attribute. I call MakeFeatureLayer() ...
4
votes
1answer
886 views

Setting mask (halo) for labels in Python script?

I currently am writing a python script and using a lot of the arcpy mapping module functionality. I have been using the LabelClass of the arcpy mapping module to automate the display of labels with my ...
4
votes
4answers
768 views

Compressing map algebra outputs from ArcPy

When creating a raster map algebra output, is it possible to set its compression? I'm creating a model which generates many hundreds of rasters, and currently each is being stored without any ...
4
votes
2answers
990 views

Calculating spacing of polylines along transects using ArcPy?

I have a shapefile with a number of roughly parallel lines in it, and I want to calculate the spacing between these lines using a number of transects across the map. How should I go about this? I ...
4
votes
1answer
102 views

Installing ArcPy (from ArcGIS Pro) with Anaconda?

I would like to use ArcPy from ArcGIS Pro with my Anaconda install. ArcGIS Pro installs a 64bit python3 version of arcpy. How do I add this version of arcpy to my anaconda 64bit python3 install? And ...
4
votes
1answer
75 views

Time Delay in Importing ArcPy

I've got a few on demand scripts via the web that run ArcGIS in the background via Arcpy. Now, every one of these scripts takes a solid 15-30 seconds to run, which I find okay. After doing some trial ...
4
votes
2answers
156 views

Python script that creates polygon feature class with given coordinates

Write a script that creates a new polygon feature class containing a single ( square ) polygon with the following coordinates: ( 0, 0 ), ( 0, 1,000 ), ( 1,000, 0 ), and ( 1,000, 1,000 ). ...
4
votes
1answer
82 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 ...
4
votes
2answers
77 views

Arcpy mapping text element reset

I am writing a script to create thousands of maps and I am trying to create a table that updates for every map. Basically an updating table of the information specific to each map. I have been trying ...
4
votes
3answers
401 views

ArcPy: Save and open mxd without closing ArcGIS

With Python Add-In Wizard I created a Button which: looks in a specific directory for the last created/modified folder (which is created with another tool) saves the current mxd with a new name in ...
4
votes
1answer
317 views

How to access the feature extent of a feature class using arcpy?

How can i access to feature extent of a feature class and change the extent using arcpy ?
4
votes
1answer
272 views

Moving a Map Service Group Layer out of a Group Layer with ArcPy

I am struggling to move web services (tiled basemaps) out of group layers into the data frame. I've used arcpy.mapping.ListLayers to compose a list of layers, then I've ascertained what is a group ...
4
votes
1answer
620 views

Running Python toolbox tool both standalone from other tools within same Python toolbox?

I have created a python toolbox for work that has two tools inside. These tools use the toolbox template and so have a init, getParameterInfo, etc. I want to be able to run one tool both stand alone ...
4
votes
1answer
171 views

What does InsertRow() return if the insert is not successful?

I have some basic code that inserts rows using an InsertCursor. oc = arcpy.da.InsertCursor(outputFC, someFields) for item in rowsForInsertCursor: tmp = oc.insertRow(item) del oc It seems the ...
4
votes
2answers
1k views

Converting Date field to string using ArcGIS for Desktop?

I'm working with two data sets that require a compound key to join or relate. The two fields are: 'Node_ID' which is a long integer field referring to a particular electrical substation [887932] '...
4
votes
3answers
472 views

Maximum number of shapefiles for merge tool?

I have over 180,000 shapefiles that I have to merge (or append) into a final shapefile. I have written a python script to do so which uses the acrpy.append_management tool. However the runtime is too ...
4
votes
1answer
1k views

Installing scipy.spatial with ArcPy gives DLL load failed error on import?

I am running python 2.7.6 from an ArcGIS installation. I have tried to install scipy from the Python Exchange Packages here, using the scipy-0.14.0.win32-py2.7.exe executable. I get no error importing ...
4
votes
2answers
393 views

Get value from Metadata in Python Script for attribute

I am working on a python script to create some feature classes from dbf tables. As part of the script I would like to pull two values (FGDC "publication date" and ArcGIS Spatial Reference ArcGIS ...
4
votes
1answer
3k views

Calculating geometry area in ArcGIS for Desktop using ArcPy?

I have a polygon shapefile and I want to write a Python script to add a field named "area" and calculate its geometry areas. The script is like this: arcpy.AddField_management("...
4
votes
1answer
787 views

How to change text legend orientation from right to left reading with arcpy

I working on mxd with ArcMap 10.3 . The default's legend properties is- Layout - left to right reading (Marked with a red ellipse) : when it unmarked i get this legend: i want to know if there a ...
4
votes
1answer
435 views

How to automatically check for lidar flight line overlaps?

I have a series of lidar-based raster products created via FUSION. Since I am working with low density lidar data, many of the raster images show significant striping where lidar returns overlap on ...
4
votes
2answers
2k views

How to specify map service parameters when publishing with arcpy?

I publish map services on a ArcGIS server using the typical arcpy script below. I need to better specify some service parameters. For example, the service should be available in WMS instead of KML, ...
4
votes
1answer
2k views

Use arcpy to connect to database without connection file

It seems like arcpy can only work with connection files. This creates one of two problems: Deployment requires manual creation of connection files. We have to write a bunch of code to recreate the ...
4
votes
1answer
2k views

Defining Feature Set parameter for ArcGIS Python Toolbox tool?

I'm trying to create an ArcGIS Python Toolbox tool which uses 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 ...
4
votes
1answer
1k views

How to edit PostgreSQL geodatabase table using ArcPy?

I'm trying to update a table using a python script and it's not working. The table resides in a postgres geodatabase and is versioned. I have also verified my user permissions (I'm the admin). The ...
4
votes
1answer
1k views

copy feature class and retain selected fields with arcpy

I've got a featureclass (fc) that I want to copy, but only retaining a selected number of fields, let's say field 9, 11, and 12 from the total of 15 fields. I want to use arcpy and suspect that ...
4
votes
1answer
440 views

How to generate overlapping polygons from lines output from Table To Ellipse tool?

I have a feature class of line-based ellipses generated by the Table to Ellipse tool that looks like this: What I want is polygons of the individual ellipses, however tools like Feature to Polygon ...
4
votes
1answer
2k views

How to reduce time for 'Export to PDF' (or any other alternative to print maps) in Python?

For my work, I designed a tool to create PDF maps with large amount of data, intersected with 5 buffer rings using ArcPy. The job involves intersecting points, selecting points, generating Elevation ...
4
votes
2answers
478 views

Moran's I z-score in ArcPy

I have a ArcPy script to calculate Moran's I several times (50 to be precise). However, I am not interested in the Moran's I value, what I need is the z-score returned by the tool. Even though the ...
4
votes
1answer
2k views

How to merge many shapefiles in different folders?

Directory structure is basically as such: county\City\prep\POI\Completed\C1, ...C2, ...etc\ I'm trying to write a script to go through the *\Completed*\POIS.shp and merge them all together, at a ...
4
votes
2answers
3k views

Creating empty group layer within existing group layer using arcpy.mapping?

Referencing this question, Adding new group layer with ArcPy?, I'm trying to use python to add a empty group within a group layer. So far I'm able to add a empty group within the map document, ...
4
votes
1answer
915 views

Access Metadata from ArcSDE-tables using python

Is it possible to access the metadata of a feature class in a ArcSDE-data, using arcpy / python (on Arcgis 10.0). I suppose I could export the metadata to xml and parse the xml, but is there a more ...