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
https://pro.arcgis.com/en/pro-app/latest/tool-reference/feature-analysis/an-overview-of-the-standard-feature-analysis-toolbox.htm
This is pretty urgent, thanks !
You are right. when basic license the tool looks like this
With advanced it is
should have tested in a fresh environment... fixed it in my answer.
it works thanks, though the get_perpendicular_line is missing underscore at front in 2nd function
Thanks for all the help guys!
ooh I will give this a try, thank you !
ok thank you. My licence must have changed from advanced to standard. I thought I was going crazy because I distinctly remembered you could change end lines etc with Arc but just could not find it! thanks for looking into it
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.
ah that is useful, thank you!
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
According to the help pages JohannesLindner is right - you need a advanced license in Pro 2.8 and 2.9. Also in ArcMap 10.6.1 you need a advanced license ... https://pro.arcgis.com/de/pro-app/latest/tool-reference/analysis/buffer.htm
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?
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
let me check this for you
has that been recently updated - as I have used it before ?
I have this - do I need an advanced licence?
in the buffer tool in the screendump you have the side option.
can you post an image what you want to achieve?
I believe the line end option is only available with an Advanced license.
also there was an option where you could only choose do buffer on left side or right side etc
Hi Stefan - this tool does not have the end type option?
Hi @FraserB
Go to the Geoprocessing tab, search for buffer and select the tool you want
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.