Friday 29 May 2015

arcpy - set extent for jpeg programmatically



I feel like this should be easy, but how can I set coordinates for a jpeg image using Python? I have a python add-in that draws a polygon and then uses its geometry to post a query request to a REST endpoint for an Image Service. The JSON return is a .jpg image.


I am able to download the image no problem, but obviously it is not georeferenced because it is just an image. The JSON return does give me the extent of the photo though (UTM 15N). How can I set this extent to be that of the image? I thought about making a world file, but this does not use the extent of a raster.


Here is the JSON return, how can I apply that extent to the downloaded image?


enter image description here


I have looked all over the help docs and cannot find where I can set an extent manually. I was hoping that the arcpy.Raster() class would allow me to set the extent, but that property is read only. Am I missing something obvious? Seems like this should be easy.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...