Make featureCollection

Discussion created by citizens on Jul 17, 2012
Has anybody written any Python code to create a JSON representation of a featureclass, specifically a featureCollection that can be consumed in a Javascript API app as a FeatureLayer?

Similar, or rather the same, to what is returned from the Javacript API sample "Add Shapefile":

Or is there an arcpy function that can do this?

Just want to check before I run and recreate the wheel.

The GPFeatureRecordSetLayer that is returned by a geoprocessing service is too light weight, i.e. lacks many of the JSON object name/value pairs of shapefile attribute information.