Hi all,
I have a series of buffers of various sizes around points.
I'd like to add in a radius symbol to each buffer to show its length.
I was able to do it manually, but it only worked at one scale; if I zoom in or out, the radius doesn't scale correctly.
Is it possible to add a radius symbol that correctly scales with the rest of the poylgon?
Thanks!
Solved! Go to Solution.
You can do it with symbol property connections and Arcade, using the $view global.
// If you don't have a distance attribute, calculate the radius yourself
// This will be inexact!
var a = Area($feature, "square-meters")
var r = Sqrt(a / PI)
// Else just use your distance field
//var r = $feature.BUFF_DIST
return Round(r, 1) + " m"
// Like before
//var a = Area($feature, "square-meters")
//var r = Sqrt(a / PI)
var r = $feature.BUFF_DIST
return r / $view.scale * 2835
// I have no idea where the 2835 is coming from. I guess it has something to do with my map's / monitor's DPI.
// It might be a different number for your units and setup.
Scale 1:20.000
Scale 1:50.000
Scale 1:10.000
Note that the displayed radius is not exact. I used 500, 750, and 1000 meters. But the Area() function densifies the COGO lines of the buffers to like 35 vertices, which shaves off some area around the rim.
You can use Convert Labels To Annotation (Cartography) to convert your labels to static annotations.
You can do it with symbol property connections and Arcade, using the $view global.
// If you don't have a distance attribute, calculate the radius yourself
// This will be inexact!
var a = Area($feature, "square-meters")
var r = Sqrt(a / PI)
// Else just use your distance field
//var r = $feature.BUFF_DIST
return Round(r, 1) + " m"
// Like before
//var a = Area($feature, "square-meters")
//var r = Sqrt(a / PI)
var r = $feature.BUFF_DIST
return r / $view.scale * 2835
// I have no idea where the 2835 is coming from. I guess it has something to do with my map's / monitor's DPI.
// It might be a different number for your units and setup.
Scale 1:20.000
Scale 1:50.000
Scale 1:10.000
Note that the displayed radius is not exact. I used 500, 750, and 1000 meters. But the Area() function densifies the COGO lines of the buffers to like 35 vertices, which shaves off some area around the rim.
Thanks Johannes!
This works well for me.
One thing I had to was multiply my buffer field to convert it from miles to meters (my spatial reference units) before dividing by $view.scale.
Another thing to look out for is making that "Scale Proportionally" is unchecked, or else you get this:
This was at 1pt and way too thick, also the text kept getting bigger.
This one ("Scale Proportionally" unchecked) draws correctly.
I am curious about how you got the 2835 number? I know you don't know what it means but how did you arrive there?
I am curious about how you got the 2835 number?
Trial-and-error. I knew that
screen_dist / real_dist = 1 / scale -> screen_dist = real_dist / scale
The lines weren't long enough, but they were proportional to the buffer distance, so I was on the right track. I figured I'd have to convert from "meters on screen" to "pixels", so I started putting in some common dpi values, but they ere all too small, so I just started iterating until I got something that looked right.
I think I just found out what that value is. Go to scale 1:1, place a point, symbolize it with the line symbol, make it really wide to reduce the relative error (I used 1500pt). Measure the distance / create a line feature over the symbol and get it's length (0.5292 meters in my case).
1500 pt / 0.5292 m = x / 1m -> x = 2835 pt
So it's the points needed to display one meter at scale 1:1.
If you zoom the map to where the symbol aligns the way you want, and set the Map Reference Scale, would that work for you?
Using a combination of the circle and line from the Distance and Direction tools (Insert tab->Measurements group), I created a 1-mile circle first by clicking the circle tab, for the center point, snapped to a point and set the radius/diameter to 1-mile. Next, I used the Line tab and again set my starting point snapped to the point and my ending point snapped to the circle polygon. Created the line and it labels distance and angle. You can update the label expression to not label an angle if you want. Works well!