Extract Task for multiple services

570
4
09-19-2012 05:37 AM
ManojPavuluri
New Contributor
Hi,

I have created a GP service using the Extract task in 10.1. It works well with one service that is displayed in the map. Clips the layers which are same as the the input layers in the extract service.

Our application uses different map services in it depending on the user. Do I need to create one extract service for each map service on the server? Is there a way to pass layers from any service to the parameter: "Layers_to_Clip".

Thanks

Manoj
0 Kudos
4 Replies
AdamMouton
New Contributor II
Were you ever able to figure this one out?  I created a generic gp with:
Parameter: Layers_to_Clip
    Data Type: GPMultiValue:GPFeatureRecordSetLayer
    Display Name Layers to Clip
    Description: The layers to be clipped. Layers must be either feature or raster layers.
    Direction: esriGPParameterDirectionInput
    Default Value:
    Parameter Type: esriGPParameterTypeRequired
    Category:

I have tried everything I know to put in place of the Layers_to_Clip variable and it either fails or times out.  Overall, all I do so far is:
var queryTask = new esri.tasks.QueryTask(layer.url + "/"+index);
var query = new esri.tasks.Query();      
query.returnGeometry = true;      
query.where = "1 = 1";      
var featureSet = queryTask.execute(query);
dList = new dojo.DeferredList([featureSet]);
dList.then(handleQueryResults);

This gives me the layer results and in the handleQueryResults, I take the results and put them in an array.  Has anyone done this before anywhere.  Seems so simple to create a generic gp for exporting layers so you don't have to add a gp to every map service.  Thanks.
0 Kudos
AdamMouton
New Contributor II
I have even created a featurelayer and passed that into the clip in ship extract task.  It just seems to time out.
var featureLayer = new esri.layers.FeatureLayer(featureURL + "/"+index,{
         mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
         outFields: ["*"]
       });

Has anyone ever exported layers without added the gp service to ever map service?  Just need a generic ExtractDataTask_GPServer that can take in a selected layer from a map service and output the results.  Hard to believe no one has ever done this before.
0 Kudos
AdamMouton
New Contributor II
Does anyone at ESRI know how to do such a simple task or is this no longer available?
0 Kudos
AdamMouton
New Contributor II
------ Fist bump -------
0 Kudos