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

Update row with next row's value

I am trying to extract the endpoint of a line with very fine scale and overlapping GPS data. I would normally just use the locn_id+1 but that doesn’t work because the data were originally rarified....

View Article


Image may be NSFW.
Clik here to view.

How to calculate perimeter for each polygon using geometry (Pythagorean...

I created code that able to read coordinates of points for each polygon in shp file. * import arcpy, math from arcpy import env print "Creating and defining X and Y coordinates:" env.workspace =...

View Article


Arcpy geoprocessing script running with default inputs

I have a pretty simple geoprocessing script. My javascript is supposed to be passing it a list of layers to query. Something like this for the Javascript: var params = { "Layers":...

View Article

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...

View Article

Image may be NSFW.
Clik here to view.

Using findAndReplaceWorkspacePaths in one directory (divide into sub folders)...

I try to use ‘findAndReplaceWorkspacePaths’ function on MXD files using ArcView 10.3.1. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders...

View Article


Getting 'module' object has no attribute 'ExtractValuesToPoints_sa' error in...

I am using ArcGIS 10. I am trying to extract values to point using ArcPY but getting error as Runtime error : ‘module’ object has no attribute ‘ExtractValuesToPoints_sa’ Below is what I am trying...

View Article

ArcPy: Geoprocessing for the data with specific variable [closed]

Imagine if we have dataset like this: +------+------------+ | City | DistrictID | +------+------------+ | A | 001 | +------+------------+ | B | 001 | +------+------------+ | C | 002 |...

View Article

Outside ArcMap session, script fails to add/save layer to mxd file

The following code generates an layer output, but fails to add and save it to the specified mxd. There are no other layers in the mxd, and is just a ‘ghost’ / placeholder for running the script outside...

View Article


Run standalone python script against mxd, not outputting layer file/package

The bulk of the code used in my script for reading this is from @RHB located here. His block of code runs fine with a current map open. Need it to open without an ArcMap session open. I tried as...

View Article


Python with ArcGIS: import scikit-learn fails (bad numpy.dtype)

I am trying to install scikit-learn 0.17.1 (current) into my Python 2.7.3 that accompanies my ArcGIS 10.2. The installation through easy_install goes through smoothly, but I get the following error on...

View Article

ArcGIS 10.2 Model Builder If no selection is made, then do not append to...

I’m creating a model in model builder that is very easy to construct and understand. However, I ran into a slight problem. The logic of the model is that it will take user selected features from a...

View Article

Image may be NSFW.
Clik here to view.

How to get specific version (renedered with) of a feature layer in arcpy

Is there any way to get version of a layer loaded using arcpy.MakeFeatureLayer_management in arcpy with mssql server connection. There are tools that be used for several types of version related tasks...

View Article

Image may be NSFW.
Clik here to view.

Reclassify variable in ModelBuilder?

I want to reclassify a raster (variable) in model builder in two classes. First class ist 0-treshold = NoData and second is treshold-max value = 1. It works fine if i use an existing raster file as...

View Article


Field Calculator text field to new shapefile

I have point features being selected by a polygon feature and copied to their own shapefile. I also have certain values of the polygon feature being applied to the newly created point file. The point...

View Article

Image may be NSFW.
Clik here to view.

How to create dynamic text in ArcPy that recursively reflects the exported...

I have a script shown below with the help from @Midavalo that exports irrig_0, citylyr, boundlyr as a GIF. Once this is done the script then exports irrig_1, citylyr, boundlyr as another GIF and so on....

View Article


UpdateCursor gives Too few parameters Expected 1?

Can anyone tell me why my script isnt working? I cant figure out where I went wrong. I am working with an access personal geodatabase. Adding a field, then updating that field with yes if the field...

View Article

Image may be NSFW.
Clik here to view.

Calculating angle between polyline segments and assign this value to point?

I have a polyline feature with many segments (polyline splitted at vertices). I plan to record angle values to attribute table per each polyline segment and assign it to point features. I need to...

View Article


Image may be NSFW.
Clik here to view.

How to keep a parameter blank in a script tool?

I’ve developed a sort of find and replace script tool that functions. But I’m not able to figure out how to find empty cells in fields and replace them.For the “Find” parameter, I have tried entering...

View Article

Image may be NSFW.
Clik here to view.

Populating the drop down of GPValueTable

In a Python Toolbox the user has to select a city from a list of 50 world cities. More than one city can be selected. The best UI control for that would be Autocomplete / Autosuggest, but since this...

View Article

Image may be NSFW.
Clik here to view.

Zoom to the whole page using ArcPy

I work with several MXD files. When opening those MXD files, i want to see the whole layout view, as this button function: . Is there a way, using arcpy, zooming to the whole page in the layout view,...

View Article
Browsing all 767 articles
Browse latest View live


Latest Images