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

learn more… | top users | synonyms (1)

2
votes
1answer
34 views

ClipRaster with three inputs

1) How can I clip raster with checked "Use Input Features for Clipping Geometry? I don't want to specify X, Y Min/Max for the Output Extent. I want to run a simple Clip Raster script that includes 3 ...
0
votes
2answers
47 views

SaveToLayerFile failed - “value is not a layer”

Tried doing a SaveToLayerFile on a layer in a workspace, but it confusingly says it's not a layer. I know it is a layer because the script can access lyr properties (e.g. name) and all of the ...
1
vote
0answers
61 views

Loop exits after 100 count while creating domains using python [closed]

I am trying to create domains on feature class or table class by reading a table which holds all look up information. Following is example code for what I am doing: tableIndex = ...
1
vote
1answer
38 views

Adding extra characters to elements in a list [closed]

I am trying to create a script that automates the generation of a MXD. It does this by the user copying and pasting several variables, running a definition query and exporting an MXD. I can get the ...
0
votes
3answers
92 views

Using arcpy outside the arcmap

I want to use some arcpy function outside arc map i used following code but it ends up with error no module named arcpy can anyone help import sys sys.path.append("D:\Installed ...
0
votes
0answers
44 views

Arcpy save command giving errors

I've been trying to get this to work but for some reason it just keeps failing. Here is a very simplified version of my script: import arcpy arcpy.CheckOutExtension("spatial") #Spatial Analyst ...
0
votes
1answer
69 views

Print values of a field in arcgis using python [closed]

I am pretty new at python scripting and I am trying to print values of a field to screen. My code is that import arcpy layer = arcpy.GetParameterAsText(0) arcpy.AddMessage('Layer Name : '+layer) ...
0
votes
0answers
15 views

script to Determine Parcel Neighbors [duplicate]

I have a layer of Plots Urban planner I want to fill the neighborhood north and south, east and west of each piece fields i need script to Determine Parcel Neighbors using PYTHON
4
votes
2answers
249 views

How to create proprietary tools for ArcGIS?

I want to build a some tools for ArcGIS. Toolboxes that I've seen are open source and run the scripts that reside in their src folder. However, I don't want to release the source code. After some ...
3
votes
1answer
105 views

How do I import specific fields from a shapefile?

Using arcpy, how do I import only select fields from a shapefile? Or, if I must import the entire shapefile, how do I delete certain fields after import?
1
vote
1answer
90 views

Parameters not valid in batch Alter field Arcpy

I am trying to perform a batch of Altering field names through a stand alone python script using Arcpy but it seems I am making a basic mistake in my python code. Using a list I refer to the original ...
0
votes
1answer
44 views

When importing a shapefile, resulting field name in feature class contains schema and table name

I'm using the following snippet to import a shapefile into a SDE feature class. arcpy.CopyFeatures_management(inputShapefile, outputFeatureClassName) where inputShapefile is a shapefile on a mapped ...
1
vote
1answer
43 views

AddLayertoGroup

I've been using ArcGIS 10.0 to create arcpy scripts. Now that I'm using ArcGIS 10.2, I try to run those scripts in the new environment but I get some errors. One of them is the following one, that I ...
1
vote
1answer
60 views

The truth value of a raster is ambiguous. Invalid use of raster with Boolean operator or function.

I'm having trouble with an if/else statement in my for loop. I have a raster Vmax with a constant value, another raster V which has a value of 0 in the beginning and will change during execution of ...
1
vote
1answer
63 views

ArcGIS OSMLoader arcpy .encode error

I am trying to load a geofabrick .bz2 file into a file geodatabase using the OSM Simple Loader tool from http://arcscripts.esri.com/details.asp?dbid=15137 However it fails each time at this line: ...
2
votes
2answers
45 views

Updating the Z value within an XYZ.txt file

Following a post from a few weeks ago: Creating polygon from 2 txt files (Parent ID + Coordinates) and thanks to the help and code, the script works very well. Now I need to reverse the process in ...
3
votes
1answer
191 views

Is it possible to run ArcToolbox without ArcMap?

I am following the accepted answer for the question: Batch conversion of netCDF to Raster in ArcGIS using Python, obviously, to convert netcdfs. The code taken from the above answer (pasted below) ...
0
votes
0answers
54 views

Object: Createobject Layer Invalid Data Source

I'm using a tool made for ArcGIS, however I keep getting this error (see picture). I do not know any python code and I'm trying to get this script to run. # Import system modules import sys, ...
1
vote
1answer
66 views

Print webmap to geospatial pdf

I am looking for a solution for this with no success using: result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd) AND arcpy.mapping.ExportToPDF(mxd, Output_File, ...
2
votes
1answer
110 views

Python tool won't stop running— Not an infinite loop issue

I'm having trouble with a python script. It is essentially a near duplicate of another script which is running fine-- it is using different files, but apart from that the tools used and the order in ...
1
vote
0answers
41 views

Arcpy script or other method for points in polygon per participant

Is there an Arcpy script or another way that I could use to find out the number of GPS points falling within each participant’s home neighbourhood as defined by an 800 meter network buffer around the ...
0
votes
0answers
36 views

Layer to kml conversion tool does not generate any output when used with graphics layer

I want to use the layer to kml tool to convert the data of a graphics layer to kml. The tool expects a layer : "The feature or raster layer or layer file (.lyr) to be converted to KML." Despite the ...
-3
votes
1answer
51 views

Creating a desktop GIS with arcpy analysis [closed]

What is the problem with this code? I want to make a desktop GIS with this code in ArcPy. Can anyone help me?
0
votes
2answers
65 views

How can i create points per 10 and 100 meters for several lines with ArcPy?

I have 10 lines and i want to generate points per 10 and 100 meters for each one of them. In ArcGis there is the tool construct points(COGO) but is not scriptable. Is there any suggestion? Also i ...
1
vote
1answer
32 views

How can I test for exclusive access to the scratch gdb?

I have an application that uses the scratch geodatabase. Upon completion of our work, we delete the scratch geodatabase. The next time our app runs, scratch gets recreated automatically. How do I test ...
0
votes
1answer
31 views

Create KML from MXD that contains map service layers like feature layers

How can I create a KML (tools suggestion), provided that I have a map (.mxd) file which layers are service layers of hosted services and not local data coming from a geodatabase. I know that the map ...
0
votes
0answers
22 views

Retrieve locally the data of an mxd that are contained in sevice layers and recreate a new mxd with static data (not coming from service)

I want to get/dowload the data contained in a map service and recreate a new mxd file with static (not retrieved from a service) data. I am interested for data coming from feature and graphic layers. ...
0
votes
2answers
69 views

Loop for exporting shapefiles from an existing shapefile

I have a pnt shp with 50 pnts. I want to export each one of it in a separate shapefile with arcpy writting a loop. My problem is that i want the output name i create has a different name, e.g. for ...
2
votes
1answer
61 views

Data driven pages: merge multiple pdfs based on string per wildcard

I am trying to figure out how to automatically merge pdf files based on a stringpart (*wildcard) in the filename, without loosing selectable layers within a pdf. I created 3 series of layout pages ...
1
vote
1answer
84 views

Delete empty feature class in modelbuilder - “Calculate Value” Expression problems

I am trying to delete empty feature classes created in the process of intersecting layers with a set-up in modelbuilder. By using Calculate Value tool i have written a code that should do the trick. ...
0
votes
0answers
38 views

Script for Arcpy console Lock file gets removed

I am running a script via python console to batch add and calculate new fields of all shapefiles in the current dataframe. Sometimes, especially if I have more than 5 shapefiles to be processed, the ...
1
vote
1answer
55 views

gdal RasterizeLayer gives different extent to arcpy PolygonToRaster

I have an existing arcpy script which uses PolygonToRaster_conversion to convert a polygon shapefile to raster (tiff). I am now exploring GDAL/OGR and have used the cookbook approach to carry out the ...
2
votes
1answer
54 views

arcpy handling of floating points

This arises from my own question How to handle coordinates accuracy in ArcGIS where I have tried to use the documentation entitled Using geometry objects with geoprocessing tools as a reference. I ...
3
votes
3answers
104 views

Using Python to count records and show difference

I'm trying to find an example of a python script for ArcGIS 10.1 that will get count of a FC in my SDE and get count of a FC in an incoming FGDB update and then write the difference to a log file. We ...
0
votes
1answer
47 views

GPRecordSet in python toolBox

I would like to use a GPRecordSet in my python toolBox as an output parameter. This geoprocessing will be share on my ArcgGIS server and in my ArcGIS portal. I haven't see any documentation on how to ...
0
votes
1answer
47 views

Map To KML does not work with mxds that contain service layer

I am trying to use the map to kml conversion tool in a python script. The mxd I provide as input, contains data coming from map service layers. I have no security enabled to that particular layers. I ...
1
vote
0answers
81 views

ArcPy Datadriven Page AttributeError: PageLayoutObject: Error in executing ExportToPDF

I have been working on this script for a while now and even ESRI are being difficult. Essentially I am trying to export a series of datadriven pages. Executing on a single page fine no issue, ...
0
votes
1answer
42 views

Arcpy:Set min height for contour area, with surrounding contour lines

I'm trying to create a tool that will calculate the min depth and the max depth of a contour polygon, based on the value of the depth attributes of the surrounding contour lines. This is what I have ...
1
vote
2answers
185 views

converting csv to dbf

I have a python created CSV that I am looking to turn into a dbf but it is not getting read properly by the TABLE TO TABLE conversion tool. I select the csv, set the output to be XXX.dbf but the ...
0
votes
1answer
55 views

pandas.to_csv to write arcpy.getrasterproperties returns

I'm stumped on how I can use pandas.to_csv for this application. I'm trying to first write a csv then append the csv within the for loop so that every iteration appends a new row. Thanks in advance. ...
0
votes
1answer
34 views

Raster Calculator or Local-Combine tool? (in ArcPy)

i have 3 classified rasters and i wanted to use the following query from r. calculator: (rclslope>=45) & (rclmosaic>=2000) & (rclfocal>15) to arc.py how can i write it? Is it ...
1
vote
1answer
38 views

Using arcpy to separate surface objects mixed into one file into different shapefiles

I'm trying to do some elementary tasks with arcpy and ArcGIS, namely separate some information in a file into separate shapefiles based on values for a field. My initial file has a field called ...
1
vote
1answer
145 views

Looping through Layers, Add Layer to MXD, Export Image, Repeat, using ArcPy?

ArcGIS 10.2.2 I am trying to loop through a list of layers in a folder, add each layer to an mxd and export an image of the added layer. I have added arcpy.mapping.RemoveLayer to the script to remove ...
1
vote
0answers
81 views

ArcPy QueryPointAndDistance: Incorrect Lengths?

Background: I'm currently trying to determine the chainage (distance m) of my points along a polyline (i.e. proposed railway alignment). A colleague within my firm assisted me with the following ...
1
vote
2answers
93 views

ERROR 000732 from ArcPy?

What is the problem since i have "test_script" folder extant in C: but arcpy detects as a truncated one (i.e est_script) and signals error.
0
votes
1answer
93 views

Is it possible from the list or np.array, updating the table using arcpy.da.UpdateCursor?

I have created array. Is it possible to update an existing table if the number and order of columns and rows identical? In the array do not have a column headers. for example: array = ...
3
votes
2answers
91 views

Determine feature class's feature dataset

Is there a way to check if a feature class full path string is a path to a feature class within a file geodatabase feature dataset in arcpy? For example: C:\test\test.gdb\testdataset\featureclass ...
0
votes
1answer
47 views

Missing labels when using arcpy.mapping.ExportToPDF

I have a script that is run on a daily basis to export a folder of MXDs to PDFs and I have noticed some peculiar behavior. Many, but not all of the PDFs will be missing some labels or their label ...
1
vote
0answers
128 views

Calling a GP service from a GP service arcpy.Importtoolbox

I'll try my best not to sound like a lunatic as I explain this. I have a python script that calls an ArcServer geoprocessing service toolbox with arcpy.Importtoolbox. The GP service is on several ...
1
vote
1answer
120 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 ...