I have a Python program that is not using arcpy. I need to get an image from a mapservice centered on a single feature using the REST api.
I can call the export method to get a map image:
http://<server>/arcgis/rest/services/<name>/MapServer/export?bbox=<bounds>&f=image
I can also query the mapservice layer using a where clause and get the feature geometry (in my case, it's going to be a polygon feature).
Without using arcpy, is there an easy way to take the polygon's geometry, get a rectangular extent to generate the bounding box necessary to call the export?
What would be ideal is if I could just say "Give me a map image centered on a feature from a layer defined by this where clause" but, unless I'm missing something, you can't do this in one step. Neither can I figure out how to do a Query on a layer and get the extent back instead of just the feature geometry.