Scenario: For my prototype I have published a service with one layer. The layer has 3 polygons with an entitlement attribute. Only one polygons entitlement is set to true. I need to write an SOE (in Java) to draw the polygons return an image, the polygon with the attribute set to true needs to be drawn differently, maybe a thicker line or an additional inner border or something along those lines. Unfortunately I don't have the luxury of drawing the polygons client side due to the shear volume of features.
I've worked through the bundled SDK samples but can't find anything appropriate.
So my questions are:
Thank you
Yes you can return a image:
else if (outputFormat == "image")
{
responseProperties = "{\"Content-Type\" : \"image/png\"}";
return Helper.ImageToByte(image, System.Drawing.Imaging.ImageFormat.Png);
}
public static byte[] ImageToByte(Image img, System.Drawing.Imaging.ImageFormat format)
{
byte[] byteArray = new byte[0];
using (MemoryStream stream = new MemoryStream())
{
img.Save(stream, format);
stream.Close();
byteArray = stream.ToArray();
}
return byteArray;
}
For change render I advise use dynamic layer: About dynamic layers—Documentation (10.3 and 10.3.1) | ArcGIS Enterprise (for details see 'Changing symbols and renderers' Alternatives to server object extensions—Documentation (10.3 and 10.3.1) | ArcGIS Enterprise )