Select to view content in your preferred language

C# or Vb.Net. How to create a buffer at a X.Y and save it in a polygon

2234
1
05-23-2016 07:54 AM
JoseSanchez
Frequent Contributor

Hello everyone,

I am looking for samples in C# or VB.net that explain how to create a polygon using a X,Y coordinate and creating a buffer around it.

Thanks

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

There are a couple ways to do that.

You could use the buffer method of the ITopologicalOperator, which returns a Polygon. That page contains sample code how to do that.

If you want to use a Geoprocessing tool, it's a little more complicated. In one application, I got the X, Y coordinates from a mouse click on the screen and created an in-memory feature class to hold that point. That feature class was the input for the Buffer tool (see this topic as an example). From the buffer tool, I then had the polygon in a feature class.

0 Kudos