A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

-2
votes
1answer
60 views

Draw Line from Point to existing Line

I am working on a water network, I want to draw a House Connection pipe from a house meter to nearest existing water line, I tried using python script, I could just find the nearest line. I also want ...
4
votes
1answer
48 views

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. ...
0
votes
0answers
43 views

How to calculate perimeter for each polygon using geometry (Pythagorean Theorem)?

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 = ...
4
votes
1answer
89 views

How to delete rows in attribute table of a shape file based on specific condition?

I want to delete ceratin rows in a shape file if field ID is equal to certain number (say 2). Below is what I am trying, import arcpy shape="C:\Users\Data\Loc.shp" rows = ...
0
votes
1answer
25 views

Zoom to percent using arcpy [closed]

How can I zoom to 55% using arcpy in the layout view, instead of doing it manually with "Zoom to percent" button? I have 55 maps and I prefer doing it automatically with arcpy code.
1
vote
1answer
40 views

Script to “extract by mask” a list of raster files and list of mask

I'm new to Python so sorry for maybe trivial question esta, I have four Landsat images and each image with an area to extract by mask. How can I make this script? I've tried with this script doesn't ...
1
vote
0answers
29 views

How do I add all features of a Geometric Network to the the dataframe with one parameter in a custom tool that uses python? [closed]

I want to add all the Feature Classes of a Geometric Network to my data frame with python. I want the user to be able to select the dataset of their choosing in a tool, so it would use one parameter. ...
1
vote
1answer
55 views

arcpy SearchCursor always empty at each loop when inserting new rows with InsertCursor

I am inserting new rows into a POINT FeatureClass within a geodatabase. The way I do it is by creating an InsertCursor over an empty FeatureClass and inserting new rows while loopinf through the ...
0
votes
1answer
42 views

Arcpy: Geometry object - distanceTo method in a for loop

I'm new to Python so sorry for this maybe trivial question. I have 4 lines and 4 points, which belong together. I want to get the closest distance from point 4 to line 4, point 3 to line 3, ... . I ...
0
votes
0answers
27 views

Retrieving raster classes as data type in Python Script tool?

I want to program a python script tool in ArcGIS where the user should be enabled to input a classified raster and, based on this raster, the classes should be selectable. EDIT: As is suggested in ...
2
votes
2answers
55 views

Update value in one table (feature class) by coping it from another table. The match between table is done on values from another field

I have two tables (actually both are feature classes in filegeodatabase). They pretty much identical except. one is in lat/lon. second one is projected. both have field line_length and objectid. ...
-1
votes
1answer
43 views

Exporting maps to pdf

I need to create a PDF book of all counties in a counties shapefile. I now have to use a cursor and a for loop to get individual counties, but I'm not sure how to go from there. I'm not allowed to ...
0
votes
1answer
35 views

Looping through multiple rasters, and adding them together

I have 5 folders, each with 80 .tif files. These 80 files represent one landsat image taken on a different date. Each folder represents a vegetative indice (NDVI, NDII etc.) Each file in each folder ...
1
vote
1answer
41 views

Applying Snap_edit to polygon Geometry Object

I have a project where I am modifying over 1 million polygons (representing tracts of land) to make them line up with the PLSS land grid. My process works (mostly) by cutting up polygons based on a ...
1
vote
1answer
61 views

Distance of shape points from given lat-long

I have a point shape file. and in its attribute table i have some co-ordinates(DISP_LON, DISP_LAT) . which are slightly different from the actual location of the points. i want to calculate the ...
1
vote
2answers
67 views

script to grab value from field and input into SearchCursor then select results for further analysis

