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

learn more… | top users | synonyms (1)

1
vote
1answer
125 views

Substitute for SpatialJoin tool?

I have to write a script in Arcgis which I would like to use the SpatialJoin tool (arcpy) but I do not have the appropriate extension. It may be a tool (or example of scripts) for doing the same ...
1
vote
2answers
389 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
1
vote
1answer
267 views

Project layer with custom projection

My ultimate goal is to know UTM and UTM Northing and Easting. The data can be anywhere in North america. I calculated UTM using arcpy tool (arcpy.CalculateUTMZone_cartography) and I tried to truncate ...
1
vote
1answer
204 views

UpdateCursor to insert DDM values from a layer in WGS84?

I have a layer in WGS84 (Geographic, DD) that I need to label in DDM (Degrees Decimal Minutes). I need to calculate within an arcpy UpDateCursor, a label field with DDM in it. I saw that you can run ...
1
vote
2answers
1k views

Arcpy Error in adding input field to field map

hi guys i m doing a script in Arcgis i m new to this, i have to append some field from a table to another, i did this script in python but i have a problem when it want make the Mapping field with a ...
1
vote
1answer
742 views

Using arcpy.mapping.ExportToTIFF() to create dataframe geotiff

Has anyone created a dataframe geotiff using arcpy.mapping.ExportToTIFF() with satisfactory results? My output has poor quality and the georeferencing is significantly off. This example is the ...
1
vote
1answer
463 views

Generate MXD layer info report

I'd like to generate a report about MXD layers for a handful of MXDs. I want the report to display their name, workspace path and scale range settings. I can get the first two with ArcPy but I didn't ...
1
vote
3answers
2k views

Error when creating insert cursor in arcpy

I've written several scripts that copy data from MS Access db into a new, empty ESRI Geodatabase. I've pretty much copied the code and changed it for each table -- the first two scripts have worked ...
1
vote
1answer
557 views

Specifying which ArcSDE feature class Geoprocessing Service is to update?

I want to have a geoprocessing service update sde. I am getting an I/O Error saying data doesn't exist. I imagine because the connection file (copied from my ArcCatalog folder) I placed next to the ...
1
vote
1answer
208 views

Modifying a projection ArcMap 10.0 Arcpy

I have the need to project data from wgs84 to UTM 15N NAD1927 FOOT_US. I would like to have arcpy do this for me. I can project the data using one of ArcMaps predifined prj files in the Coordinates ...
1
vote
3answers
1k views

Unable to Provide Input for a MultiValue Parameter Script Tool

I have the following script: #Import ArcPy site package import arcpy from arcpy import env from arcpy import Raster from arcpy.sa import ZonalStatistics from arcpy.sa import CreateConstantRaster # ...
1
vote
2answers
320 views

How to match two feature classes with same geography and use part of the name of one to name the other

So I have a polygon feature classes with unique identifying names to them that I want to use to rename some other feature classes that are of the point feature type and have the same geography of one ...
1
vote
1answer
537 views

Create shape file of bookmark extents and/or automatically print bookmark extents to pdf

Is it possible to export the extents of all bookmarks in an active map document to a shape file containing the polygons of the shape and/or to automate the print to pdf of all the bookmark extents. ...
1
vote
2answers
2k views

How can I insert new records to an ArcSDE feature class from a view in ArcSDE

I am wondering how I can both insert new records from a view to a feature class and update data that may be newer in the view than in the feature class. I have been fumbling around in modelbuilder and ...
1
vote
1answer
313 views

Can you access ArcScan from a python script?

I'm using a python script with ArcPy in ArcGIS 10, and want to access some ArcScan functions. Is this possible? I can't see anything in the documentation about it, but I can't really find any very ...
1
vote
1answer
19 views

MakeFeatureLayer_management wrong output

I have a huge database with Sightings from whales and dolphins from 1995 till today. So I want to sort the database with python. Till now I can make FeatureLayers for each year for ...
1
vote
1answer
14 views

MakeFeatureLayer_management parsing error (for loop)

I want to make a Feature Layer for each month in the table "Sightings1995-2014". Why doesn't it work? for month in range (01,12): ...
1
vote
1answer
35 views

Using ArcGIS ModelBuilder and GeoCoding

I looked at ArcGIS and python and I'm not quite ready for that rabbit hole as I'm on a schedule. I have a little experience but not at the level to pick it up quickly enough for my time frame. The ...
1
vote
1answer
39 views

Find points within a radius in ArcGis 10.2

I have a feature service which is created from a view in a geospatial geodatabase. I want to retrieve all the point/geometries than fall within a specific distance. I am using arcgis 10.2 I know that ...
1
vote
2answers
55 views

What are QGIS Arcpy Equivalent Functions for MakeFeatureLayer and SelectLayerByLocation?

I have a script that I had created using ModelBuilder, but our field personnel use QGIS 2.0. Below is a snippet of the code. I am wanting to know if there is an equivalent using pyqgis so that I can ...
1
vote
1answer
34 views

Slanted raster along the line? Wind erosion model and windbreak effectivity

I'm working on wind erosion modelling and windbreak potential. Imagine windbreak, which has some values of optical porosity (in %) and this values determinates the effectivity of windbreak in specific ...
1
vote
1answer
77 views

Where to break the loop to make several polyline instead of one?

I am trying to solve a problem, I am pasting part of the code: from arcpy import env arcpy.env.overwriteOutput = True spatialRef = arcpy.SpatialReference("WGS 1984") polylineFC = ...
1
vote
1answer
18 views

Using ModelBuilder to replicate series of tasks without deleting output features first?

