<?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: #QNAN problem with a polygon geometry when using argisscripting module... why?? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627807#M48903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just some first thoughts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The geoprocessor you are using is rather outdated: try replacing &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, try replacing the arcgisscripting geoprocessor with the arcpy python module geoprocessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This can be more complex than just typing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy as gp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;because a number of tool arguments (and the objects they return) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;changed with arcpy....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2014 18:08:52 GMT</pubDate>
    <dc:creator>markdenil</dc:creator>
    <dc:date>2014-05-05T18:08:52Z</dc:date>
    <item>
      <title>#QNAN problem with a polygon geometry when using argisscripting module... why??</title>
      <link>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627806#M48902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are using Python v2.6 with ArcGIS 10.&amp;nbsp; I am trying to debug an issue with an application we inherited and ran across an odd issue.&amp;nbsp; There is a process that takes KML files and ingests the polygon objects into an geodatabase.&amp;nbsp; Each KML contains only polygon objects and each polygon contains 5 coordinates (the 5th to close the polygon).&amp;nbsp; For the vast majority of KML items, there is no problem but we have recently run into a #QNAN (Quiet Not A Number) error on some of them.&amp;nbsp; In debugging the code, the error is caused when the string value #QNAN is used in a float() operation.&amp;nbsp; we found that the #QNAN value was being produced from the process in creating a polygon geometry object using the arcgisscripting module.&amp;nbsp; More specifically, the polygon object's extent contains #QNAN rather than coordinates.&amp;nbsp;&amp;nbsp;&amp;nbsp; I loaded the KML polygon placemark definition in Google Earth and all seems fine.&amp;nbsp; The polygon looked to be a sliver that was roughly 76,000 sq meters.&amp;nbsp; I fiddled with the latitude coordinates a bit to make the polygon slightly larger and found that it would NOT fail when the polygon was little bigger (ie more area).&amp;nbsp; This made me think that the arcgisscripting module could not generate a valid polygon object if the polygon's bounding coordinates were below some threshhold.&amp;nbsp;&amp;nbsp; This seemed a little odd though for a polygon that was 76,000 sq meters, which while not large, is not small.&amp;nbsp; Below is the info concerning the coordinates and arcgsiscripting code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;coords = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; +12.572777777999988,56.27499999999998&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; +12.572777777999988,56.27583333299998&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; +12.58611111099998,56.27583333299998&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; +12.58611111099998,56.27499999999998&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; +12.572777777999988,56.27499999999998&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Overwriteoutput = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.OutputCoordinateSystem = "Coordinate Systems/Geographic Coodinate Systems/World/WGS 1984.prj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.........&amp;nbsp;&amp;nbsp; # Add points to an array&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;poly = gp.createObject("geometry", "polygon", array)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;poly.extent would then = 1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In fiddling with the latitude, for eaxmple, I would change 56.27583333299998 to 56.279 and it would work.&amp;nbsp; There was some threshold to get it to work.&amp;nbsp; Using 56.276 and 56.277 would not work as well.&amp;nbsp; Again, this problem occurs for only a small number of the KML polygon placemarks.&amp;nbsp; I don't know exactly how many, however, because when one of these particular polygons is encountered during the ingest, the rest of the KML is not processed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ran tests using arcpy instead of arcgisscripting and found that the problem did not exist.&amp;nbsp; At first the results were showing that even the arcpy version was failing because it was giving 1.#QNAN as well, until I realized that I had not added the coordinate system.&amp;nbsp; Then it worked fine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So......&amp;nbsp; my conclusion is that the arcgisscripting module has some limitation on creating polygon objects that are smaller than some threshhold, but what gets me is that a polygon rectangle of roughly 76,000 sq meters does not seem small.&amp;nbsp; Maybe it isn't so much the area but how narrow the latitude or longitude bands are.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any thoughts on whether this is in fact an arcgisscripting limitation??&amp;nbsp; My hope is that it can still work properly with aercgisscripting if X or Y is changed because moving to arcpy may be out of the question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any thoughts - Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 12:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627806#M48902</guid>
      <dc:creator>PeterLen</dc:creator>
      <dc:date>2014-05-05T12:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: #QNAN problem with a polygon geometry when using argisscripting module... why??</title>
      <link>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627807#M48903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just some first thoughts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The geoprocessor you are using is rather outdated: try replacing &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, try replacing the arcgisscripting geoprocessor with the arcpy python module geoprocessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This can be more complex than just typing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy as gp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;because a number of tool arguments (and the objects they return) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;changed with arcpy....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 18:08:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627807#M48903</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2014-05-05T18:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: #QNAN problem with a polygon geometry when using argisscripting module... why??</title>
      <link>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627808#M48904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;While it is not clear why moving to arcpy is "out of the question",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest at least trying the updated version of arcgisscripting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 18:13:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627808#M48904</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2014-05-05T18:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: #QNAN problem with a polygon geometry when using argisscripting module... why??</title>
      <link>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627809#M48905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply.&amp;nbsp; I should have mentioned in the original text that I did try .create(9.3) (and create(10) if that even exists) but that did not fix it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks - Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 18:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/qnan-problem-with-a-polygon-geometry-when-using/m-p/627809#M48905</guid>
      <dc:creator>PeterLen</dc:creator>
      <dc:date>2014-05-05T18:43:07Z</dc:date>
    </item>
  </channel>
</rss>

