I have used Generate near table in model builder and it works fine generating table for the nearest attribute along with nearx, neary coordinates. i can add this to map layer in arcmap using displayXY data option. however i have published my model as Geoprocessing service and than access it using GPtask from my flex application. i used following code to retrieve data. the code is ok it retrieves data i can access it but i am failed to display this on my map . here is my code. i would appreciate any advice as i am stuck.
private function ModelgpResult(event:GeoprocessorEvent):void
{
this.cursorManager.removeBusyCursor();
// Note: As of version 2.0, the executeResult property name changed from 'parameterValues' to 'results'
var parameterValue:ParameterValue = event.executeResult.results[0];
var fset:FeatureSet = FeatureSet(parameterValue.value);
var symbol:SimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, 0xFF0000, 2.5);
symbol.outline = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 0xFF0000, 2.0, 2);
var pop1:Number=fset.features.length;
for each ( var myGraphic:Graphic in fset.features) )
{
myGraphic.symbol=symbol;
clickGraphicsLayer.add( myGraphic );
Alert.show("Distancempevent"+ myGraphic.attributes.NEAR_DIST);
}
if (pop1 > 0)
{
Alert.show("total records " + myNumberFormatter.format(pop1) + " ");
}
else
{
Alert.show("Nobody lives here...");
}
}
i can display the data in alert but i want to display them as point on my map using nearx or neary. am i suppose to create a feature class in model builder but i could not find any tool that can convert the table to featur class.
any help is appreciated
regards
nadee,
private function ModelgpResult(event:GeoprocessorEvent):void
{
this.cursorManager.removeBusyCursor();
// Note: As of version 2.0, the executeResult property name changed from 'parameterValues' to 'results'
var parameterValue:ParameterValue = event.executeResult.results[0];
var fset:FeatureSet = FeatureSet(parameterValue.value);
var symbol:SimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, 0xFF0000, 2.5);
symbol.outline = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 0xFF0000, 2.0, 2);
var pop1:Number=fset.features.length;
for each ( var myGraphic:Graphic in fset.features) )
{
myGraphic.symbol=symbol;
clickGraphicsLayer.add( myGraphic );
Alert.show("Distancempevent"+ myGraphic.attributes.NEAR_DIST);
}
if (pop1 > 0)
{
Alert.show("total records " + myNumberFormatter.format(pop1) + " ");
}
else
{
Alert.show("Nobody lives here...");
}
}
i can display the data in alert but i want to display them as point on my map using nearx or neary. am i suppose to create a feature class in model builder but i could not find any tool that can convert the table to featur class.
any help is appreciated
regards
nadee,