Select to view content in your preferred language

create line graphic in WAB

7516
58
Jump to solution
08-26-2015 08:54 AM
TerryGustafson
Frequent Contributor

I'm wondering if anyone has generated a simpleLine Symbol in WAB.  I'm wanting to pass a start and end location offset and return a line symbol from the entered values.  does anyone know of an example out there to look at?

TIA

0 Kudos
58 Replies
TerryGustafson
Frequent Contributor

I think I have the GP service correct now..  can you see it?

https://app.mdt.mt.gov/arcgis/rest/services/LRS/ReturnRouteSegment/GPServer/ReturnRouteSegment

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Terry,

   So the parameters look fine now that you have an output of a feature. Have you tested this GP just using the url or from ArcMap?

0 Kudos
TerryGustafson
Frequent Contributor

I connected to the server via arc catalog but not sure how to test it as I have not given it any input parameters.. Not sure if that makes sense..

0 Kudos
TerryGustafson
Frequent Contributor

I’m sorry I spoke to soon, it is returning the values correctly… Now I need to pass the values to the GP service. The GP service will process will select the corridor the from_point and the to_point and plot the line as a graphic…

Sounds easy enough for someone who is smart.. ☺

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Terry,

   I am not sure what you are suppose to be passing as the input... You now have the input as a recordset with fields for Corridor, from_offset, to_offset. so when you say you tested it and it worked what did you supply as the input?

0 Kudos
TerryGustafson
Frequent Contributor

Here are screen shots of the input and the return segment. I entered the corridor route C000001E and then the to and from offsets and it returns the line to the map.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Terry,

  There is something not setup correctly on your GP service because I can get no actual geometry results back from the GP when submitting the same inputs you are using in ArcMap.

Input:

{
 "paramName": "Route_Points",
 "dataType": "GPRecordSet",
 "value": {
  "displayFieldName": "",
  "fields": [
  {
  "name": "OBJECTID",
  "type": "esriFieldTypeOID",
  "alias": "OBJECTID"
  },
  {
  "name": "Corridor",
  "type": "esriFieldTypeString",
  "alias": "Corridor",
  "length": 50
  },
  {
  "name": "from_offset",
  "type": "esriFieldTypeInteger",
  "alias": "from_offset"
  },
  {
  "name": "to_offset",
  "type": "esriFieldTypeInteger",
  "alias": "to_offset"
  }
  ],
  "features": [{
  "OBJECTID": 1,
  "Corridor": "C000001E",
  "from_offset": "100.59",
  "to_offset": "256.236"
  }],
  "exceededTransferLimit": false
 }
}

Output results:

{
 "paramName": "Route_Points_Events",
 "dataType": "GPFeatureRecordSetLayer",
 "value": {
  "displayFieldName": "",
  "geometryType": "esriGeometryPolyline",
  "spatialReference": {
  "wkid": 32100,
  "latestWkid": 32100
  },
  "fields": [
  {
  "name": "OBJECTID",
  "type": "esriFieldTypeOID",
  "alias": "OBJECTID"
  },
  {
  "name": "Corridor",
  "type": "esriFieldTypeString",
  "alias": "Corridor",
  "length": 50
  },
  {
  "name": "from_offset",
  "type": "esriFieldTypeInteger",
  "alias": "from_offset"
  },
  {
  "name": "to_offset",
  "type": "esriFieldTypeInteger",
  "alias": "to_offset"
  },
  {
  "name": "Shape_Length",
  "type": "esriFieldTypeDouble",
  "alias": "Shape_Length"
  }
  ],
  "features": [{
  "attributes": {
  "OBJECTID": 1,
  "Corridor": null,
  "from_offset": null,
  "to_offset": null,
  "Shape_Length": 0
  },
  "geometry": {"paths": []}
  }],
  "exceededTransferLimit": false
 }
}

Just because a GP working in ArcMap does not mean that you have it setup properly to work with ArcGIS Server as a service. You may need to read up on using a scratchGDB when publishing GP Services.

0 Kudos
TerryGustafson
Frequent Contributor

ok, thanks for letting me know, I assumed it was working correctly if it was working in ArcMap. I will look into the scratchGDB.. Thank you

0 Kudos
TerryGustafson
Frequent Contributor

Sorry to bug you this early but I saw the inputs and the outputs you had posted. How did you run those so that it returned the null values?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Terry,

   You can test your GP Service just by going to the service url in you browser and clicking the submit job link at the bottom of the page.