buffer lines and points at same time

604
3
07-09-2020 10:21 AM
GinaBrewer-Mills
New Contributor II

Does anyone know if there is a way to say use "Select By Attributes" on both a point and line feature with the same attribute, then buffer that selection with a graphic buffer?

I am basically trying to select some points and lines together and create a bounding box around them. Then I need to retrieve the bounding box coordinates.

Thanks for any help or advice

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Use Envelope in

Minimum Bounding Geometry—Data Management toolbox | Documentation 

on both the points and poly* features to get both their extents,

then use

Append—Data Management toolbox | Documentation 

on both the Envelop files and finally

do a Minimum bounding Geometry Envelope on the resultant.

Add Geometry Attributes—Data Management toolbox | Documentation 

to that file to get the extent coordinates


... sort of retired...
0 Kudos
GinaBrewer-Mills
New Contributor II

Thanks Dan I will give it a shot!

0 Kudos
DanPatterson
MVP Esteemed Contributor

Gina Brewer-Mills

I would be remiss if I didn't provide a numpy lesson

import numpy as np
from numpy.lib.recfunctions import structured_to_unstructured as stu
from arcpy.da import FeatureClassToNumPyArray
f0 = r"C:\Git_Dan\npgeom\Project_npg\npgeom.gdb\Polygons2"
f1 = r"C:\Git_Dan\npgeom\Project_npg\tests.gdb\sq"
a0 = stu(FeatureClassToNumPyArray(f0, ["SHAPE@X", "SHAPE@Y"], explode_to_points=True))
a1 = stu(FeatureClassToNumPyArray(f1, ["SHAPE@X", "SHAPE@Y"], explode_to_points=True))
a01 = np.concatenate((a0, a1), axis=0)
min_xy = np.min(a01, axis=0)
max_xy = np.max(a01, axis=0)

min_xy, max_xy
(array([ 300000.0,  5000000.0]), array([ 300025.0,  5000018.0]))


... sort of retired...