How would I write an expression in the expression builder to rotate a marker symbol towards a fixed grid reference using Arcade and ArcGIS Pro?

It does not need to be too accurate (no haversine required) as the points are within 2km and it is a projected coordinate system (ESPG 27700, OSGB)


For those wanting looking for an expression builder reference there isn't one, what you need is the language reference: https://developers.arcgis.com/arcade/function-reference/. This doesn't give the whole story away as you have to click through the links to discover that you can call geometry($feature).x and geometry($feature).y.

The following works for me, with an arithmetic alignment and a marker that points to 0 degrees (arithmetically):

var pX = geometry($feature).x;
var pY = geometry($feature).y;
var cX = 572730.054736;
var cY = 161931.381529;
var dX = cX-pX;
var dY = cY-pY;
return Atan2(dY,dX)*(180/pi)+90;

Where cX and cY are the coordinates that I want the marker to point towards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.