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 ...
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="...
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 ...
13
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 ...
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 ...
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 ...
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.
11
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), '...
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 ...
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 ...
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....
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 ...
8
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 ...
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, ...
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 ...
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, ...
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 ...
7
votes
Tobler's hiking function in PathDistance ArcGIS 10.3.1
Using Excel I computed speed of travel (V, km/hour) vs slope (degrees) using Tobler’s formulae:
Defined time (T, seconds) needed to cross single cell in my DEM (2 m in my case):
T=3600*2/V/1000
...
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 ...
7
votes
How can i Calculate Road Width in ArcMap?
Possible way to do it is:
Create centerlines for your polygons (With Collapse Dual Lines To Centerline after convertion polygons or with Creating Centrelines from Road Polygons/Casings? (not tested)
...
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) & (...
7
votes
Flow Direction created from depressionless DEM inaccurate in flat areas
These are common problems, typically resolved by stream burning, but that relies on you having a vector network to enforce drainage. I recommend you check out the free GIS software Whitebox GAT it has ...
6
votes
Estimating Area of farm under cultivation using NDVI?
Take raster NDVI dataset and use a raster calculator-type function to create a binary surface of 1 and NULL (no data); 1 is where values are between 0.1 and 1; NULL is everything else.
For each farm ...
6
votes
Accepted
In ArcGIS 10.1, for what tools does Environments actually work?
At the bottom of the help page for each tool, ESRI provides a list of the environments that can impact the tool's processing.
For example, the Resample help page does not include Mask in its list. It ...
6
votes
Accepted
ArcPy map algebra equivalent for "any"?
You could sum the rasters and test whether the total is greater than 0.
list_of_rasters = [Raster(a), Raster(b), Raster(c)]
z = CellStatistics(list_of_rasters, "SUM") > 0
6
votes
Accepted
Convert polygon to line using ArcGIS Desktop?
I'm not sure which license level you have access to, but if you're working with an Advanced license for ArcGIS Desktop, you can use the "Collapse dual lines to Center line" tool (tool description here)...
6
votes
Accepted
Clustering neighboring points inside ArcGIS Desktop?
Result of clustering technique suggested by @Albert shown by colours of points in the picture below. Output will greatly depend on physical order of points in a feature class. At some stage it will ...
6
votes
Accepted
Interpolation with 10 data points
Both methods are "appropriate".
IDW basically says "half way between a point valued 6 and a point valued 8 the value is going to be 7", but extended to the distance to multiple ...
5
votes
Identifying highs on DEM using ArcGIS Spatial Analyst?
One easy way of doing this would be to inverse your DEM by multiplying it by negative one (Raster Calculator) then running the Fill tool on the inverted DEM. Finally, subtract the filled DEM from the ...
5
votes
Accepted
Create largest circle (maximum radius) inside a polygon in ArcGIS for Desktop?
I have worked up an answer in ArcMap and using ET Geowizards (as it is what I have access to but I think the same tools exist in ArcMap but require more than a basic license):
Convert polygon to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
spatial-analyst × 1581arcgis-desktop × 1009
arcpy × 357
raster-calculator × 271
arcmap × 255
raster × 180
arcgis-10.0 × 130
arcgis-10.1 × 113
arcgis-pro × 105
arcgis-10.2 × 102
zonal-statistics × 97
dem × 78
spatial-statistics × 60
cost-path × 54
interpolation × 53
modelbuilder × 51
arcgis-10.3 × 50
con × 44
reclassify × 40
r × 36
3d-analyst × 34
map-algebra × 34
qgis × 32
hydrology × 32
slope × 30