Skip to main content
17 votes
Accepted

arcpy.SelectLayerByAttribute not working with an integer saved in a variable

Error 000358means "The SQL expression is invalid", as described in Help - ArcGIS Desktop Your query, "Id=k", means that "get Idand k (field) value of a feature, compare both, if both are equal, ...
Kadir Şahbaz's user avatar
11 votes
Accepted

Search if field exists in feature class

I would prefer a list comprehension instead of string operations (like accepted answer). In my opinion, this is more readable and pythonic. Furthermore, the list comprehension approach could be ...
Saleika's user avatar
  • 1,330
8 votes
Accepted

Where can I get an archived copy of the ColorBrewer style file for ArcGIS 10?

Reach Resource Center has a archive copy of a Color Brewer ArcMap style file available for download.
Midavalo's user avatar
  • 29.9k
8 votes
Accepted

Using tempfiles for intermediate dataset in ArcPy?

You cant have a file extension for rasters in the in_memory workspace so change slope = "in_memory/slope.tif" to slope = "in_memory/slope" See: 001167: No extension is allowed for in-memory raster ...
Bera's user avatar
  • 76.3k
6 votes

Converting ArcGIS layer style to Styled Layer Descriptor (SLD) file?

I have confirmed that arcmap2sld tool is working fine on ArcGIS Desktop 10.1+. The program can be downloaded from this link and the readme docs are here. The program transforms an ArcMap project's ...
Alex Tereshenkov's user avatar
6 votes

Extracting coordinates of polygon vertices in ArcMap?

This is another option using Python with the da.SearchCursor: import arcpy fc=r'C:\TEST.gdb\polygons123' with arcpy.da.SearchCursor(fc,['OID@','SHAPE@']) as cursor: for row in cursor: ...
Bera's user avatar
  • 76.3k
6 votes
Accepted

MXD files in ArcGIS

Almost. An mxd is a project file that contains (amongst others) layer definitions. You might say that an mxd is a collection of layer files, but besides that, it has for instance a pagelayout, a map, ...
Berend's user avatar
  • 4,758
6 votes
Accepted

Printing Shapefile spatial Reference Using ArcPy?

Your code should be like this import arcpy dataset = r"E:\GIS\Centers.shp" desc = arcpy.Describe(dataset) extent = desc.extent spatialReference = desc.spatialReference.Name name = desc.name ...
Moh's user avatar
  • 1,598
5 votes

Zoom to Feature hotkey in ArcMap Table View

Ctrl-Enter will take you to the next line and select it. Using Ctrl-N or Ctrl-Shift-= will zoom to the selected row. Not too bad. More links on hotkeys: Zoom to Feature hotkey in ArcMap Table View “...
Alex Tereshenkov's user avatar
5 votes

Creating shapefile showing footprints of Rasters?

The Previous Answers worked for QGIS 2.x. If you are reading this after 2020, you will find that the Answers don't work. What Works with QGIS 3.x is the plugin called IBAMA Processing. Install this ...
Devdatta Tengshe's user avatar
5 votes

Creating shapefile showing footprints of Rasters?

Ensure images have defined nodata. If source images do not, fix with something like one of the below, where 0 or 255 is the supposed-to-be nodata value: gdal_translate ... -a_nodata 0 ... outimage.vrt ...
matt wilkie's user avatar
  • 28.2k
5 votes

How to remove <VALUE> text from legend in layout view?

An easier way is to right click on your Legend and click on "Properties." In the Legend's property menu click on the "Items" tab. You'll be able to see the contents that are within your Legend. ...
Scott's user avatar
  • 51
5 votes
Accepted

Interrupting label display with ArcGIS Desktop?

The Labeling Toolbar has a Pause Labeling button The Pause Labeling button will stop labels from displaying until you're ready for them to draw. Pause Labeling - Suspends drawing of labels See ...
Midavalo's user avatar
  • 29.9k
5 votes
Accepted

Insert variable to query builder of Arcpy

