<?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: &amp;quot;Left-Handed&amp;quot; Geometry in a Spatial Dataframe (with shapely)-- Any way to fix? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071646#M6260</link>
    <description>&lt;P&gt;this won't work&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;shapely.polygon != shape.Polygon&amp;nbsp; (I assume you are wanting to compare to arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;because shapely doesn't have M and Z defined by default.&lt;/P&gt;&lt;P&gt;I would just skip shapely and just indicate that geometry operations are open to arcpy people.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 19:30:28 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-06-23T19:30:28Z</dc:date>
    <item>
      <title>"Left-Handed" Geometry in a Spatial Dataframe (with shapely)-- Any way to fix?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071320#M6255</link>
      <description>&lt;P&gt;I'm trying to do some simple overlays between a couple of spatially enabled dataframes. The layers are coming from feature services, using &lt;STRONG&gt;query(... as_df=True)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;When I attempt an overlay, I get the following message, or something like it:&lt;/P&gt;&lt;PRE&gt;TopologyException: Input geom 1 is invalid: Hole lies outside shell at or near point&lt;/PRE&gt;&lt;P&gt;Which, in many cases, is absolute nonsense, because the geometry in question has no holes. It's not even multipart!&lt;/P&gt;&lt;P&gt;A bit of digging reveals that this is an issue with the right-hand-rule, that the order of vertices in my polygons is causing this behavior. The thing is, I can't find any way to "reverse direction" on polygons, except maybe breaking apart the SHAPE column and reversing the arrays of vertices.&lt;/P&gt;&lt;P&gt;Before I go to all that trouble, I wanted to see if anyone else has encountered this. Any pointers or ideas?&lt;/P&gt;&lt;P&gt;EDIT: I'm in a custom python env, so my SDFs are coming in as shapely geometries. Arcpy is able to handle this, but if possible, I would like to keep this process workable with the ArcGIS Python API only. The resulting script is intended to be run in various settings and by different users, not all of whom are able to utilize arcpy.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 02:26:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071320#M6255</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-23T02:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: "Left-Handed" Geometry in a Spatial Dataframe (with shapely)-- Any way to fix?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071377#M6256</link>
      <description>&lt;P&gt;I would be surprised if the python api doesn't have a builtin method for doing this automatically, since having to use "orient" to change the polygon vertices order seems to be the way to go.&lt;/P&gt;&lt;P&gt;perhaps one of the other spatial representations does the reorientation behind the scenes&lt;/P&gt;&lt;P&gt;&lt;A href="https://shapely.readthedocs.io/en/stable/manual.html#shapely.geometry.polygon.orient" target="_blank"&gt;The Shapely User Manual — Shapely 1.7.1 documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.stackexchange.com/questions/353452/convert-qgis-geometry-into-shapely-geometry-to-use-orient-method-defined-in-shap" target="_blank"&gt;pyqgis - Convert QGIS geometry into Shapely geometry to use orient method defined in Shapely - Geographic Information Systems Stack Exchange&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 08:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071377#M6256</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-06-23T08:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: "Left-Handed" Geometry in a Spatial Dataframe (with shapely)-- Any way to fix?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071513#M6259</link>
      <description>&lt;P&gt;I was surprised myself, but the only reference to polygon orientation in the API is:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Exterior rings are oriented clockwise, while holes are oriented counter-clockwise.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Simply a statement that they &lt;EM&gt;are&lt;/EM&gt; oriented a certain way, but no mention of a way to re-orient a polygon, or what else to do when the orientation does not follow the proper order.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Orient &lt;/STRONG&gt;is the thing I want, but annoyingly, shapely.polygon != shapely.Polygon. Also my features are being returned as MultiPolygon types, so lots of nested iteration to break those out and orient them correctly, then reassemble into a geometry series of multipolygons. Sheesh.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 15:15:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071513#M6259</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-23T15:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: "Left-Handed" Geometry in a Spatial Dataframe (with shapely)-- Any way to fix?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071646#M6260</link>
      <description>&lt;P&gt;this won't work&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;shapely.polygon != shape.Polygon&amp;nbsp; (I assume you are wanting to compare to arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;because shapely doesn't have M and Z defined by default.&lt;/P&gt;&lt;P&gt;I would just skip shapely and just indicate that geometry operations are open to arcpy people.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 19:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071646#M6260</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-06-23T19:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: "Left-Handed" Geometry in a Spatial Dataframe (with shapely)-- Any way to fix?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071652#M6261</link>
      <description>&lt;P&gt;Ha, no, I just meant that the polygon submodule and the Polygon geometry object were literally not equal to one another, i.e., different things. (I should probably leave code conventions out of my narrative text).&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;orient&lt;/STRONG&gt; method takes a Polygon as an argument, so it would be&lt;/P&gt;&lt;PRE&gt;shapely.geometry.polygon.orient(Polygon(some WKT or something))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I'd hoped I could simply call orient on a Polygon object, &lt;STRONG&gt;Polygon.orient()&lt;/STRONG&gt;, but no such luck. Definitely not comparing the actual shapes with anything else.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 19:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/quot-left-handed-quot-geometry-in-a-spatial/m-p/1071652#M6261</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-23T19:38:12Z</dc:date>
    </item>
  </channel>
</rss>

