<?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: Removing one point from a multipoint feature class in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517910#M17200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might be able to use geoprocessing tools to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Use Multipart To Singlepart tool to convert your multipoint feature class to single points. Each point will carry the ORIG_FID field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select the points you need to delete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Run Delete Features tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Use Dissolve tool with ORIG_FID as the dissolve field. You should get your multipoints back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Nov 2010 20:57:29 GMT</pubDate>
    <dc:creator>DanLee</dc:creator>
    <dc:date>2010-11-06T20:57:29Z</dc:date>
    <item>
      <title>Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517905#M17195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a multipoint feature class generated from LAS to Multipoint. In the data, there are a few erroneous points I'd like to delete. The area covered ranges in elevation from 50 to 250 feet above sea level. What I figured I could do is iterate through all the points and remove any that have a Z value below 0 or above 1000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcgisscripting, os, sys, re
gp = arcgisscripting.create(9.3)

if len(sys.argv)&amp;lt; 2:
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddError("Insufficient parameters.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(2)

ifc = sys.argv[1]
des = gp.Describe(ifc)
sfn = des.ShapeFieldName
oid = des.OIDFieldName

result = gp.GetCount_management(ifc)
cnt = int(result.GetOutput(0))
gp.AddMessage("%d features in feature class." % cnt)
cursor = gp.updatecursor(ifc)
row = cursor.next()
gp.SetProgressor("step", "Iterating through Multipoints...", 0, cnt, 1)
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.GetValue(sfn)
&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; partcount = feat.PartCount
&amp;nbsp;&amp;nbsp;&amp;nbsp; while partnum &amp;lt; partcount:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = feat.GetPart(partnum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((point.z &amp;gt; 1000) or (point.z &amp;lt; 0)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddWarning("Multipoint feature outside of threshold.")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("%d -&amp;gt; %d -&amp;gt; %s" % (row.GetValue(oid), partnum, str(point.z)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feat.Remove(partnum)
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&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; gp.AddMessage(str(partnum) + "-&amp;gt;" + str(point.z))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.SetProgressorPosition()
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cursor.next()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The commented out section, if moved into the if((point.z &amp;gt; 1000) or (point.z &amp;lt; 0)): block will correctly identify the points outside my range. I just don't know how to remove the point in question as I iterate over the array of multipoint parts. I thought I could use the "remove" method on the feature array to remove that specific part, but "feat" does not have the remove method (ie feat.remove(partnum)). point.remove(0) doesn't work either. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I have to reconstruct a multipart feature, omitting any offending points and then replace the record, or is there some way to remove vertices/multipoint parts as I'm walking through?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517905#M17195</guid>
      <dc:creator>JohnReiser</dc:creator>
      <dc:date>2021-12-12T16:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517906#M17196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To remove a row within the feature class you need to use the cursor.deleterow method&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.:&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, os, sys, re
gp = arcgisscripting.create(9.3)

if len(sys.argv)&amp;lt; 2:
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddError("Insufficient parameters.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(2)

ifc = sys.argv[1]
des = gp.Describe(ifc)
sfn = des.ShapeFieldName
oid = des.OIDFieldName

result = gp.GetCount_management(ifc)
cnt = int(result.GetOutput(0))
gp.AddMessage("%d features in feature class." % cnt)
cursor = gp.updatecursor(ifc)
row = cursor.next()
gp.SetProgressor("step", "Iterating through Multipoints...", 0, cnt, 1)
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.GetValue(sfn)
&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; partcount = feat.PartCount
&amp;nbsp;&amp;nbsp;&amp;nbsp; while partnum &amp;lt; partcount:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = feat.GetPart(partnum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((point.z &amp;gt; 1000) or (point.z &amp;lt; 0)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddWarning("Multipoint feature outside of threshold.")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("%d -&amp;gt; %d -&amp;gt; %s" % (row.GetValue(oid), partnum, str(point.z)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # To remove you must use updatecursor.deleterow(&amp;lt;row&amp;gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.deleterow(row)
&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; ###feat.Remove(partnum)
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&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; gp.AddMessage(str(partnum) + "-&amp;gt;" + str(point.z))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.SetProgressorPosition()
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cursor.next()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:35:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517906#M17196</guid>
      <dc:creator>FrankPerks</dc:creator>
      <dc:date>2021-12-11T22:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517907#M17197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That wil remove one record from the feature class. Each record has 3500 LIDAR returns, so removing one record is overkill to rid myself of one erroneous return. I have a few bad returns and they not all within the same record, so removing whole records will leave gaps in my terrain. I need to remove one point within the set of 3500 stored in one record. Multipart to singlepart is not a viable option, as it makes the file sizes increase considerably. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 11:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517907#M17197</guid>
      <dc:creator>JohnReiser</dc:creator>
      <dc:date>2010-10-20T11:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517908#M17198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This seems to work for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting

gp = arcgisscripting.create(9.3)

ifc = r"c:\temp\test.gdb\testMulti"

des = gp.Describe(ifc)
sfn = des.ShapeFieldName
oid = des.OIDFieldName

result = gp.GetCount_management(ifc)
cnt = int(result.GetOutput(0))
gp.AddMessage("%d features in feature class." % cnt)
cursor = gp.updatecursor(ifc)
row = cursor.next()
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.GetValue(sfn)
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointArray = feat.GetPart()
&amp;nbsp;&amp;nbsp;&amp;nbsp; boolNeedsUpdate = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointCount = pointArray.Count
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointIndex = pointCount - 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; while pointIndex &amp;gt;= 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point = pointArray.GetObject(pointIndex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((point.z &amp;gt; 1000) or (point.z &amp;lt; 0)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolNeedsUpdate = 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddWarning("Multipoint feature outside of threshold.")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("%d -&amp;gt; %d -&amp;gt; %s" % (row.GetValue(oid), pointIndex, str(point.z)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointArray.Remove(pointIndex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointIndex -= 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; if boolNeedsUpdate:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("Removing point(s)")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pointArray
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.UpdateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cursor.next()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm doing is getting an array of point objects from the geometry object (GetPart() with no arguments returns an array of points instead of a single point object), then iterating through the array backwards since we're removing items from it, and removing the points with the invalid Z values. After that we set the row's shape to the new pointArray and update the row before moving on to the next row.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:35:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517908#M17198</guid>
      <dc:creator>LoganPugh</dc:creator>
      <dc:date>2021-12-11T22:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517909#M17199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This seems to work for me:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And it works for me, too. Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 01:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517909#M17199</guid>
      <dc:creator>JohnReiser</dc:creator>
      <dc:date>2010-10-21T01:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one point from a multipoint feature class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517910#M17200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might be able to use geoprocessing tools to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Use Multipart To Singlepart tool to convert your multipoint feature class to single points. Each point will carry the ORIG_FID field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select the points you need to delete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Run Delete Features tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Use Dissolve tool with ORIG_FID as the dissolve field. You should get your multipoints back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Nov 2010 20:57:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/removing-one-point-from-a-multipoint-feature-class/m-p/517910#M17200</guid>
      <dc:creator>DanLee</dc:creator>
      <dc:date>2010-11-06T20:57:29Z</dc:date>
    </item>
  </channel>
</rss>

