Select to view content in your preferred language

Geoprocessing widget has me stumped

2435
4
08-05-2011 07:34 AM
SimonMorgan
Frequent Contributor
I would like to have a GP widget that invovles no map input. It is all give me the input table and the output table and then it saves a feature class to disk. Here is my config file, the GP service runs fine outside of flexviewer. I have tried makign the output params inputs to no avail.

<?xml version="1.0"?>
<configuration label="Message in a bottle">
    <description/>
    <taskurl>http://gis.threeriversparkdistrict.org/ArcGIS/rest/services/GP_Tools/LatLong2UTM/GPServer/Convert%20...</taskurl>
    <helpurl>http://gis.threeriversparkdistrict.org/arcgisoutput/GP_Tools_LatLong2UTM/LatLongtoUTM.htm</helpurl>
    <inputparams>
         <param name="Input_Table"
               defaultvalue="C:\GIS\LatLong_table.dbf"
               label="Input Table"
               required="true"
               type="string"
               visible="true"/>
  <param name="Longitude__X_"
               defaultvalue="Point_X"
               label="Longitude (X)"
               required="true"
               type="string"
               visible="true"/>
  <param name="Latitude__Y_"
               defaultvalue="Point_Y"
               label="Latitude (Y)"
               required="true"
               type="string"
               visible="true"/>
</inputparams>
    <outputparams>
  <param name="Output_Feature_Class"
               defaultvalue="C:\Documents and Settings\gs2\My Documents\ArcGIS\Default.gdb\UTM_output"
               label="Output Feature Class"
               required="true"
               type="featurerecordset"
               visible="true"/>
  <param name="Output_Table"
               defaultvalue="C:\GIS\Output_UTM_table.dbf"
               label="Output Table"
               required="true"
               type="recordset"
               visible="true"/>
    </outputparams>
<!--<layerorder>Input_Point,Output</layerorder>-->
</configuration>

<!--
    See Geoprocessing widget documentation at
    http://links.esri.com/geoprocessingwidget
-->
Tags (2)
0 Kudos
4 Replies
BharathiChandran
Deactivated User
I want to take user input of x,y & name and append the point to SDE feature layer as part of the tool. I am also facing a similar problem. Did you happen to work around the issue?

Bharathi
0 Kudos
DanHaglund
Deactivated User
Anyone find an answer how to add a point by having the user add an XY using the geoprocessing widget?  I'm a little confused, in the documentation it lists "recordset" as a valid input parameter type in the tag documentation, but in the geoprocessing widget documentation it states:

"#2. RasterDataLayer & RecordSet types are not supported as input parameters."
0 Kudos
AnthonyGiles
Honored Contributor
Dan,

If you have the ability to amend the source code it may be easier to create yourself a widget.
If you set yourself two input boxes (in this case one with an id="longText" and one with the id="latText") you can then create a feature set that gets sent to the gp service.

<?xml version="1.0" encoding="utf-8"?>
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
       xmlns:esri="http://www.esri.com/2008/ags"
       xmlns:viewer="com.esri.viewer.*"
     >
<fx:Script>
<![CDATA[

private function AddXY():void
{
var myMapPoint:MapPoint = new MapPoint(Number(longText.text),Number(latText.text),map.spatialReference)
var myFeatureSet:FeatureSet = new FeatureSet([{geometry:myMapPoint}]);
myFeatureSet.geometryType = "esriGeometryPoint";
var params:Object = { 
"Point_Input": myFeatureSet,  //this assumes your gp service is expecting an input called Point_Input
};
gp.execute(params);
}

]]>
</fx:Script>
<fx:Declarations>
<esri:Geoprocessor id="gp" url="your gp URL" useAMF="false" executeComplete="some event "  outSpatialReference="{map.spatialReference}" fault="some event " />
  
</fx:Declarations>

<viewer:WidgetTemplate id="wTemplate"> 

<s:HGroup width="100%" horizontalAlign="left" verticalAlign="middle">
<s:Label width="60" id="latLabel" text="Latitude:" />
<s:TextInput width="100" maxChars="9" id="latText" restrict="0-9\." />
<s:Label width="60" id="longLabel" text="Longitude:" />         
<s:TextInput width="100" maxChars="9" id="longText" restrict="0-9\." />
<s:Button width="100" label="Add XY" click="AddXY()" />
</s:HGroup>

</viewer:WidgetTemplate>

</viewer:BaseWidget>


This will send a single point to the gp service its up to your model what you want to do with it

Hope this is of some help

Regards

Anthony
0 Kudos
BjornSvensson
Esri Regular Contributor
...in the documentation it lists "recordset" as a valid input parameter type in the tag documentation, but in the geoprocessing widget documentation it states: ... "RecordSet types are not supported as input parameters."


Recordset parameters are only supported as output. We will correct the tag reference documentation.
0 Kudos