How to set Point Graphic feature in Geoprocessing Parameter

420
1
10-11-2017 03:37 AM
Siva_SankaraReddy_T
New Contributor II

I am tried  to run  Buffer.gpk in ArcGIS Runtime for Java 100.1.0 Application. I have Three parameters(Graphic, Distance,output).How to Pass input Point Graphic into GeoprocessingParameters using subclasse GeoprocessingFeatures(Corresponds to GPRecordSet or GPFeatureRecordSetLayer parameter types). please help me.

0 Kudos
1 Reply
EricBader
Occasional Contributor III

Hi Shiva,

Try something like this (pseudo code!):

//create the feature data
List<Field> fields = new ArrayList<>();
fields.add(Field.createString("something", "something", 50));

FeatureCollectionTable table = new FeatureCollectionTable(fields, GeometryType.POINT, SpatialReferences.getWgs84());


List<Feature> features = new ArrayList<>();
Map<String, Object> attributes = new HashMap<>();
Point point0 = yourGraphic.getGeometry();

features.add(table.createFeature(attributes, point0));

table.addFeaturesAsync(features).get(10, TimeUnit.SECONDS);

GeoprocessingFeatures gpFeatures = new GeoprocessingFeatures(table);

parameters.getInputs().put("InputFeatures", gpFeatures);

Let us know if this helps....

0 Kudos