<?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 I want to calculate the width of a shapefile or the distance btw 2 shapefiles in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719102#M55701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to calculate the width of a polygon feature or get the distance between two line features. All I have for the first scenario is how to calculate the length, I want to be able to use arcpy to get the width of a polygon feature and pass the result into a what if statement. I want to use arcpy to get the distance between two line features and pass the result into a what if statement. Any suggestion(s)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Oct 2013 13:55:13 GMT</pubDate>
    <dc:creator>OLANIYANOLAKUNLE</dc:creator>
    <dc:date>2013-10-08T13:55:13Z</dc:date>
    <item>
      <title>I want to calculate the width of a shapefile or the distance btw 2 shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719102#M55701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to calculate the width of a polygon feature or get the distance between two line features. All I have for the first scenario is how to calculate the length, I want to be able to use arcpy to get the width of a polygon feature and pass the result into a what if statement. I want to use arcpy to get the distance between two line features and pass the result into a what if statement. Any suggestion(s)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 13:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719102#M55701</guid>
      <dc:creator>OLANIYANOLAKUNLE</dc:creator>
      <dc:date>2013-10-08T13:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: I want to calculate the width of a shapefile or the distance btw 2 shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719103#M55702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could cursor through each of the geometries of the 2 features you are interested in and get the X,Y coordinates of each of the vertex's in both features.&amp;nbsp; Then using some basic TRIG - get the distance between each vertex in both datasets.&amp;nbsp; This link shows how to read XY coordinates of polylines and polygons using Arcpy:&lt;/SPAN&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 16:31:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719103#M55702</guid>
      <dc:creator>DarrylKlassen</dc:creator>
      <dc:date>2013-10-08T16:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: I want to calculate the width of a shapefile or the distance btw 2 shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719104#M55703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Similarly, you can get XMin, Ymax, etc. from the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Describe/000v00000026000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Describe &lt;/A&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Dataset_properties/000v0000002m000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Dataset&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Extent/000v0000006r000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;Extent &lt;/A&gt;&lt;SPAN&gt;object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

# Create a Describe object from the shapefile
#
desc = arcpy.Describe("C:/data/centerlines.shp")

# Print dataset properties
#
print "Dataset Type: " + desc.datasetType

extent = desc.Extent
print "Extent:"
print "&amp;nbsp; %s: %f, %s: %f, %s: %f, %s: %f" % ("XMin", extent.XMax, "XMax", extent.XMax, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "YMin", extent.YMin, "YMax", extent.YMax)
print "MExtent: " + desc.MExtent
print "ZExtent: " + desc.ZExtent

SR = desc.spatialReference
print SR.name
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:47:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719104#M55703</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T06:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: I want to calculate the width of a shapefile or the distance btw 2 shapefiles</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719105#M55704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The geometry methods are very useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;like :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 dist = geom1.distanceTo(geom2)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the Café Python page for some useful tips.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://arcpy.wordpress.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://arcpy.wordpress.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-calculate-the-width-of-a-shapefile-or/m-p/719105#M55704</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-12T06:47:10Z</dc:date>
    </item>
  </channel>
</rss>

