Select to view content in your preferred language

Viewing Asyncronous Map Result Image Layer

3037
13
08-21-2012 01:49 PM
eddiequinlan
Deactivated User
Hi All,

Not sure if this is a flex issue or geoprocessing issue, but here it goes....

I have a basic geoprocessing model which performs a spatial select on a parcel layer and shows what parcels are selected (very basic at this point).  The model/.mxd runs fine.

I???ve published this model as an asyncronous result map service.

I???ve tested this model thru the ArcGIS Services Directory, by inputting some coordinate input values.  This runs fine and I can see the record count and attributes of the query.

First Question?????????  Can I run the same request thru the Services Directory and see the results as a ???map result???  either graphic or layer on a map?

My FLEX app runs this map service as an asyncronous job and I can see the records/attributes of the request.  What I can???t see is the resulting map image.

I don???t know if my published map is set correctly to display the map results (the reason for my first question), or if my FLEX app is not coded properly.

If I tweak my code and run a syncronous job, I can loop thru the results and shade the map correctly.  I???m trying to use the asyncronous method because of the potentially large amount of processing.  I???ve read just about all the documentation I can find and have tried numerous variations of coding, map service configurations, etc and still cannot get the results.

If I could test the results at the Services Directory and it works, then I would think my FLEX coding is wrong??????.

Any Suggestions?????????

Painfully,
Eddie
Tags (2)
0 Kudos
13 Replies
eddiequinlan
Deactivated User
Hi all,

By using Fiddler and "trace" in Flex, I think I've found the issue.  After my "jobcomplete" function runs and i get a positive result, I then run per the examples:

var myImageLayer:GPResultImageLayer = GP_async.getResultImageLayer(event.jobInfo.jobId,"Results_shp",imageParameters);

where the imageParameters have already been set.

Thru fiddler I can see the 500 error code and object not set.  Now I'm at a loss.  Help.

If I run the same code but as:

GP_async.getResultImageLayer(event.jobInfo.jobId,"Results_shp",imageParameters);

fiddler shows no errors.  I'm not sure why the GPResultImageLayer is not set.  Again as stated previously, I can run the request thru the services directory; get returned results; and view those results thru the Google Earth view.

thank you,
Eddie
0 Kudos
DasaPaddock
Esri Regular Contributor
You can only use getResultImageLayer() if there is a result map service.

You can use Geoprocessor.getResultData() if your service is returning a FeatureSet and then add the features to a GraphicsLayer.

Reference:
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/tasks/Geoprocessor.html#getResultDa...

Sample that calls getResultData():
http://resources.arcgis.com/en/help/flex-api/samples/#/Asynchronous_geoprocessing_Clip_and_ship/01nq...
0 Kudos
eddiequinlan
Deactivated User
Hi Dasa,

Thanx again for the help.  Yes, I'm aware of the two different methods but just can't get the getResultImageLayer() method with the resulting map service to work correctly.  I've given up on that method, and I am using the getResultData() asyncronous and then adding the results as graphics.  In the long run this might prove to be a better way for my needs.  The only drawback I'm finding is that if my return results start to get above 10,000 records adding the graphics takes a while, and the client side can time out.   I've limited the attributes in the results shp/table to only those attributes I need, I have also indexed some of those attributes, and created a spatial index.  Do you have any suggestions on the performance?

Also, I've noticed that when performing a large spatial query thru the map service, the resulting  .dat file in /arcgisserver/arcgisjobs/<path> gets extremely large.  My initial data set is only 113mb with 350,000 records, but when I run a map service geoprocessing query on "say 10,000" records the .dat file size exceeds 250mb.  What's up with that??????

Thank you for your patience,
Eddie
0 Kudos
DasaPaddock
Esri Regular Contributor
Using a result map service would be a good option if you have lots of data. I'd contact Esri Tech Support for both issues.
0 Kudos