GeometryService Buffer action on many features (through JSAPI)

2072
1
09-07-2010 12:56 AM
AndrewJones
New Contributor
I am using the JSAPI to call the GeometryService over REST and return a buffer of many features (0-200). The features are generally very simple polygons (4-10 verticies) but some could have 100 or so.  It seems to be ok for up to about 25 features but the wait time then gets exponentially longer as more features are added.  The XHR call for the GeometryService timesout at 1 minute which basically rules using this out for more than 80 features.

I understand that these geometry actions can be intensive but this seems excessive.  I have a similar action in a WebADF app which can buffer hundreds of features in around 5-10 seconds and update the map so surely the server can handle this kind of request easily?

Are there any guidelines available on the best way to use the GeometryService and its limitations in terms of request sizes?

Just to clarify, I am using a proxy page and JSAPI v1.5.

Any help would be appreciated as my bosses are not too impressed that the 6 year old ArcIMS app this is replacing can do it faster!
0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor
I ran a quick test and was able to buffer 200 features in approximately 3 seconds. It sounds like your scenario is different do you have a code snippet you can post that shows what you are doing.
      function bufferGeom(){
        var geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
        var params = new esri.tasks.BufferParameters();
        params.distances = [10];
        params.unit = esri.tasks.GeometryService.UNIT_KILOMETER;
        params.bufferSpatialReference = map.spatialReference;
        params.outSpatialReference = map.spatialReference;
        var query = new esri.tasks.Query();
        query.where = "OBJECTID < 201";
        featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){
          console.log('selected');
          var infeatures = dojo.map(features,function(feature){
            return feature.geometry;
          });
          params.geometries = infeatures;
          geometryService.buffer(params,showBuffer,function(error){
            console.log("error");
          });
        });
      }
0 Kudos