https://pro.arcgis.com/en/pro-app/2.8/tool-reference/feature-analysis/create-buffers.htm
As per the website this buffer tool exists - I need the one where you can remove end types. I have used it before!! But I cannot find it now. Has it been removed? I cannot even find the standard feature analysis toolbox
This is pretty urgent, thanks !
Solved! Go to Solution.
I have this - do I need an advanced licence?
let me check this for you
I have changed from Advanced to Basic and you will see a lock below a tool and then you know if you need another license
yes, so I have the tool. But not the options for side and end type. Which is odd. Especially as I know I have used them before. Do you still have access to side and end types with the basic licence?
You will need the advances license..unfortunatly. see my reply to JohannesLindner @
If it's really urgent maybe you're able to use open source GIS like QGIS or OpenJump GIS:
https://gis.stackexchange.com/questions/115687/achieving-flat-end-line-buffers-in-qgis
ah that is useful, thank you!
Open your Python window in ArcGIS Pro
Copy and Paste this script, execute
def _get_perpendicular_line(line_geometry, point_geometry, half_length):
"""returns a line (arcpy.Polyline) that is perpendicular to the input line
line_geometry: arcpy.Polyline, the input line
point_geometry: arcpy.Point or arcpy.PointGeometry, the location of the returned line
half_length: length of the perpendicular line to each side of the input line
"""
# clip input line at input point
if isinstance(point_geometry, arcpy.Point):
point_geometry = arcpy.PointGeometry(point_geometry)
clip_extent = point_geometry.buffer(0.1).extent
clipped_line = line_geometry.clip(clip_extent)
# get angle of clipped line -> angle of input line at input point
fp = arcpy.PointGeometry(clipped_line.firstPoint)
lp = arcpy.PointGeometry(clipped_line.lastPoint)
line_angle = fp.angleAndDistanceTo(lp, "PLANAR")[0]
# construct nad return perpendicular line
new_line_points = arcpy.Array([
point_geometry.pointFromAngleAndDistance(line_angle + 90, half_length, "PLANAR").firstPoint,
point_geometry.pointFromAngleAndDistance(line_angle - 90, half_length, "PLANAR").firstPoint,
])
return arcpy.Polyline(new_line_points, spatial_reference=line_geometry.spatialReference)
def _get_buffer_with_flat_ends(line_geometry, buffer_distance):
"""returns a buffer (arcpy.Polygon) with flat ends around the input line
line_geometry: arcpy.Polyline, the input line
buffer_distance: distance of the line to each side of the buffer
"""
# create a normal buffer
buffer = line_geometry.buffer(buffer_distance)
# get perpendicular lines at the line end points
buffer_cutoffs = [
_get_perpendicular_line(line_geometry, line_geometry.firstPoint, buffer_distance),
_get_perpendicular_line(line_geometry, line_geometry.lastPoint, buffer_distance),
]
# cut the buffer with those lines, keep the largest part
for bc in buffer_cutoffs:
buffer_parts = buffer.cut(bc)
buffer = sorted(buffer_parts, key=lambda bp: bp.area)[-1]
return buffer
def buffer(in_features, buffer_distance, out_path, out_name):
"""creates a polygon feature class with flat-end-buffers
in_features: input Polyline feature class path or layer name
buffer_distance: distance of the line to each side of the buffer
out_path: path of the output feature class
out_name: name of the output feature class
"""
# read ObjectID and geometry of line fc
in_data = [row for row in arcpy.da.SearchCursor(in_features, ["OBJECTID", "SHAPE@"])]
# create output fc
out_fc = arcpy.management.CreateFeatureclass(out_path, out_name, "POLYGON")
arcpy.management.AddField(out_fc, "ORIG_FID", "LONG")
# buffer and insert
with arcpy.da.InsertCursor(out_fc, ["ORIG_FID", "SHAPE@"]) as cursor:
for oid, line in in_data:
try:
polygon = _get_buffer_with_flat_ends(line, buffer_distance)
cursor.insertRow([oid, polygon])
except Exception as e:
print(f"Could not buffer line {oid}: {e}")
Call it like this
buffer("TestLines", 200, "C:/Your/output/path", "FlatEndBuffer")
This will probably throw all kinds of errors for complicated geometries, hopefully it helps.
ooh I will give this a try, thank you !
it works thanks, though the get_perpendicular_line is missing underscore at front in 2nd function