23 votes
Accepted

Merging multiple SpatialPolygonDataFrames into 1 SPDF in R?

If you do not need to merge topology, but just add new polygons, you can simply use: ab <- rbind(a,b) If you get a "non-unique Polygons ID slot values" error it means that the rownames of the ...
user avatar
21 votes

Is Clip (Data management) or Extract By Mask (Spatial Analyst) more efficient?

I ran a test to determine how the speed and quality differs between the two methods, here are the results: Input data 4-band NAIP DOQQ image in .img format (349.34MB) A feature class used as the ...
user avatar
  • 50.3k
21 votes

Merging multiple SpatialPolygonDataFrames into 1 SPDF in R?

Super easy solution provided by @mdsumner: library(sp) library(raster) library(rgeos) library(spatstat) library(rgdal) library(maptools) setwd("C:/...") a<-readOGR(dsn=getwd(), layer="...
user avatar
  • 3,266
16 votes
Accepted

General steps to create watershed boundary in ArcGIS Spatial Analyst?

Here are the general steps involved in creating a watershed boundary. You need to work with a raster DEM, not vector contours. This means that you have two options; you can either try to interpolate ...
user avatar
  • 10.8k
16 votes
Accepted

What is the "57.29578" that ArcGIS uses in Aspect calculation?

In a GIS aspect is generally shown in radians. 57.29578 is 1 radian in degrees - ArcGIS is using this number when converting to radians. A simple way to remember how to convert from degrees to ...
user avatar
13 votes

Converting raster file from float to integer type in ArcGIS for Desktop?

Menno's answer will work but it will work but it will always round down. For example, 99.99999 becomes 99. This function in the raster calculator or map algebra tool will do logical rounding. Int(...
user avatar
13 votes
Accepted

Extracting specific values to new raster in ArcGIS Desktop?

Spatial Analyst is necessary for most raster tasks in ArcGIS beyond simple display and clipping. If you have that, then you can use Extract by Attributes to create new rasters of just one value. It ...
user avatar
  • 15.5k
12 votes
Accepted

Methodology for creating accurate drainage networks (and catchments) from high resolution LiDAR DEM?

Have you consider to use GRASS GIS analysis? I have expirience that GRASS algorithms have very good accurance on hydrology analysis. For example, I want to generate something like drainage network on ...
user avatar
  • 1,753
12 votes
Accepted

Remove (or SetNull) areas of overlapping rasters using ArcGIS Desktop?

First, you should make sure your roads and hydrology feature classes are being rasterized appropriately. You should make sure that the cell size and snap raster (i.e. pixel registration) matches your ...
user avatar
  • 11.8k
12 votes

Using Vector Ruggedness Measure (VRM) tool from ArcScripts at latest version of ArcGIS for Desktop?

Since you are using v10.2 it is looking for the path of the Spatial Analyst toolbox which has changed directory locations slightly from v9: To update, open the ruggedness.py file using Notepad or ...
user avatar
  • 34.6k
11 votes
Accepted

Raster Calculator making incorrect calculations in ArcGIS Desktop?

Exp( 3.394 + ( 4.717 * "elev" ) + ( -2.602 * ("elev" ^ 2) ) ) In Raster Calculator syntax, the '^' operator is for 'Boolean XOr', not 'raise to power of' (see Raster Calculator operators here). ...
user avatar
  • 4,613
11 votes
Accepted

COUNT vs. SUM field of zonal statistics as table output table

What you are looking for is COUNT, which is the frequency of the cells that you processed through Zonal Statistics. Sum, on the other hand, is the sum of cell values covered by your polygon. Overly ...
user avatar
  • 4,806
11 votes

Cube root on ArcGIS raster calculator?

The cube root is to the power of 1/3 so you could use something like: (ras1 * ras2 * ras3) **(1/3) Credit to @JeffreyEvans for correcting the operator for ArcGIS.
user avatar
  • 72.3k
10 votes

ArcGIS ERROR 000824: The tool is not licensed in arcpy

Wrap the part of your code that needs Spatial Analyst extension as follows arcpy.CheckOutExtension("spatial") your code arcpy.CheckInExtension("spatial") By checking out licenses ...
user avatar
  • 2,156
10 votes
Accepted

Extract raster value to polygon

You can use Zonal Statistics as Table (Spatial Analyst) for this type of operation. The tool accepts both vector and raster data as input. You can join the results to your input feature class if you ...
user avatar
  • 50.3k
10 votes

Merge two shapefiles in R

You can use raster::bind. That function combines the geometries and the attributes, even if the variable names do not match. Example data: library(raster) p <- shapefile(system.file("external/lux....
user avatar
9 votes

Specifying field in attribute table with raster calculator using ArcMap

While researching to write an answer to Cause of ArcGIS Raster Calculator Parsing error <type 'exceptions.SyntaxError'>: invalid syntax?, I found Raster Calculator trouble that states ...
user avatar
  • 15.5k
9 votes

Filling NoData gaps in raster using ArcGIS Desktop?

This works: filled = arcpy.sa.Con(arcpy.sa.IsNull(in_raster),arcpy.sa.FocalStatistics(in_raster, arcpy.sa.NbrRectangle(w, h),'MEAN'), in_raster) Where "w" and "h" are the ...
user avatar
  • 8,374
9 votes

Calculating average raster value for area in ArcGIS Desktop?

Try to use Zonal statistic (or Zonal statistic as table if you want to have table as an output) tool with parameter MEAN if your cities are polygons. If your cities are point, you could make Buffer ...
user avatar
  • 1,753
8 votes
Accepted

Extracting By Mask list of raster files using ArcPy?

Here is one way to accomplish the task. The general idea here is to create a full output file path using os.path.join() and input that into the .save command import arcpy, os from arcpy import env ...
user avatar
  • 50.3k
8 votes

Rescaling NDVI values 0-255 to [-1;1] using ArcGIS Raster Calculator?

Using the raster calculator, you'll want to rescale your NDVI image. The formula you'll want to use is: NDVI = 2/255*image-1 This is simply the linear regression between 0 to 255 and -1 to 1, ...
user avatar
8 votes

Finding regions or zones in raster DEM of similar slope or aspect values in ArcGIS for Desktop?

Slope and aspect together tell you about the normal direction to the surface. This is an arrow of unit length pointing straight out from the surface. At a horizontal point it is straight up; along a ...
user avatar
  • 67.6k
8 votes
Accepted

Understanding aspect units in QGIS

It depends on which of the available aspect calculators you used as QGIS is beter thought of as a 'meta-GIS' rather than a single GIS as it provides a GUI for multiple GIS technologies (e.g. GDAL, ...
user avatar
8 votes
Accepted

ArcGIS Viewshed Outputs

The error in your approach is that a 2m tall person at Point A who can see a 50m tall structure at Point B does not mean 50m tall person at Point A could see a 2m tall structure at Point B. Here's a ...
user avatar
  • 684
8 votes

How get intersection of polygons in the same table by PostGIS?

you can use ST_INTERSECTION using the source table twice. Make sure to avoid comparing the a polygon to itself. Also avoid comparing a pair of polygon twice. SELECT ST_INTERSECTION(a.geom, b.geom), '...
user avatar
  • 34.6k
7 votes

Creating constant slope DEM using ArcGIS Desktop?

A solution to this is discussed on the ESRI forum here: Every planar surface has a simple formula, Jesse, in the form (something)*x + (something else)*y + (constant). In the Raster ...
user avatar
  • 38.8k
7 votes
Accepted

Question about ArcGIS vs. QGIS for kernel density estimations

I was curious so I did a small test to see if the two programs perform the same function. The quick answer is yes and no. Let's have a look- Random set of 100 points with a random weight value: ...
user avatar
  • 2,781
7 votes
Accepted

Accessing Spatial Analyst extension from stand alone script?

The method I use is: if arcpy.CheckExtension("Spatial") == "Available": arcpy.AddMessage("Checking out Spatial") arcpy.CheckOutExtension("Spatial") else: arcpy.AddError("Unable to get ...
user avatar
7 votes
Accepted

Merging agricultural rasters using ArcGIS Spatial Analyst?

You can use the Raster Calculator. Something like this should get you what you want: Con("corn.tif" > "wheat.tif", 1, 2) Update for additional question in comments: I would do this in a two ...
user avatar
  • 742
7 votes
Accepted

Deleting values from raster file using ArcGIS Raster Calculator?

You can use the reclassify tool in Spatial analyst to change your values to NoData (or any other values). You can also use the raster calculator to apply some rules e.g. Con((raster>=20) & (...
user avatar
  • 48.6k

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