<?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 How to get&amp;#160; XMin, YMin, XMax and YMax values from Multipoint features? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657565#M51160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to extract the XMin, YMin, XMax and YMax coordinate values from a feature without using ArcMap's Field Calculator?&amp;nbsp; Is there a tool or other way to programmatically pull out these particular coordinates?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm in ArcGIS 10.2, working with multipoint features. I also have an ASCII text file with coordinates of each point, if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jan 2015 18:25:21 GMT</pubDate>
    <dc:creator>alexbullen</dc:creator>
    <dc:date>2015-01-29T18:25:21Z</dc:date>
    <item>
      <title>How to get  XMin, YMin, XMax and YMax values from Multipoint features?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657565#M51160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to extract the XMin, YMin, XMax and YMax coordinate values from a feature without using ArcMap's Field Calculator?&amp;nbsp; Is there a tool or other way to programmatically pull out these particular coordinates?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm in ArcGIS 10.2, working with multipoint features. I also have an ASCII text file with coordinates of each point, if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 18:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657565#M51160</guid>
      <dc:creator>alexbullen</dc:creator>
      <dc:date>2015-01-29T18:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get  XMin, YMin, XMax and YMax values from Multipoint features?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657566#M51161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This demo I posted recently, but can't find it now, so I will repost.&lt;/P&gt;&lt;P&gt;It is a demo,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you specify the shapefile name (not tested on anything else)&lt;/LI&gt;&lt;LI&gt;an empty array is produced (arr) to store point objects&lt;/LI&gt;&lt;LI&gt;you provide the fields to query, in this case the FID and Shape (SHAPE@ alias) fields in a search cursor&lt;/LI&gt;&lt;LI&gt;for every for record (row) it gets the extent of the Shape field (ie row[1], as indexed by fieldname)&lt;/LI&gt;&lt;LI&gt;two extent points are obtained extents are printed and the points are added to the array&lt;/LI&gt;&lt;LI&gt;When everything is done, the collected points are converted to a multipoint and finally&lt;/LI&gt;&lt;LI&gt;the extent of all the points is determined&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;hope this gives you some ideas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
input_shp = 'c:/your_path_here/your_shapefile.shp'
arr = arcpy.Array()
with arcpy.da.SearchCursor(input_shp,['FID','SHAPE@']) as cur:
&amp;nbsp; for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = row[1].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; p0 = ext.lowerLeft; p1 = ext.upperRight
&amp;nbsp;&amp;nbsp;&amp;nbsp; print('Extent of shape... {}: '.format(row[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(' X min/max&amp;nbsp; {}, {}'.format(ext.XMin,ext.XMax))
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(' Y min/max&amp;nbsp; {}, {}'.format(ext.YMin,ext.YMax))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arr.add(p0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arr.add(p1)
mp = arcpy.Multipoint(arr)
print('Extent of all {}'.format(mp.extent)) &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657566#M51161</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T03:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get  XMin, YMin, XMax and YMax values from Multipoint features?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657567#M51162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your objective is to create 4 fields with the extent values in it for each feature, you could use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
fc = r"C:\Path\To\Your\fgdb.gdb\FeatureclassName"

flds = ["XMin", "YMin", "XMax", "YMax"]
# add fields to output featureclass
for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(arcpy.ListFields(fc, wild_card=fld)) == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(fc, fld, "DOUBLE")
flds.insert(0, "SHAPE@")

with arcpy.da.UpdateCursor(fc, flds) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = row[0].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds[1:]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[flds.index(fld)] = eval("ext.{0}".format(fld))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:50:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-160-xmin-ymin-xmax-and-ymax-values-from/m-p/657567#M51162</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T03:50:04Z</dc:date>
    </item>
  </channel>
</rss>