The data: PL_Fac -point file - facilities used in service area analysis - contains PNTID in Add_PNTID field PD - polygon - catchment areas assigned to a facility (there can be many polygons ...
0
votes
1answer
79 views

ArcPy Python Addin Combobox How to leave a if-loop, when selection is found

ArcPy Combobox How to leave a if-loop, when selection is found I developed a Combox which: combines values from different featurelayers the User can select an ID or activitycode (acode) the ...
0
votes
1answer
44 views

Spatial selections using Python in ArcGIS

I am trying to perform a spatial query using Python in ArcGIS, here is my code: I'm getting the following error: Traceback (most recent call last): File "C:\Users\acarr\Documents_PYTHON ...
1
vote
3answers
97 views

Script for Sum of Rows in field calculator - VB or Python?

I wrote the TOTAL_FREQUENCY values manually. But I want to automatically write this values with a script. Namely, I want to write sum of column 3 to all of the the column 5 rows. How can I do it with ...
3
votes
1answer
24 views

Generate new coordinates with distance + azimuth

I currently have the following Excel data for a list of animals: Lambert 93 coordinates of the observer Azimuth of the animal Distance between the observer and the animal I would like to get the ...
1
vote
1answer
34 views

Interact with Selection and Entire Dataset using arcpy

ArcToolbox geoprocessing tools (and therefore arcpy) tend to run either on an entire dataset (if there is no selection) or on a selection set (if it exists). How can I set up an arcpy script that ...
1
vote
1answer
48 views

Finding layer file used to add layers to MXD in ArcPy?

I work with layer that located in G:\PROJECTS\bneyAyish\gis\lyr\New File Geodatabase.gdb\polygon, and I created a layer file and located it in G:\PROJECTS\bneyAyish\gis\lyr under the name ...
1
vote
1answer
64 views

Iterating over Twitter data using TwitterSearch creating array in Arcpy for shapefile

Below is the section of code I'm having trouble with. How do I designate the x and y coordinates from the (lat, lng) variable in the twittersearch for loop in the top part? These coordinates will be ...
1
vote
0answers
66 views

How to automatically run python code at the time when a mxd is saved?

I am trying to find a way to execute a few lines of (preferably python-)code whenever I save a specific mxd (my template.mxd) I'm working with arcgis desktop 10.3.1 (advanced, all extentions) What I ...
0
votes
0answers
77 views

Python Script to open Hyperlinks

Background: Currently we manually update the file path for a polygon field to hyperlink to tiffs of registered plans for our fabric records (we use Parcel Editor currently using ArcMap 10.2.2). The ...
2
votes
0answers
33 views

extracting raster using values

I have an original .tif file which has values ranging from 2 to 28. From that original .tif file, I am extracting cells having a value of >=10 using the following code: import arcpy, os from arcpy ...
1
vote
2answers
44 views

Creating MapDocs from mxd file

New to Python. I have an mxd file file with three layers and one is a layer of elementary school boundaries. Goal: Make a pdf doc with a page for each elementary boundary. ...
2
votes
1answer
39 views

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, ...
3
votes
2answers
29 views

Raster conditional tool unexpected results. What's wrong?

I have a DEM raster (High: 53441, Low: -3444, unit: cms) with negative values, and I want to make all values 100 or less to be 100. I've tried Raster Calculator, and also python. I've got the same ...
1
vote
0answers
35 views

Arcpy - Why does multi_user_mode have to be False in an edit session on non-versioned dataset?

I'm in the process of implementing Mintx's answer to my question What would cause a geoprocessing service to say "Cannot Open 'FeatureClass' Failed to Execute"? However, I had ...
1
vote
1answer
19 views

Highlight roads that are within a buffer or overlapping buffer

So I have points with a mile buffer. Is there a way to "highlight" the roads that fall under the mile buffer? My original plan is to clip the roads with the buffer, but this will take some time ...
0
votes
1answer
32 views

Python arcpy select by location to copy attribute values from one shape file to another [closed]

I have 2 shapefiles, lines and points. I want to copy over the lines number to the points that are near each line. I can use select by location in ArcMap and label manually for a small scale, but ...
4
votes
1answer
60 views

Get raster value at specific point (arcpy)

I have an arcpy script creating thousands of points in a feature layer, based on a river network. At creation time, I'd like to use the value from a (large) elevation raster corresponding to the new ...
1
vote
1answer
37 views

Simple python query: properly setting up arcpy.env.workspace and defining datasets

I'm creating a python script (for the first time in quite a long time). And the basics are confusing me a little. With the below code I keep getting the error: "ERROR 000732: Input Table: Dataset ...
0
votes
1answer
50 views

Manipulating Text elements in ArcPy?

Continually to Change part of text element using ArcPy ,when i use this code in order to delete text element (the words "Land Use"): import arcpy from arcpy import env env.workspace = ...
3
votes
2answers
56 views

Making a simple line- complex

I am trying to make my own version of code to generate elevation profile for a line drawn over a DEM and I got stuck very early on. As a simple use case: I have a line that consists of just two ...
0
votes
1answer
23 views

Arcpy - LayerList - Count/Length [closed]

I use arcpy to load all layers in the current map document, and I need all layers but not the last one (this is my layer for the symbology template). How can I access the length or count of the ...
4
votes
2answers
224 views

Correct SQL expression when looping different fields

I'm having trouble with the follow lines of code. Practically what I am doing is a 10 shapefile loop in which field represents the name of the field that I want to be calculated( the name differs by ...
2
votes
1answer
33 views

How can I access information about ArcSDE historical markers via arcpy or SQL

I would like to be able to access the list of historical markers that is presented by in the "Change Version" dialog in ArcMap - ...
3
votes
1answer
60 views

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": ...
4
votes
4answers
155 views

Get a coordinate system from raster file

I am writing a code to loop through all the files in a folder and reproject them, using a raster as the spatial reference. I have a suspicion that there is a different way to get the coordinate system ...
1
vote
1answer
48 views

Extract Polygons out of a raster

I want to extract every row from a .shp from a raster (Extract by Mask). With the following code i get 4 output raster, wich concludes every row. import arcpy arcpy.CheckOutExtension('spatial') ...
3
votes
0answers
37 views

Recovering toolbar from disconnected window?

I've faced this problem many times. I created a python addin toolbar and installed it in ArcGIS 10.2 . I work on dual monitors in the office. If accidentally this toolbox is left on the secondary ...
0
votes
1answer
89 views

How to use Python and ArcGIS? [closed]

Is it possible to open a Python file on ArcGIS and use ArcGIS information (from attribute tables) in routines of this Python file? If it´s possible, how can I do?
3
votes
2answers
141 views

ArcGIS python “add field” and “calculate field” workflow

I am new in Python and I am creating a Script. I've crafted a functional code, but I'd like to know if there is an easier way to do it, just for curiosity (And learning new ways!). The purpose of ...
2
votes
0answers
55 views

Determining EPSG code for coordinate transformation using ArcPy? [closed]

I am trying to write a Python script which will identify the EPSG code for the coordinate transformation. I am familiar with the dataFrame.geographicTransformations function, however this returns a ...
1
vote
0answers
28 views

A mesh points for each polygon: how to create function?

I want to use function for creating a mesh point for each polygon, but I am new in python. what is wrong with the function: def creatingPoints(minX, minY,maxX,maxY,number): while minY < maxY: ...
1
vote
1answer
30 views

Something Wrong with The size of the Converted Shape File (arcpy.PolygonToRaster_conversion)

I currently have a python script to process some vegetation data, while using some specific shape files. The first step is to build a geo lookup table which needs to convert the shape file from ...
6
votes
1answer
49 views

How to recursively get all lyr file properties from a group layer on disk

I'm writing a python script tool that will recursively search through a folder and all subfolders and find all .lyr files. Ultimately, I'm writing a CSV file which contains the path of the .lyr file, ...
2
votes
2answers
64 views

Check-out XTools Pro with arcpy

I have an arcpy script that uses a XTools Pro geoprocessing tool, which works if I run it from ArcMap (with the XTools Pro extension enabled), but if I run it outside of ArcMap I get an error. Tool ...