Assuming that your Source.shp has a field named Field, instead of: "\"Field\" = " + Var + " try: "Field = '{0}'".format(Var) A two variables example syntax is: "TextField = '{0}' AND NumField = {...
PolyGeo's user avatar
  • 65.3k
5 votes
Accepted

Slope calculations appear to be 90 degrees off in ArcGIS 3D Analyst?

I think your error is a result of performing a slope calculation on a DEM that isn't in a projected Coordinate Reference System (CRS). The reason for performing a transformation/warping of your DEM is ...
Zeitsperre's user avatar
  • 1,398
5 votes

Using arcpy.SelectLayerByAttribute_management?

The third argument to the SelectLayerByAttributes function is an SQL expression in string format. If you are familiar with the Select By Attributes dialog window it is essentially what you would type ...
Ali's user avatar
  • 4,075
5 votes
Accepted

Python to read text file to add new field

You can create a dictionary from the textfile and use in the UpdateCursor: Textfile: A Monkey B Fish C Cat D Dog Feature class attribute table: Code: import arcpy feature_class=r"C:\TEST.gdb\...
Bera's user avatar
  • 76.3k
5 votes
Accepted

ArcGIS 10.0 Addin install error?

The documentation states: Add-ins are not backward compatible. Add-ins targeting 10.1, for example, will not work with 10.0 but will work with 10.2. Considering that ArcGIS 10.0 is old enough to ...
Vince's user avatar
  • 20.2k
5 votes

Using ArcGIS Desktop concurrently in remote server?

You seem to have misunderstood the meaning of "concurrent" in the Esri licensing documentation. Concurrent use is defined: This is a license environment where core products and extensions on ...
Vince's user avatar
  • 20.2k
5 votes
Accepted

Selecting max value in SQL query from Extract by Attributes?

This is the model that you are seeking: You create the table view of the raster, sort that into an in-memory table, then use the Get field value which only every looks at the first row which is your ...
Hornbydd's user avatar
  • 44.2k
4 votes

Getting X Y coordinates and cell value of each pixel in raster using ArcPy

A simple solution using open source python packages: import fiona import rasterio from pprint import pprint def raster_point_coords(raster, points): # initialize dict to hold data pt_data = ...
dgketchum's user avatar
  • 179
4 votes

Submodel not executing within main model

I've run into this same problem. For some reason, ArcGIS isn't reading the submodel as valid. What you need to do is open up the submodel and set all the parameters so that they point to dummy files....
P.T. Curran's user avatar
4 votes

Creating polygons as % of original area using ArcGIS Desktop?

I suggest that you use the Buffer by percentage plugin available for QGIS. It's not a solution using ArcMap but it does exactly what you want in a very efficient way.
kaycee's user avatar
  • 475
4 votes

Retaining all fishnet grid squares within boundary of polygon from another feature class?

By default, the Fishnet tool creates a polygon/polyline grid using the bounding box of your study area. Try one of the following workflows: Option 1: Create Fishnet Clip fishnet with the study area ...
Aaron's user avatar
  • 51.8k
4 votes

Is the PostGIS st_intersection function viable for very large data-sets?

I really wouldn't use PostGIS for datasets in the millions if you have access to a columnar database. If you regularly query tables with millions of rows, it's more efficient to script a workflow ...
Encomium's user avatar
  • 3,183
4 votes
Accepted

Points not displaying in feature class in file geodatabase

I do not know of a way to do so directly. If you only a few points, enter to editor, start editing, click "Create Features", select point, then right click on the map and select "Absolute XY". You can ...
Archaeojp's user avatar
  • 117
4 votes

Saving last selected value in Python Script Tool?

Use Geoprocessing Results list - re-opening a previously run tool will include any parameters selected when that tool was run. Geoprocessing Menu > Results In Results tab open the previously run ...
Midavalo's user avatar
  • 29.9k
4 votes
Accepted

ArcGIS ModelBuilder task

Import your shapefiles into a geodatabase, create a toolbox in this geodatabase. Create a model, drag your feature class(a) into the model, go the Insert tab, choose iterators, and add in Field ...
Maksim's user avatar
  • 6,926
4 votes
Accepted

CalculateField_management - Updating a field with value from another field?

As explained in 24046: Tool cannot use VB expressions for services, the problem could be related to using VB expressions in 64-bit ArcGIS products. As offered in the very same page, if you change ...
fatih_dur's user avatar
  • 5,003

Only top scored, non community-wiki answers of a minimum length are eligible