Options for georeferencing JPG images with arcpy

619
2
04-13-2022 11:21 AM
EricEagle
Occasional Contributor III

I am working with a library of overhead images accessible via simple REST endpoint.

The workflow I'd like to have is that a user can query this library by their current ArcGIS Pro, active map view extent.  That part works fine and I generate a series of polygon footprints onto the map.

However, there's a small overview image associated with each record that I'd like to pull in and display on the map, doing a simple 4-corner georeferencing of the overview JPG with its corresponding polygon.

However searches for georeferencing via arcpy aren't turning up a lot.  How should I go about displaying these overview images on the map?

Tags (2)
0 Kudos
2 Replies
SteveCole
Frequent Contributor

I'm just thinking out loud but since you're working in ArcGIS Pro and not over the web exclusively, how about downloading a copy of the image from the REST endpoint to a given folder on the user's machine, create a world file for the JPG in the same folder, and then add the image to the map? You seem to have access to the 4 corner coordinates so I think you have enough information to work off of.  Download one of those files and then work through it manually and then automate it based on what you learn.

0 Kudos
EricEagle
Occasional Contributor III

Yeah, been trying this with zero success in ArcGIS Pro.  I think I'll have to use gdal in this case, convert the jpg to a tiff, and issue the tie points in memory (ArcGIS wants a text file/csv).  More straightforward.  Thankfully since Pro's default python ships with gdal now, I can offer it to users with no dependency friction.