Probably one of the first things you did in a GIS class.
Select all the fast food outlets that are within 1 mile/km of a school.
To the rescue... a little buffer, a selectorama, intersect, spatial join... whatever. At some stage you have used buffers for spatial delineation either by creating one as a feature layer, or virtually when you select things within-a-distance-of.
So initially I thought I would just show the geometry created by buffering a simple shape or two to show the point densification on the outward corners. In the old days a buffer around a point was represented by a 36-sided circle, if you like, an n-gon. Pretty good if the buffer was small, but seriously lame when the buffer radius was very large. Crrrrankout a buffer on a shapefile to see what I mean. Many a line of code was written to approximate a true circle. Now you can.
But what about a buffer? The outward corners have that circular appearance, maintaining the offset radius (aka the buffer size) from the line work. One would expect teeny-tiny circular arcs to appear in the geometry representation. At worse, perhaps an n-gon representation of the arc.
Not so. Here is a square green polygon being shown in Spyder with the arcpy's new svg display. Pretty cool, but I like my numpy array version better (in red)
|Geometry representation||Geometry coordinates|
p_0 # ---- arcpy.Polygon
Pretty standard, lots of extra information in the
geometry, but when you get to it, it is the
coordinates to the right we are interested in.
To make things a bit easier on the eyes, I
subtracted the origin of the view space from the
x, y values.
Shift the coordinates to the origin
p0 # ---- a numpy Geo array of the above
In both cases, the coordinates are held in an array of some kind as in the above.
In the example p_0 is the arcpy.Polygon and p_0 is the slice of the first object within... an arcpy.Array of arcpy.Point objects.
So what do the buffer coordinates look like?
arcpy.Polygon buffer coordinates
Where are all the points? I bet you
can recognize some, but there is no
Well! No trace of those extra points.
Just a few lame ones with a teeny
offset from the ones making up the
What gives? There is nothing
visible in the documentation of by examining the existing methods or
properties by conventional methods.
JSON to the rescue? Everyone loves those curly bracket things.
A bit more information like the curve ring thing. But still no extra groups of points.
SVG to the rescue!
Huge swaths of coordinates for each
Miraculously, they have appeared by
some hidden magic that we are not made party to
So, What do the corners look like
As expected. I created the rounded corners for the numpy-based Geo array. In the example below, I plotted the SVG corner points and the Geo array points. An angle of about 5 degrees (give or take) is used by both. Smooth enough and you can account for area calculations if you know number of outward buffer corners, the total angular passage and the number n-gon shape. Or just use arcpy's Polygon methods to get the area.
To leave you with some final thoughts.
You can buffer
This is an example of the last which is based on the offset buffer, but using area as the parameter.
So remember what goes into the buffer and that not all information that you would expect to see is shown in all forms of geometry representation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.