<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: python code  to georeference image in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725677#M41103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"besmart"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Niklas's suggestion, to use a World file would work, but could have issues in determining a correct rotation and scaling to apply and would have to be replicated for each image being processed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think your task can be done programmatically directly in Python with the &lt;/SPAN&gt;&lt;STRONG&gt;Warp (Data Management)&lt;/STRONG&gt;&lt;SPAN&gt; raster tool. Which actually is the same logic used for the interactive Georeference Tool in ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Documentation and examples are here by release:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Warp_management in &lt;/SPAN&gt;&lt;STRONG&gt;arcpy&lt;/STRONG&gt;&lt;SPAN&gt; Python site package in &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Warp/00170000007v000000/"&gt;ArcGIS 10 &lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Warp_management in &lt;/SPAN&gt;&lt;STRONG&gt;arcgisscripting&lt;/STRONG&gt;&lt;SPAN&gt; Python module in &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1898&amp;amp;pid=1891&amp;amp;topicname=Warp_%28Data_Management%29"&gt;ArcGIS 9.3&lt;/A&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep in mind that your images actually have two sets of coordinates, the 0,0 relative (x,y) of the raster and a corresponding (x',y') projected value--use the pairing as the &lt;/SPAN&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;SPAN&gt; -- &lt;/SPAN&gt;&lt;STRONG&gt;to&lt;/STRONG&gt;&lt;SPAN&gt; as control for the warp (as in the Georeference Tool).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you work in the same projection as corner points of the images, the POLYORDER1 "AFFINE" transform should work well using the corners as controls. Appropriate if your images are scans of existing maps sheets. But for images other than scanned maps (or if "reprojecting") you may need the more complex "fitting" of a higher order transformation to better register the input raster.&amp;nbsp; You probably don't want to resample so just accept the default NEAREST option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pick a raster output format and first try a couple from the Python IDLE command line. Then script a loop through a file list of images and associated control points/corners. You'll end up with two sets of rasters--the originals and the output of the Warp. Alternatively you can output directly as ESRI grid into a File Geodatabase Raster dataset ready to use in ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stuart&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Nov 2010 17:00:20 GMT</pubDate>
    <dc:creator>V_StuartFoote</dc:creator>
    <dc:date>2010-11-27T17:00:20Z</dc:date>
    <item>
      <title>python code  to georeference image</title>
      <link>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725675#M41101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can i get python code&amp;nbsp;&amp;nbsp; to auto georeference image. The projection is known and the four coordinates x,y of the corners of the image are known.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently , i do georeference&amp;nbsp; manually by the gereference tool , but i want to automate these tasks for about 200+ image raster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Nov 2010 07:49:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725675#M41101</guid>
      <dc:creator>besmartbesmart</dc:creator>
      <dc:date>2010-11-26T07:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: python code  to georeference image</title>
      <link>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725676#M41102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think it should be possible do automate this task. The steps you need to take is to first create a world file for each image. The world file is usually a text file with the same name as the image file, but a different extension (e.g. tfw for tif). The world file contains the coordinates of one of the corners, the rotation of the image, and the scale in the x and y directions. These numbers should be easy to calculate given that you have all for corners of you imaga.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you have the world file you can add it to the map and it should end up in the correct spot, if they are in the same projection, but the projection information for the image is still missing. To add that just use the ArcToolbox tool Define projection.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Nov 2010 03:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725676#M41102</guid>
      <dc:creator>NiklasNorrthon</dc:creator>
      <dc:date>2010-11-27T03:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: python code  to georeference image</title>
      <link>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725677#M41103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"besmart"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Niklas's suggestion, to use a World file would work, but could have issues in determining a correct rotation and scaling to apply and would have to be replicated for each image being processed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think your task can be done programmatically directly in Python with the &lt;/SPAN&gt;&lt;STRONG&gt;Warp (Data Management)&lt;/STRONG&gt;&lt;SPAN&gt; raster tool. Which actually is the same logic used for the interactive Georeference Tool in ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Documentation and examples are here by release:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Warp_management in &lt;/SPAN&gt;&lt;STRONG&gt;arcpy&lt;/STRONG&gt;&lt;SPAN&gt; Python site package in &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Warp/00170000007v000000/"&gt;ArcGIS 10 &lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Warp_management in &lt;/SPAN&gt;&lt;STRONG&gt;arcgisscripting&lt;/STRONG&gt;&lt;SPAN&gt; Python module in &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1898&amp;amp;pid=1891&amp;amp;topicname=Warp_%28Data_Management%29"&gt;ArcGIS 9.3&lt;/A&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep in mind that your images actually have two sets of coordinates, the 0,0 relative (x,y) of the raster and a corresponding (x',y') projected value--use the pairing as the &lt;/SPAN&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;SPAN&gt; -- &lt;/SPAN&gt;&lt;STRONG&gt;to&lt;/STRONG&gt;&lt;SPAN&gt; as control for the warp (as in the Georeference Tool).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you work in the same projection as corner points of the images, the POLYORDER1 "AFFINE" transform should work well using the corners as controls. Appropriate if your images are scans of existing maps sheets. But for images other than scanned maps (or if "reprojecting") you may need the more complex "fitting" of a higher order transformation to better register the input raster.&amp;nbsp; You probably don't want to resample so just accept the default NEAREST option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pick a raster output format and first try a couple from the Python IDLE command line. Then script a loop through a file list of images and associated control points/corners. You'll end up with two sets of rasters--the originals and the output of the Warp. Alternatively you can output directly as ESRI grid into a File Geodatabase Raster dataset ready to use in ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stuart&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Nov 2010 17:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725677#M41103</guid>
      <dc:creator>V_StuartFoote</dc:creator>
      <dc:date>2010-11-27T17:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: python code  to georeference image</title>
      <link>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725678#M41104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks vsfoote and&amp;nbsp; Niklas for suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i found Warp&amp;nbsp; is what i need. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i used the script in the given link arcgis 9.3 , but the georeference was not valid when i add the raster to arcmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but , when i used the warp toolbox GUI directly and set the projection from within environment, the result was valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that i should&amp;nbsp; set the projection first , before starting warp.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Nov 2010 11:58:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/python-code-to-georeference-image/m-p/725678#M41104</guid>
      <dc:creator>besmartbesmart</dc:creator>
      <dc:date>2010-11-30T11:58:09Z</dc:date>
    </item>
  </channel>
</rss>

