2

I have two datasets - a vector dataset with land cover data and a point dataset. I'm wondering is it possible to create buffers around the points to a set area (not distance) while excluding certain habitats from the buffer.

So the buffer can be any shape, as long as its the required area, but includes only habitats of interest and excludes any polygons with unsuitable habitat.

Any suggestions?

Vince
  • 20,017
  • 15
  • 45
  • 64
  • 2
    Suggest you add some images to your question to explain your issue because when you say things like "..can be any shape...", that's way too vague! – Hornbydd Feb 06 '23 at 18:56
  • 1
    https://gis.stackexchange.com/questions/209047/creating-buffers-of-a-specific-size-and-shape#209115 – FelixIP Feb 06 '23 at 19:24
  • 2
    What's the difference between what you're asking here and doing a normal buffer and an Erase/Difference/Intersect afterward? – Vince Feb 06 '23 at 19:52
  • @Hornbydd apologies, will try to come up with images. Essentially the buffer shape would be determined by the amount of unsuitable habitat in area around the point - since I want the area covered by the buffer to be fixed, the buffer would grow until it reached that size, depending on the extent of unsuitable habitat close to the points. – Colin Guilfoyle Feb 06 '23 at 21:30
  • @Vince with an erase/difference/intersect I cant guarantee the area covered by the buffer will be e.g. 1 km2 since the amount of unsuitable habitat will vary point by point. I dont want the buffer to be a specified radius but a specified area (when unsuitable habitat is accounted for). – Colin Guilfoyle Feb 06 '23 at 21:33
  • @FelixIP thanks for suggestion - similar issue but not quite what I need. – Colin Guilfoyle Feb 06 '23 at 21:34
  • Then you've got an NP problem on your hands, repeatedly buffering, then removing the intersected area, and testing if it's within some tolerance, using increasing and decreasing distances until you meet your criteria, or hit a maximum of attempts and report failure. – Vince Feb 06 '23 at 22:46
  • This is exactly what you need, I'll post the answer with code and images. It's even easier, because we don't need flat end buffers – FelixIP Feb 07 '23 at 00:05

1 Answers1

1

Dissolve suitable land to single feature: enter image description here

Add target area field to your points table:

enter image description here

it can be any positive number.

Add empty polygonal layer with numerical field called AREA to your map:

enter image description here

Script below will constrict 'square' buffers of given (target) area around your points:

import arcpy

suitable,points,buffers = "suitable","points","buffers" ##collection of points and target areas pointsList = [[shp,target] for shp,target in arcpy.da.SearchCursor(points, ("Shape@","target"))] ##shape of suitable land g = arcpy.Geometry() goodLand = arcpy.management.CopyFeatures(suitable,g)[0]

curT=arcpy.da.InsertCursor(buffers,("SHAPE@","AREA")) for pnt,target in pointsList: low = 0.0 high = pow(target,0.5) while True: middle=0.5*(low+high) rect = pnt.buffer(middle).extent.polygon pgon = goodLand.intersect(rect,4) curArea=pgon.area if (high-low)<0.01: break if curArea<target:low=middle else:high=middle curT.insertRow((pgon,curArea))

OUTPUT:

enter image description here

enter image description here

high = 10*pow(target,0.5)

FelixIP
  • 22,922
  • 3
  • 29
  • 61