0

I would like to create a raster in which the cell values contain the angle between that cell and a single vector point. It would be as though a line were projected between the cell and the point, and the angle would be that between this line and a line-oriented to 0 degrees (straight north). I can’t find a function in ArcGIS or QGIS that might easily accomplish this.

It seems that what I’m asking for is the azimuth of raster cells relative to a single point. This old question was the same but wasn’t definitively answered: Creating direction raster in QGIS

3
  • I'm curious. Why? Commented Mar 11, 2023 at 13:31
  • It’s part of a visibility analysis for an elliptical structure. With that info I can solve the width of the structure from any angle. Commented Mar 11, 2023 at 14:01
  • @Matt what workflow did you come up with? I'm trying to do something similar to calculate widths between structures. Commented May 23, 2023 at 15:31

3 Answers 3

3

You could rasterize your point then use the Euclidean Direction Raster tool. You will need a Spatial Analyst license for this tool in ArcGIS. I also see that this tool is slated for deprecation and set to be replaced with this.

1
  • This is the solution I used, however, it creates a raster with directions from the raster pixels to the point, rather than vice versa. I used the raster calculator to reorient the directions: Con(rastername >180, rastername - 180, rastername + 180) Commented Mar 12, 2023 at 12:10
3

In R you can do

library(terra) r <- rast(ncol=36,nrow=18, crs="+proj=merc") point <- cbind(0, 0) r <- rasterize(point, r, 1) b <- direction(r, degrees=TRUE) plot(b) 

enter image description here

3

Using QGIS:

  1. Menu Processing > Toolbox > Raster pixels to points to convert the raster to a point layer (one point for each pixel center)

  2. Create a new attribute azimuth with Field Calculator and this expression:

    degrees( azimuth( overlay_nearest( 'point', -- replace by name of your point layer $geometry )[0], $geometry ) ) 
  3. Menu Raster > Conversion > Rasterize (vector to raster) and set the attribute azimuth from step 2 as input for Field to use for a burn-in value parameter.

Result - azimuth from red point:

enter image description here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.