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

Using Arcpy to search geodatabase for feature with smallest number of rows...

I have created a bunch of grids for a city boundary area. I would like to know how to use the Arcpy module to look through a geodatabase and find the grid with the smallest number of rows (assuming...

View Article


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

View Article


Problem with addιtion abstraction in Field Calculator

I want a bit analytical respond for the mistakes I have done in my code cause I am new to programming. I am using ArcGis 10.2. and I must process a field with distances in an attribute table I have....

View Article

Convert a string field to a number field using arcpy

Accidentally posted this in the general stack overflow forum first. I have a large (>1000) number of shape-files in which there are fields containing numbers that are defined as text fields. I need...

View Article

Most efficient way to retrieve pixel distributions inside many polygones...

I want to get the distribution of pixels from a 1 band raster that fall in each polygon of a shapefile to proceed to some statistics. I guess a zonal statistics does it in some kind of way but I need...

View Article


Calculating distance from PointGeometry object to polyline in arcpy

I created a PointGeometry object on ARCPY and I’m trying to measure the distance from that point to the closest point on a polyline table.. The PointGeometry object has an easy function for that matter...

View Article

Image may be NSFW.
Clik here to view.

Set GPLinearUnit type parameter default based on input spatial reference...

Within a .pyt python toolbox I’d like to have a parameter of data type GPLinearUnit get a default value based on an input Feature Class (FC). The standard Buffer (Analysis) tool works as a great...

View Article

Script won't delete feature classes from file database using ArcPy?

I wrote a script that creates a GDB using a designated parish/county name and then does a selection by location and extracts from another db to the newly created db. This all works fine but there are...

View Article


Image may be NSFW.
Clik here to view.

Debugging/logging ArcPy / Python code behind ArcMap function?

Considering I Can use the right click –> set datasource at an mxd file to change the datasource. The following pictures describes how this can be done in arcmap.. How can I see the arcpy / python...

View Article


Using Python add-in wizard with ArcGIS 10.3 for Desktop?

I’d like to create an add-in for ArcMap (ArcGIS 10.3) using Python. Unfortunately, the wizard does not seem to have been updated for 10.3, which is the only version Esri provides for download at...

View Article

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where Clause I...

View Article

Change field names automatically

I have an attribute table with over 2500 fields. About 2000 fields start with the name “All_txt_” (eg “All_txt_Watermelon”). Is there a way to remove this “All_txt_” from all the fieldnames...

View Article

How to set floating point raster values to NoData when raster does not have...

I have a raster with some values of 99999 that I want to set to NoData in Arc 10.2.2. I’ve tried using the SetNull dialogue box, the SetNull arcpy function, and the Raster Calculator dialogue box as...

View Article


SearchCursor doesn't return entire SHAPE field, how do I copy a row...

I imported a shapefile into a feature class using arcpy.CopyFeatures_management(). It works and when I look at the feature class in ArcMap and TOAD, I see all the data and the SHAPE field is populated...

View Article

How do I expand the .SDE file specified in my current workspace?

I’m storing my database connection in a .SDE file. When I output my feature class names in that database connection, I get the full path to the .SDE file. I want the details, like instance, for the...

View Article


Viewing pseudo node and dangle nodes using ArcPy?

We know that we require production mapping extension and ARCINFO license to view the pseude node and dangle nodes.We have to see these nodes without these functionality through python scripting,but I...

View Article

How to populate attribute table with sequential numbers?

Using Python, how can we populate a field in a feature class automatically in increasing order? The user must be able to provide the start number. For example, say he wants to populate values from 51...

View Article


Converting points using FeatureClassToNumPyArray to interpolate cross-section...

I’m trying to plot elevation cross section and extract elevations along a cross section using scipy’s “interpolate” function. I’m converting a point feature class of profile elevation points to 2 numpy...

View Article

Project only required shapefiles in folder

I have 8 shapefiles in a folder with shapefile 1 and 8 in the same projection and the others (shapefile 2-7) if different projections. Is there a way to use python to use shapefile 1 as the projection...

View Article

Image may be NSFW.
Clik here to view.

Progress dialog box of ArcGIS Python script tool stealing focus from TKinter...

I created a script tool in the custom toolbox, it runs like this: But the default progress dialog keep stealing focus from the Tkinter GUI, that makes me so hard to move/resize the OpenFileDialog,...

View Article
Browsing all 767 articles
Browse latest View live