How to transform images (Flip and Rotate) using Python?

962
5
Jump to solution
09-08-2017 01:43 AM
PeterWilson
Regular Contributor

I have received imagery from a surveyor that is currently falling within the Northern Hemisphere and upside down. The following is easy to resolve if its a CAD drawing using the "Transformations" tab under the properties window of the CAD layer within ArcMap. Is there a way to apply the same transformation using Python for each image tile?

CAD: Transformation

Original Position: Northern Hemisphere and rotated.

CAD: Transformation and Rotation

CAD: Transformed (correct location)

Imagery: Current Imagery (Northern hemisphere and rotated)

Any assistance to achieve the following will be appreciated.

0 Kudos
1 Solution

Accepted Solutions
RichardGeoghegan2
New Contributor II

You could try use the third party 'Pillow' python module.

This should allow you to rotate multiple images at once.

View solution in original post

5 Replies
JayantaPoddar
MVP Esteemed Contributor

Have you tried Flip—Help | ArcGIS Desktop ?



Think Location
DanPatterson_Retired
MVP Esteemed Contributor

I bet you don't have world files for the images... Sounds like a missing negative sign and a flop of the X and Y coordinates...  World files would be a lot faster to fix

RebeccaStrauch__GISP
MVP Esteemed Contributor

I agree with Dan, and would first take a look at the world file first in case a negative sign is missing or reversed.

Some links that might help:

If the world file doesn't work, then I would look into the flip...but make sure you know what the input world file and/or spatial reference is, so you can figure out what you need to correct it.  You can usually find out this info in ArcCatalog with are right-click to look at the properties.

(I don't have any experience with the "pillow" python mod...but I plan to check it out too).

RichardGeoghegan2
New Contributor II

You could try use the third party 'Pillow' python module.

This should allow you to rotate multiple images at once.

PeterWilson
Regular Contributor

Hi Richard

Thanks I clean forgot about Python's Pillow module. I was able to batch all the images and correct them.

0 Kudos