Quantcast
Channel: Question and Answer » arcpy
Browsing all 767 articles
Browse latest View live

Simple text Field Calculation In Arcpy [duplicate]

This question already has an answer here: Error msg “Name is not defined” when trying to populate a field with the shape file name 2 answers

View Article


Stacked with “expected a raster or layer name” error

I am using the following python script snippet but I get a TypeError: expected a raster or layer name on the commented line below. I could not find a solution about how to convert the A1 raster (that...

View Article


Python geoprocessing tool for ArcGIS online

I am looking to create a geoprocessing tool using python in arcGIS 10.2 that will be used in the ArcGIS online web app builder. This will be my first tool for a web application and I would like some...

View Article

Concatenating fields while also replacing values within certain stings [closed]

I am trying to use python to concatenate multiple fields in a polygon layer. Specifically, I am attempting to combine the values of four fields into one: EXPCODE = !MATRIX! & !PLANT! & !PCT!...

View Article

Image may be NSFW.
Clik here to view.

trying to build world file for images based off extent rectangle generated...

I have centroids for map images which I would like to georeference quickly and rougly via python script, using arcpy. I know the dimensions of the images, the dpi, scale, rotation and the coordinate...

View Article


Add layer label using ArcPy

I want to show ‘ID’ of each polygon in a shapefile using arcpy in data view mode. It should be fairly simple but not been able to figure it out. Any lead would be helpful. mxd =...

View Article

How to remove layers that are not in visible df extent

I am working on ArcMap 10.3 and I have a map with 50 layers in it. I am trying to check if layers are in a data frame. Unlike How to check if layers in a dataframe with Arcpy, I want to define the area...

View Article

Efficient ways to read table data from a large feature layer?

I have a feature layer that contains about 460,000 records and it currently takes about 20 minutes to read that table using the arcpy.da.TableToNumPyArray() tool. Is there a more efficient way to read...

View Article


RuntimeError: ERROR 010240: Could not save raster dataset to...

import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") env.workspace = r"G:GHY_568project" #mystery_creek = r"G:GHY_568projectMystery_Creek.shp"...

View Article


How to change output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script found in this post? import_path = r"..." # Path of .mxd...

View Article

Image may be NSFW.
Clik here to view.

Combine string and OBJECT ID

I would like to update the Map_Feature_ID field with a String ” WP_” and then follow the “WP_” with the OBJECTID field. So I will end up with “WP_1″, “WP_2” all the way to the end in the Map Feature ID...

View Article

Using Python new line (n) with ArcGIS geoprocessing progress dialog? [closed]

I am currently using in my ArcGIS 10.3 toolbox script; # Get the spatial reference spatialRef = arcpy.Describe(template).spatialReference.name #Loop through shapfiles in folder and reproject for fc in...

View Article

Error 000192 in Make VRP with Python scripting in ArcGIS 10.3

I’ve written a piece of python code in ArcGIS 10.3 for applying VRP. pretty similar to sample code in Esri resource website. But, it gives an error: ERROR 000192: Invalid value for Time Impedance I...

View Article


Image may be NSFW.
Clik here to view.

Using arcpy.mapping.ListLayers() with no filter, but some layers are missing...

I am trying to use arcpy.mapping.ListLayers() to access and change some of the properties on specific layers in my mxd prior to printing to PDF. Here is a screen cap of my layer list: When...

View Article

How do you use Windows folders as acrpy Parameters

I am having problems trying to perform simple folder management operations in an ArcGIS python toolbox. First here’s some code snippets (I have left out all of the stuff that does not pertain to this...

View Article


netcdf python error

I am basically copying and pasting the code provided on Esri’s website and every time I try to run it in ipython, the program crashes and needs to restart the kernels. The code is below, does anyone...

View Article

Stand alone – Python Append (multiple shps from a folder to one dataset)

I have users creating data (shp) daily into a specific folder, I already know how to invoke GP tools to append these data sets into one. What I am trying to do is run a task (which I already know) to...

View Article


Load multiple layers into multiple maps – python

import arcpy import arcpy.mapping import os import sys from arcpy import env #import string env.workspace = r"G:GIS" mxds = arcpy.ListFiles("*.mxd") lyrs = arcpy.ListFiles("*.lyr") for maps in mxds: df...

View Article

Using ArcPy to display result shapefile with layer symbology?

I am using an ArcPy script, and everything is working perfectly except the display of the result shapefile file. What is the best solution to display the result? In the end I would like to share my...

View Article

Image may be NSFW.
Clik here to view.

How to insert an accumulative attribute in dynamic text element based on Date...

I’ve got a line feature class that contains Date field. I’ve made a layout view in order to display time animation of this feature class. I’ve managed to enable the time option in the layer and to...

View Article
Browsing all 767 articles
Browse latest View live