Select to view content in your preferred language

Is this functionality possible within a SOI? Is it the best way?

1605
3
08-30-2018 12:14 PM
TimDine
Frequent Contributor

I have a requirement to generate map images with polygons symbolized on data from an external source.  The source is a REST API.  The REST API is fairly elaborate and changing it is not desired.  

I'd like to make a SOI which when requests are made against the MapServer will query the external API, get some more data, mash it together with the geodatabase data, then return the image.  The image needs to be symbolized based on values from the external API.  

Does this sound reasonable through a SOI?  I've seen an example which adds new fields from an external database which looks close to what I want to do.  https://youtu.be/gYmFarHEMgw?t=2639 In order to follow this example, but also symbolize, would I need to symbolize on an existing field in ArcMap and change the values of the field used for symbology with the SOI rather than add a new field?

Do I need to use an SOE instead of SOI if I'm interested in adding parameters to the request?  As in I want to get the image, but with parameter A make call A to the API turning all the polygons red, with parameter B call B and turn all the polygons blue.

Some other options have been considered and rejected.  Pulling the data from a feature service and the REST API and combining the data client side is not desired.

Thanks!

0 Kudos
3 Replies
nicogis
MVP Frequent Contributor

If can be help you can see this soi GitHub - nicogis/ImageProcessing-SOI

In this  line you can loop your polygons (in this link is a point feature class) and you renderer with your function using GDI.

TimDine
Frequent Contributor

That looks very helpful.

If I want to add the ability to change the processing the SOI does from the client side (as in change your ImageProcessingOp) that has to be done with an SOE instead writing a new version of export map because you can't add parameters to an export map request?

If the operationInput did get modified on the client side to add more options, through custom JavaScript code for example, that would be available to the SOI because it doesn't strip things out?

Very basic example, sometimes I want a blue color ramp, sometimes I want it red.  I could add the parameter color=blue to my export map request with some custom JS code in a JSAPI map and the SOI could find that in json.TryGetString("color", ...) and make a decision based on it?  Then I write some custom rendering code to draw an image with those polygons maybe using the CustomGraphics property through IMapDescription of the IMapServer.ExportMapImage method?

I'd keep the regular exportMap code path so that any application other than my custom modified JSAPI page still gets something if it made a request with the SOI enabled?

0 Kudos
nicogis
MVP Frequent Contributor

If you do a custom modified jsapi you can do a soe 

Add ability to change the processing the SOI via client you need change client so you can do a soe. 

Perhaps for soi/parameter you can try add parameter at url proxy in client so you can avoid change client Esri

0 Kudos