1

What is the correct command line for using warp_management in Python (ArcGIS 10.1), to convert several georeferenced .tif's (or folders) with XML world files to GeoTIFF's with permanently written Metainfo (Georeference, Projection)?

Export data, warp tool, Raster to other format, QGIS conversion did not work. I am working with ArcGIS 10.1 and QGIS 2.12.

1
  • As per the tour there should be only one question per question.
    – PolyGeo
    Commented Jan 20, 2016 at 20:03

2 Answers 2

1

ArcGIS supports a number of methods to georeference an image. IMHO its a matter of taste, what methods are associated with georeferencing, and what with "undoing" projection or distortion.

The simplest of them, the affine or 1st Order Polynomial supports translation, rotation, and scaling. This one is parameterized by the numbers saved in a "world file", the tfw file accompanying a tif for example.

All other methods, eg. 2nd and 3rd Order, need more (and other) parameters then this, saved in a world file. So when your tif files are georeferenced with one of these higher order methods, you cannot have a world file.

Since ArcGIS do not bake this info into the image, but supports it transparent to the user by maintaining these XML files, you get interoperability problems.

AFAIK QGIS/GDAL do not support this aux.xml stuff. Thus you only read the image, but not the georeference info.

A way to handle this situation is to run the rectify command in ArcGIS, which writes a permanently georeferenced image (and the world file). By thousands of files this is best done with a python script. Use the well sounding method arcpy.Warp_management(), with empty source_pnt/target_pnt (or some dummy points as the image is already georeferenced) and algorithm POLYORDER1.

1

You have Georeferenced images that you want to Rectify. There doesn't seem to be a command line Tool that mimics the one on the Georeferencing Toolbar, Rectify.

I found a script, by Rob, that reads the control Points from the .tif.aux.xml file and passes this info to the Warp command, outputing a warped image.
Please see the script at the end of this post, by Rob.

Automate creating Rectified files from georeferenced images

I had to make a few minor edits to the script to get it to run. I have ArcGIS 10.3 installed.

Add to the top of the script:
import os
import arcpy

Remove or Comment out these 2 lines:
source_pnt = gpc_string
target_pnt = tgpc_string

Warp doesn't define the Spatial Reference for the geotiff. To add the Spatial Reference to the Geotiff, I executed this ArcGIS tool:

Data Management Tools
Projections and Transformations
Define Projection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.