<?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: arcpy.Warp_management not performing as expected in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609193#M47551</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan for the information and your prompt reply (as always).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data I am attempting to use is in .png format and does need to be scaled as well as moved, hence the warp function being used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say 6 control points - do you mean 3 on the source and 3 on the target? I'm using 2 (or 4, depending on the interpretation). The (p+1)(p+2)/2 formula on the help page tells me 3 points for a 1st order polynomial, so I'll give that a crack tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully an extra control point fixes this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jul 2016 11:06:38 GMT</pubDate>
    <dc:creator>AnthonyCheesman1</dc:creator>
    <dc:date>2016-07-04T11:06:38Z</dc:date>
    <item>
      <title>arcpy.Warp_management not performing as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609191#M47549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - I'm unsure whether this is a Python question or a geoprocessing question. I'll post it here and see how we go.&lt;/P&gt;&lt;P&gt;I am trying to use the 'warp' function in a rather novel way. I have a heap of (~800) individual QR codes, which I'd like to georeference so that they can be displayed as map features.&lt;/P&gt;&lt;P&gt;The QR codes are all the same size and I can use the same reference points, whereas the location to georeference the features 'to' (ie where I want them to sit on the map) will change from code to code. This location is determined by the location of a given point.&lt;/P&gt;&lt;P&gt;I've cobbled together a script to iterate through the codes, and the script runs correctly, but the output features aren't georeferenced at all.&lt;/P&gt;&lt;P&gt;I've also tried georeferencing a single feature via the Toolbox, but that doesn't perform as expected either.&lt;/P&gt;&lt;P&gt;The script (snippet of) I'm using is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_inputs = os.listdir(ws_inputs)&lt;/P&gt;&lt;P&gt;for i in ls_inputs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i[0:-4] in dict_mapcentroid:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Working on", i&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = os.path.join(ws_inputs, i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cent_x = dict_mapcentroid[i[0:-4]][0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cent_y = dict_mapcentroid[i[0:-4]][1]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target_pt = "'11.5 -158.5';'158.5 -11.5'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; source_pt = "'%s %s';'%s %s'" % (cent_x - 1750, cent_y - 1750, cent_x + 1750, cent_y + 1750)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output = os.path.join(ws_outputs, "georef_%s" % i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Warp_management(input, source_pt, target_pt, output, "POLYORDER1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Fail on", i&lt;/P&gt;&lt;P&gt;(dict_mapcentroid refers to a dictionary with the feature name as key, and the coordinates of the centroid as a [x,y] list)&lt;/P&gt;&lt;P&gt;(the reference points are bottom left and top right, the +/- 1750 allow for the scaling of the feature to appear 3 x 3cm at 1:250K)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone shed any light on why this wouldn't be working - or am I simply trying to use a tool in a manner in which it was not intended?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 06:52:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609191#M47549</guid>
      <dc:creator>AnthonyCheesman1</dc:creator>
      <dc:date>2016-07-04T06:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Warp_management not performing as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609192#M47550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The help link has a reference to the minimum number of points required to 'warp' a raster to a new location.&amp;nbsp; You have one, you need 6 for a first order.&amp;nbsp; So the direct answer to your question is, you are using it for the wrong purpose&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/warp.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/warp.htm"&gt;Warp—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is &lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/shift.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/shift.htm"&gt;Shift—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which will get a raster to a new location, however what you are moving would need a known cell size to make it useful.&lt;/P&gt;&lt;P&gt;So if what you are moving, in the form of a raster, has a known cell size and just needs to be moved, you 'shift' it, if there is distortion or the cell size is unknown or just a big picture, you need to warp it.&amp;nbsp; If it is vector data, you need to use the Spatial Adjustment tool &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 08:26:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609192#M47550</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-04T08:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Warp_management not performing as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609193#M47551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan for the information and your prompt reply (as always).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data I am attempting to use is in .png format and does need to be scaled as well as moved, hence the warp function being used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say 6 control points - do you mean 3 on the source and 3 on the target? I'm using 2 (or 4, depending on the interpretation). The (p+1)(p+2)/2 formula on the help page tells me 3 points for a 1st order polynomial, so I'll give that a crack tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully an extra control point fixes this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 11:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609193#M47551</guid>
      <dc:creator>AnthonyCheesman1</dc:creator>
      <dc:date>2016-07-04T11:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Warp_management not performing as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609194#M47552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="background-color: #fefefe; color: #4d4d4d; font-size: 14px; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;&lt;STRONG&gt; It is strongly suggested to use more than the minimum number of&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;&lt;STRONG&gt; links.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 14px; background-color: #fefefe;"&gt;I would go wild and whip in a few more... it is the placement that is important as well... which may seem obvious, but based on lab assignments I have had to deal with... less so than one would imagine&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2016 13:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609194#M47552</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-04T13:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Warp_management not performing as expected</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609195#M47553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Success! 4 reference points has solved the problem.&lt;/P&gt;&lt;P&gt;Thanks for the help Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jul 2016 00:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-warp-management-not-performing-as-expected/m-p/609195#M47553</guid>
      <dc:creator>AnthonyCheesman1</dc:creator>
      <dc:date>2016-07-05T00:36:15Z</dc:date>
    </item>
  </channel>
</rss>

