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

Merge polygons in the same shape file based on attributes, ArcGIS or ArcPy

I have a shapefile of polygons. I do not want any polygons with an area less than 25. For polygons with an area less than 25 I want to merge them with another polygon with an area greater than 25 that...

View Article


Unable to delete folder with shutil.rmtree() with ArcPy?

Unable to delete folder with shutil.rmtree() with arcpy: del mxd delete_path_edit = temp_dir_extended delete_path_forward = '/'.join(delete_path_edit.split('\')) shutil.rmtree(delete_path_forward)...

View Article


Image may be NSFW.
Clik here to view.

deleting Broken Source from arcgis toc with python addin

i have created one python addin tool. which create some layers in Memory. at the end of the script it deletes the In memory layer. but such layer still remains in TOC with a broken link how can i...

View Article

Swapping Lat and Lon coordinates of shapefile?

I have a shapefile that consists of one polygon whose boundary is defined by a large number of points. Whoever originally made the file inverted the latitude and longitude coordinates, so the data...

View Article

Image may be NSFW.
Clik here to view.

How to add local locator map/index in ArcGIS 10x?

I want to add local locator map in ArcGIS,like: As it shown in zoom level, otherwise by datadriven pages defines the locator map in original is like:. What kind of python script i can used for this to...

View Article


Python Addin Wizard Combobox scripting help with zooming to selection

I am coding an addin to allow me to use 3 comboboxes to select specific regions within a state. Once these are all selected in the comboboxes I need a final button to zoom to the selected area,...

View Article

con statement outputs using arcpy.sa.Con doesn't ignore NoData

In ArcGIS 10.2, using the Con tool, I ran a conditional statement to return RasterA where RasterB value >0. That worked fine. Transferring the code into python, the statement reads something like:...

View Article

Error 000358 using SelectLayerByAttribut_management using escape characters

I am trying to use arcpy.SelectLayerByAttribut_management using the following code: def filterData(self): self.filterBuilder() arcpy.MakeFeatureLayer_management (r"%stempclipprefilter"%self.workspace,...

View Article


Image may be NSFW.
Clik here to view.

Merge n number of adjacent polygons [closed]

I have over 17,000 individual polygons. I want to merge two adjacent polygons so that I finish with approximately 8,500 polygons. The polygons need to be merged based on location, merge two adjacent...

View Article


Writing value from attribute table to text element using ArcPy?

Is there a way, using ArcPy, to read a field from an attribute table and write the contents of that field into a text element? I have a point feature class with a field name called “Cities”. I will...

View Article

IOError: “[u'Hospitals',u'Parcels',u'Roads']” does not exist

I was wondering if someone could help me figure out what’s going wrong with my code. It’s at the very end of a code that, once a link to a geodatabase is inserted, will print the name, directory,...

View Article

Using Python to select records by date field

I am trying to write a python script to select records created within the past 7 hours (date field – database time) using a where-clause within arcpy. The table is ArcSDE database (Microsoft SQL...

View Article

Getting different pixel depths from output raster when done in ArcMap versus...

When I use ‘Plus’ in Spatial Analyst to add together two 8-bit unsigned rasters (pixel values 0-100) the output raster is 8-bit unsigned (pixel values 0-200) but when I try and do the same thing...

View Article


Find Feature class into another feature data

I am trying to find the feature classes from one feature data into another feature classes. But I’m getting nothing at the end as a result of the matc statement. The data in the arc environment is...

View Article

PythEveryone in ArcGIS virtual campus module: Runtime error + namerror

I’m working on the python for everyone lab in Esri’s Virtual campus. I’m running into an issue that I can’t seem to solve, I’ve already done some outside research hence posting here! The issue: 4th Lab...

View Article


ArcPy: Aggregate points using multiple aggregation distances and output names

I would like to be able to run a whole load of aggregate polygons with a variety of aggregation distances, using Arcpy. I have successfully done it using model builder, but specifically want to do it...

View Article

Installing an ArcGIS add-in on several PCs

I usually do my python scripts and add them to ArcMap in the form of add-ins. First I launch the ArcGIS Python Add-In Wizard, create a project, a toolbar and the tool. Then, every time I do an update I...

View Article


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

View Article

merge dbf files – without using arcpy?

I have ~7,000 2 line dbf files (zonal stats output) that I would like merged into one table, all the same format. I have used the arcpy merge tool, as seen below. #merge tables together outfile =...

View Article

Image may be NSFW.
Clik here to view.

How to re-classify raster with “resistance” value and query using line/path?...

I am interested in determining an relative cost of movement from a central location within a landscape buffer to the edge of that buffer (1500m). I have a raster file that classifies the landscape into...

View Article
Browsing all 767 articles
Browse latest View live


Latest Images