<?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 Issue with creating multipoints and running the symmetrical difference analysis? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290146#M67668</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a script that is designed to quickly analyze thousands of points to determine if there are any intersecting points. If there are any intersecting points, run the geometry analysis to get all of the intersecting points. Use the symmetrical difference analysis to get all points that do not intersect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;InFeatureMPoint, RefFeatureMPoint = arcpy.Multipoint(arcpy.Array([arcpy.Point(*x) for x in ListACoords])), arcpy.Multipoint(arcpy.Array([arcpy.Point(*x) for x in ListBCoords]))

UnMatched = InFeatureMPoint^RefFeatureMPoint&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the&amp;nbsp;symmetrical difference analysis; I keep getting and error stating:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;return convertArcObjectToPythonObject(self._arc_object.symmetricdifference(other._arc_object))
ValueError: &amp;lt;geoprocessing describe geometry object object at 0x000002D08952E1E0&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what the issue could be. I assume it might have something to do with the number of records but it is hard to say. Any help on this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 15:42:10 GMT</pubDate>
    <dc:creator>RPGIS</dc:creator>
    <dc:date>2023-05-17T15:42:10Z</dc:date>
    <item>
      <title>Issue with creating multipoints and running the symmetrical difference analysis?</title>
      <link>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290146#M67668</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a script that is designed to quickly analyze thousands of points to determine if there are any intersecting points. If there are any intersecting points, run the geometry analysis to get all of the intersecting points. Use the symmetrical difference analysis to get all points that do not intersect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;InFeatureMPoint, RefFeatureMPoint = arcpy.Multipoint(arcpy.Array([arcpy.Point(*x) for x in ListACoords])), arcpy.Multipoint(arcpy.Array([arcpy.Point(*x) for x in ListBCoords]))

UnMatched = InFeatureMPoint^RefFeatureMPoint&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the&amp;nbsp;symmetrical difference analysis; I keep getting and error stating:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;return convertArcObjectToPythonObject(self._arc_object.symmetricdifference(other._arc_object))
ValueError: &amp;lt;geoprocessing describe geometry object object at 0x000002D08952E1E0&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what the issue could be. I assume it might have something to do with the number of records but it is hard to say. Any help on this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 15:42:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290146#M67668</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2023-05-17T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with creating multipoints and running the symmetrical difference analysis?</title>
      <link>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290325#M67671</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I assume it might have something to do with the number of records&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I got the same error for Multipoints with only 1 point, so I don't think that's it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My first idea was that it had something to do with the SpatialReference, because you don't set that when creating the Multipoints, but that didn't work either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My tests suggest that something is buggy with &lt;STRONG&gt;constructed&lt;/STRONG&gt; Multipoints.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def layer_to_multipoint(layer, wkid=None):
    """Reads the geometries of a point layer and returns a Multipoint geometry.
    If wkid is set, the Multipoint will be projected into that system.
    """
    in_sr = arcpy.Describe(layer).spatialReference
    coordinates = [row[0] for row in arcpy.da.SearchCursor(layer, ["SHAPE@XY"])]
    points = [arcpy.Point(*c) for c in coordinates]
    multipoint = arcpy.Multipoint(arcpy.Array(points), spatial_reference=in_sr)
    if wkid:
        out_sr = arcpy.SpatialReference(wkid)
        multipoint = multipoint.projectAs(out_sr)
    return multipoint


# construct a MP geometry from a point layer
constructed_mp = layer_to_multipoint("TestPoints")

# try to run some geometry functions on it
constructed_mp.symmetricDifference(constructed_mp)  # ERROR
constructed_mp.union(constructed_mp)                # ERROR
constructed_mp.difference(constructed_mp)           # works
constructed_mp.intersect(constructed_mp, 1)         # works



# write the constructed mp into a fc and read it again from there
with arcpy.da.InsertCursor("TestMultipoints", ["SHAPE@"]) as cursor:
    cursor.insertRow([constructed_mp])
read_mp = [r for r in arcpy.da.SearchCursor("TestMultipoints", ["SHAPE@"])][0][0]

# try to run the geometry functions on the read mp
read_mp.symmetricDifference(read_mp)   # works
read_mp .union(read_mp)                # works
read_mp .difference(read_mp)           # works
read_mp .intersect(read_mp , 1)        # works


# let's compare the mp's
print(constructed_mp.JSON)
#{"points":[[81359.018400000408,5906093.2276000008],[81356.343299999833,5906139.3099000007],[81519.05449999962,5905955.2974999994]],"spatialReference":{"wkid":25833,"latestWkid":25833}}
print(read_mp.JSON)
#{"points":[[81359.018400000408,5906093.2276000008],[81356.343299999833,5906139.3099000007],[81519.05449999962,5905955.2974999994]],"spatialReference":{"wkid":25833,"latestWkid":25833}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like these are the same Multipoints, but somehow union and symmetricDifference fail for the mp I constructed myself. It also didn't matter whether I used the functions, the operators, or the Geometry._arc_object functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I remember you posting a huge script containing this snippet. Did it work back then? I think this is a matter for tech support.&lt;/P&gt;&lt;P&gt;In the meantime, there's &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/symmetrical-difference.htm" target="_blank" rel="noopener"&gt;Symmetrical Difference&lt;/A&gt;...&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 19:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290325#M67671</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-17T19:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with creating multipoints and running the symmetrical difference analysis?</title>
      <link>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290409#M67673</link>
      <description>&lt;P&gt;I still could not get it to work despite my efforts. Oddly enough I did find an abstract workaround that behaves similarly. What I had to do was intersect the two multipoint features then subtract the intersected feature from both multipoint features to get something similar. This definitely seems like a bug that I'll have to let someone at Esri know about. But so far that seems to work for some reason.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, it works with both operators and functions in that regards.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 21:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/issue-with-creating-multipoints-and-running-the/m-p/1290409#M67673</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2023-05-17T21:18:59Z</dc:date>
    </item>
  </channel>
</rss>

