Select to view content in your preferred language

Automized Rectifying with spezified pixel size

10-28-2021 02:08 AM
New Contributor

I have georeferenced plenty of images which I would like to automatically rectify via a Python script. However, I face some troubles in applying a fixed pixel size to all of them.

What we did so far:

1) Setting the Links and exporting them to txt file

2) Update Georeference

3) Update Spatial Reference

4) set arcpy.env.cellSize to 0.000001 ( the data UAV imagery an in EPSG 4326)

4)apply  arcpy.Warp_management(tif_path, source_pnt, target_pnt, out_raster_path, transformation_type, resampling_type) OR arcpy.WarpFromFile_management(tif_path, out_raster_path,Link_txt_file, "POLYORDER2", "BILINEAR")

The warping itself works just fine, but the defined cellSize is not implemented. Are there any hints on what I'm doing wrong or missing out?

Manually rectifying the same image and defining the pixel size works, by the way.However, this is just very unhandy when targeting several hundreds of images...



0 Kudos
2 Replies
by Anonymous User
Not applicable

Hello VeronikaDopper,

Could you provide a code snippet for reference?

For the manual process that works:

Idea 1:

  • In Geoprocessing history --> right-click --> Save as Python Script
  • Do this for each step and put together as one script.

Idea 2:

  • Have you considered using ModelBuilder to set this process up?
  • Run successfully
  • Export to Python File

Maybe these ideas will generate Python scripts that will identify the problem.



0 Kudos
New Contributor III

Hallo Veronika,

I am having the same problem as you: I am trying to substitute the 'georeferencing' => 'rectify' tool by using a python script. So far I use WarpFromFile_management followed by Resample_management.

While this approach works in principle I would like to see alternative ways to rectify and resample an image using arcpy. Did you find a solution?

Kind regards


0 Kudos