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.
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....