Select to view content in your preferred language

Convert GPFeatureRecordsetLayer to FeatureLayer?

3554
4
04-22-2010 10:06 AM
MaryEllen_Perko
Frequent Contributor
Hello.  Does anyone know if it is possible to turn a GPFeaureRecordSetLayer returned from an ArcGIS Server geoprocessing service into a FeatureLayer?  I see that you can use Mapping.FeatureLayer.OpenFromTable(Table) to create a feature layer from an in-memory table.  It seems like I could use this.  But I don't see if/how I can convert the returned GPFeaureRecordSetLayer into the needed Table. 

Thanks,
Mary Ellen
0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor
Mary,

Within the current API there is no way to create a new FeatureLayer. However - there may be other alternatives here:

1. Is the OOTB GP support (via the Analysis Gallery) sufficient for your GP service / requirements?
2. Create Notes (or Folders of Notes) to represent the features being returned from your GP Service.
3. In ArcGIS 10 there's a new GP tool called "Package Layer" which you could add at the end of your GP Model to export a Layer Package of the results then programmatically down that and add to Explorer via the API.
4. Again in ArcGIS 10 - ArcGIS Server this time - there's a new option to request GP Service output results as a Layer Package.

So 2 is probably the best way forwards for you in the current Explorer 1200 API with ArcGIS 9.X.

Regards

Mike
0 Kudos
MaryEllen_Perko
Frequent Contributor
Mike,

Thanks for getting back to me so quickly.  I thought I'd get an email and never checked back until now.

I appreciate all of your ideas.  Very helpful.

The purpose of trying this was to a) avoid too many features in a Note as the geoprocessing service could return hundreds of features and b) have better symbology options (e.g. transparency). 

So, since, as you suggest, #2 seemed to be my only option at the moment, I just created an add-in that represents returned features as one entity with many graphics that the user can move through using a datagridview.  Then, the user can add the features to the map content as a Note, but at least the user is deciding if they want to manage the information that way.

Looks like I may have better options with 10.  And I doubt I�??ve fully explored the new Analysis Gallery functions.

Anyway, thanks again.

Mary Ellen
0 Kudos
BillHoney
Occasional Contributor
I wonder if one of you could post the code for creating Notes from GPFeatureRecordSetLayer.

For the life of me,  I can't figure out how to cast from GPFeatureRecordSetLayer to any sort of geometry that is understood by Explorer. 

I am using Explorer 1750 & server 10 - is there a slicker way of doing this now ?

Regards,   Bill
0 Kudos
MaryEllen_Perko
Frequent Contributor
Hi.  If you still need it, I posted some code under the thread, http://forums.arcgis.com/threads/3552-Transfer-Explorer-Point-to-ArcGIS-Server-Geoprocessing-Service....  Since you are working with version 10, though, I would suggest you explore some of the newer options.  I think, anyway, that notes can be a bit cumbersome for the user.

Thanks,
Mary Ellen
0 Kudos