Buffer Parameters

809
9
06-17-2014 11:37 AM
jaykapalczynski
Frequent Contributor
Is there a way to set up Buffer Parameters to create a buffer that will start 2.5 miles out and go to 5 miles?
Maybe something like this?

params.distances = [ 2.5, 5 ];


Although the above selects everything in the 2.5 mile buffer...dosent seem to be working.


var params = new BufferParameters();
 params.geometries  = [ evt.mapPoint ];
 params.distances = [ 2.5 ];
 params.unit = GeometryService.UNIT_STATUTE_MILE;

BufferTool(map, params);  // Call BufferTool function and pass the Buffer Parameters

0 Kudos
9 Replies
JeffPace
MVP Alum
you have two options

1. create two buffers, then subtract the results of the smaller buffer from the larger
2. Create a donut graphic, and then query with that graphic.

I recommend the latter.
0 Kudos
jaykapalczynski
Frequent Contributor
I have been looking up how to create a donut graphic but not much luck.


  1. I do already have a graphic Buffer created at this point.

  2. I am thinking the 1st option might be more feasible but just want to make sure that I am not going to be chewing up to much processing time...

  3. If I buffer the original Buffer How do I subtract the 2 buffers to get the donut buffer...any examples out there on how to subtract one buffer from another?



Thanks
0 Kudos
JeffPace
MVP Alum
not subtracting buffers, subtracting result sets. Comparing geometries of resulting features.  yuck.

Processing would be large.  That is why I recommended the second.
0 Kudos
jaykapalczynski
Frequent Contributor
alright that makes sense...So I have to origiinal map click location where I create the first buffer.
I assume I can use that location to derive the Donut graphic?  Not really sure how to accomplish that....
Can I do that from the XY location of the initial map Click....I think I can get the XY of that initial map click.

I did some searching and am not seeing anything on how to create a donut graphic from a map click

Thanks for your time and help.
0 Kudos
JeffPace
MVP Alum
here is an old link where the user accidentally created a donut using bufferparameters.  might help

http://forums.esri.com/Thread.asp?c=158&f=2396&t=303292
0 Kudos
jaykapalczynski
Frequent Contributor
Not really seeing how this is working.  I see that the Donut is being created on accident when the polygons are overlapping.

I am trying to create a donut from scratch from a user defined XY coordinate (map Click)...
Are you saying to add a 10 mile buffer and then add another, say 5 miles and where they overlap will be empty space?
Not really grasping this.
0 Kudos
JeffPace
MVP Alum
Not really seeing how this is working.  I see that the Donut is being created on accident when the polygons are overlapping.

I am trying to create a donut from scratch from a user defined XY coordinate (map Click)...
Are you saying to add a 10 mile buffer and then add another, say 5 miles and where they overlap will be empty space?
Not really grasping this.


my guess is

1. create a circle using an xy and a radius as a new geometry
2. create a second circle using the same xy and the larger radius.
3. combine the rings from each into a single geometry to create a donut (unsure of this step, that link should help).
4. query with the new donut
0 Kudos
jaykapalczynski
Frequent Contributor
alright will give that a shot....thanks.
0 Kudos
jaykapalczynski
Frequent Contributor
I was able to create two graphic circles as such (see below) but now very very confused on how to take the next step.

Maybe do an "Erase" or something?  But dont want this to get demanding and processing heavy


        var symbol22 = new SimpleFillSymbol().setColor(null).outline.setColor("blue");
        var gl22 = new GraphicsLayer({ id: "circles22" });

 var symbol33 = new SimpleFillSymbol().setColor(null).outline.setColor("red");
        var gl33 = new GraphicsLayer({ id: "circles33" });

        app.map.addLayer(gl22);
        app.map.addLayer(gl33);

        app.map.on("click", function(e) {

          var radius22 = 200000;
          var circle22 = new Circle({
            center: e.mapPoint,
            radius: radius22
          });
          var graphic22 = new Graphic(circle22, symbol22);
          gl22.add(graphic22);

          var radius33 = 100000;
          var circle33 = new Circle({
            center: e.mapPoint,
            radius: radius33
          });
          var graphic33 = new Graphic(circle33, symbol33);
          gl33.add(graphic33);

        });

0 Kudos