Select to view content in your preferred language

ArcGIS Server Geometry Service Buffer Polygon

96
1
Jump to solution
3 weeks ago
CaseyBentz
Frequent Contributor

I am working on a project to create a convex hull polygon for a list of points and then take the convex hull polygon and buffer it all using the ArcGIS Server Geometry service end points.

I can create the convex hull fine, but when I run the buffer I get an error message stating that the operation was attempted on an empty geometry. I am using a Jupyter Notebook and the ArcGIS Api for Python to make the calls. I also attempted to take the polygon geometry and use the rest end point directly but get an error message stating "The operation cannot be performed on a non-simple geometry."

I was able to create a buffer of the vertexes from the convex hull polygon, but that is not what we are looking for.

For a test I wrote the convex hull to a hosted feature service because the documentation uses a query of a feature service to get the geometry. Below is the relevant lines from the notebook.

geom1 = Polygon(boundary_layer.query(where="name='test'").features[0].geometry)

buffer = buffer(geometries =[geom1],
  distances=[1000],
  in_sr = {"wkid": 102100},
  unit = LengthUnits.FOOT,
  out_sr = 102100,
  buffer_sr = 102100,
  union_results = False,
  geodesic = True,
  future = False)

0 Kudos
1 Solution

Accepted Solutions
CaseyBentz
Frequent Contributor

I found my answer from an old gis.stackexchange, https://gis.stackexchange.com/questions/361734/why-is-the-arcgis-geometry-buffer-method-failing-on-s...

The trick for me was to use 9003 as the unit rather than the LengthUnits.FOOT from the Esri example...

View solution in original post

0 Kudos
1 Reply
CaseyBentz
Frequent Contributor

I found my answer from an old gis.stackexchange, https://gis.stackexchange.com/questions/361734/why-is-the-arcgis-geometry-buffer-method-failing-on-s...

The trick for me was to use 9003 as the unit rather than the LengthUnits.FOOT from the Esri example...

0 Kudos