<?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: Geometry methods in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129035#M10016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You access geometry using cursors and then reading SHAPE field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example where if a polygon contains a point, some attribute from polygon layer is copied to point layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;...
updCursor = arcpy.UpdateCursor(pointLayer)
for updRow in updCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt = updRow.Shape

&amp;nbsp;&amp;nbsp;&amp;nbsp; #copy field values from polygon to point layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; searchCursor = arcpy.SearchCursor(polygonLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in searchCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; poly = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if poly.contains(pnt):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updRow.setValue(copyField, row.getValue(copyField))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updCursor.updateRow(updRow)
...&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:17:10 GMT</pubDate>
    <dc:creator>MarcinGasior</dc:creator>
    <dc:date>2021-12-11T07:17:10Z</dc:date>
    <item>
      <title>Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129030#M10011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I first saw this in 10 I though that would be very cool to do some spatial processing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Never had a chance to try it until a few days ago. As usual I'm stuggling.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have done a whole load of searches here and found plenty of discussion re the accuracy of the integer version of the geometry so that properties are incorrectly reported (like Poly1Geom.area)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But no real info on how to do the geometry comparisons. The help files are a little thin here as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My idea was to load the geometry objects into a python list / dictionary or whatever, to facilitate looping and comparison with other geometry objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The lists load fine and the geometry objects in the list have the usual properties. But when I get to the methods they are always "False". ie Poly1.inside(Poly2) always = False, even when its not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Arc10 SP4 and all this is running python code in IDLE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone got any tips or pointers to some script examples to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 10:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129030#M10011</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2012-05-30T10:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129031#M10012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bump....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So has no one out there used geometry methods?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 08:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129031#M10012</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2012-06-18T08:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129032#M10013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geometry/000v00000095000000/"&gt;Geometry class web help&lt;/A&gt;&lt;SPAN&gt;, there's no &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;inside()&lt;/SPAN&gt;&lt;SPAN&gt; method for this class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Make note that some geometry methods can be applied for specific geometry types only (eg. when you test if point contains polygon, you'll always get False).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want more specific answer, provide your code with description of inputs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 09:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129032#M10013</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-06-18T09:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129033#M10014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Probably meant to say ".within()", but no matter. Just wanted to know if there were any scripts or pointers out there using these methods with objects in a python list or dictionary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All the help seems to build a geometry object from scratch, then do some anlaysis on it. Rather than reading the geometry object from an existing fc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will have another go at this when i have a little more time....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 07:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129033#M10014</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2012-06-19T07:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129034#M10015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Read the examples, this should help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001t000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001t000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geometry/000v00000095000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Geometry/000v00000095000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 07:57:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129034#M10015</guid>
      <dc:creator>FabianBlau</dc:creator>
      <dc:date>2012-06-19T07:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129035#M10016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You access geometry using cursors and then reading SHAPE field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example where if a polygon contains a point, some attribute from polygon layer is copied to point layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;...
updCursor = arcpy.UpdateCursor(pointLayer)
for updRow in updCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt = updRow.Shape

&amp;nbsp;&amp;nbsp;&amp;nbsp; #copy field values from polygon to point layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; searchCursor = arcpy.SearchCursor(polygonLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in searchCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; poly = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if poly.contains(pnt):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updRow.setValue(copyField, row.getValue(copyField))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updCursor.updateRow(updRow)
...&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129035#M10016</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-11T07:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry methods</title>
      <link>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129036#M10017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No worries,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and yes I do read the help files before posting here....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My approach was exactly that, use cursors to cycle through the relavent geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I was reading the geometry objects into a python list first before testing with the various methods.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;N&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 07:25:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geometry-methods/m-p/129036#M10017</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2012-06-25T07:25:34Z</dc:date>
    </item>
  </channel>
</rss>