I am calling a number of files that I want to clip etc in ModelBuilder which clips data and sends it to a specific feature class. I want to re-run that same process for which I have converted the ...
1
vote
1answer
33 views

How to loop a Select by Attribute to use in a Select by Location?

I am new to python scripting and I need help. I am trying to select one row at a time on a shapefile that contains buffer rings around sites we are working on (some rings overlap), and for each site ...
1
vote
2answers
92 views

region growing feature selection using arcpy

I have a polygon featureclass consisting of parcels touching boundary with each other and for which areas are computed in the attribute table (Figure a). I want to select polygons in an iterative way ...
1
vote
1answer
34 views

Python-Scripting in ArcGIS: Point as Input?

Is there any possibility to add a Point-Feature as an input parameter in a ArcPy-/ArcGIS-Python-script? If I choose "Point" as datatype in the parameter list, I get 2 input-fields for a X- and a ...
1
vote
1answer
36 views

findAndReplaceWorkspacePaths does not work for sde files so as to change datasouce (geodatabase)

I manage to change my datasouce by right clicking on an mxd file and choosing a different sde database connection file as shown in the following image. However When I try to do this using arcpy ...
1
vote
2answers
43 views

Generate dynamic input with python script

I'm using 10.2.2 ArcGIS, I want to create a python script and have the following script: I'm new to this topic as I can use sys.argv [] or GetParameterAsText? for can I make dynamic input coordinates ...
1
vote
1answer
41 views

ArcPy Export SQL Server to Shapefile gives RuntimeError: Object: Error in executing tool?

I have executed a stored procedure and want to export this layer to a shapefile. I feel like this should be an easy solution. I tried using arcpy.CopyFeatures_management and it threw an error. I am ...
1
vote
2answers
47 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") ...
1
vote
2answers
37 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
48 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 ...
1
vote
2answers
37 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 ...
1
vote
2answers
53 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. ...
1
vote
1answer
56 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 ...
1
vote
1answer
46 views

Flip multiple vectors

I have thousands of vectors (out of several million) which I need to flip, for directionally purposes (Network Analyst). The vectors in question are annotated that their directionality has been ...
1
vote
1answer
33 views

Multiply raster by Numpy derived float value

So I have a python script that uses numpy to calculate the mean of a field, then I try to use that mean value in a raster multiplication as follows: na = ...
1
vote
1answer
68 views

Running ArcGIS model at specified time or with delay?

I am looking to start running an ArcGIS model built in ModelBuilder in the future. Start at a specific time. or Start in x hours. or something similar. When I leave the office I may have data ...
1
vote
1answer
38 views

How to reclass aspect raster to float values

So I have an aspect raster that was created from a DEM. I'm trying to reclassify it using python, but I'm running into some issues. Here's the setup: I need to reclassify values in the aspect raster ...
1
vote
1answer
54 views

Performing multiple “Closest Facilities” analyses for multiple feature classes

I am trying to calculate network distance from 10 points within 896 polygons "SA1s" (a total of 8960 facilities), each to ten points within 186 polygons "DZNs" (a total of 1860 incidents). I would ...
1
vote
1answer
60 views

Extract polygon attributes from covering polygon with highest area

I have a fishnet grid (polygon layer) and another polygon layer containing some hexagons. I would like for each square polygon in the fishnet layer that covers a hexagon (even a tiny edge of it) to ...
1
vote
1answer
68 views

select random rows with python in arcgis

I am new to using Python in ArcGIS, and I wonder: how do I select random lines (or every two lines) of an attribute table? I must select these lines and calculate them, so they are different from ...
1
vote
2answers
45 views

How to provide a default value in an arcpy script?

How do I provide a default value like recommended in every Arcpy script? This script is exported from ModelBuilder where every output except the last one is set to temporary and managed. I want this ...
1
vote
1answer
31 views

How to Set Label Expression Using a Long Field Type in Toolbox

What I am hoping to be able to achieve with this Tool within my Toolbox is to allow the user to input a number of layers and to set all of the labels with the same font settings (font style, color, ...
1
vote
1answer
66 views

Listing all feature datasets and classes from multiple geodatabase into CSV file? [duplicate]

I have a folder having multiple geodatabase and I am calling that folder “Multiplegdb” There are 3 geodatabase in a folder which are as follows: ABC.gdb UVW.gdb XYZ.gdb Each geodatabase have ...
1
vote
1answer
37 views

Batch processing of geodatabases - join raster with table

I am unsure how to go about doing this using Python in ArcMap, though I know how to do it by hand. I have geodatabases containing gSSURGO data, one for each state, in their own folders. I have a ...
1
vote
1answer
56 views

Add annotation feature class to mxd with arcpy

From what I have researched, I'm pretty sure the answer is NO, but I want to make sure no one has found a work-around. Annotation feature classes in personal geodatabases need to be added to mxds. ...
1
vote
1answer
53 views

ArcPy Label Class object returning unexpected value for expression property?

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") for lyr in arcpy.mapping.ListLayers(mxd, "TestFile_LineToPoints13_Prod"): if lyr.supports("LABELCLASSES"): for lblclass in ...
1
vote
1answer
82 views

Export to SHP with ArcPy with query

I have a shapefile with table with area code (field areacode). How can I export with ArcPy each unique area code so I get a SHP file for each one? It takes too long to select the layer and query ...
1
vote
1answer
84 views

ArcPy FieldMappings syntax using Merge tool

I'm working on script that takes several table results from the Zonal Statistics As Table tool and merges them into a single table. When merging I encounter the issue that the exported .dbf files have ...