<?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: Dot Net Methods to do Spatial Join operations in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692691#M13900</link>
    <description>&lt;P&gt;I've found this tutorial&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/perform-spatial-operations/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/wpf/sample-code/perform-spatial-operations/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;From my end, the collection of points is coming from the result of using "XY Table to Point" geoprocessing tool in Arcgis Pro given a set of longitudes and latitudes table fed in tool. So now I have a point feature class in Arcgis Pro environment. Anyhow, first thing first, (1) where do I go about getting the operation of "XY Table to Point" programmed in C#? Almost each geoprocessing tool has its equivalent operation described in Python, but not readily in C#, so is .NET Map SDK the resource I can count on to do the equivalent things so that the result may be recognized as&amp;nbsp; Feature Layer by the NET Map SDK platform, which may be equivalent to Feature class of Argis, pro, I am hopign they will have the same columns/objects as a result?&lt;BR /&gt;&lt;BR /&gt;The same thing with Spatial Join geoprocessing tool, it needs a Target Feature Class and a Join Feature Class passed into form, and one can get the Python code equivalent of this operation, however in .NET (2.a) how doI go about to import an Arcgis Pro Feature Class&amp;nbsp; programmatically so that the C# WPM program would convert it to Feature Layer? (2.b) What are the equivalent C# methods to perform Spatial Join?&lt;BR /&gt;&lt;BR /&gt;(3) Am I limited to Feature Layer data type? This is the type I had worked with before through a published Feature Service link given to me, there a C# method to invoke the link and I do query against the result (which is a&amp;nbsp; Feature Layer)&lt;BR /&gt;&lt;BR /&gt;But now I move on to do 2 more operations: one is&amp;nbsp; "XY Table to Point" described above, followed by a "Spatial Join" operation.&amp;nbsp; I'm not sure how to start with the point being defined as longitude and latitude (the attribute table behind the resulted Feature Class after doing&amp;nbsp;XY Table to Point geoprocessing tool in Argis Pro does reserve 2 columns longitude and latitude but no other data, do you think I can redefined the geometry point using these same long/lats? rather than what illustrated in the example link above? geometry or feature layer?&lt;BR /&gt;&lt;BR /&gt;Any feed back in appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2026 23:11:59 GMT</pubDate>
    <dc:creator>KTT_Mercury</dc:creator>
    <dc:date>2026-03-25T23:11:59Z</dc:date>
    <item>
      <title>Dot Net Methods to do Spatial Join operations</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692083#M13897</link>
      <description>&lt;P&gt;Hello - I would need some help pointing me to the library methods or the like to achieve the equivalent operation of Esri Spatial Joint geoprocessing tool in ArcGIS Pro 3.5&lt;BR /&gt;&lt;BR /&gt;I have a feature of center-lines network (like streets and highways) then I have a feature layer of points. I was given the radius tolerance of a certain feet to do a spatial-joint of the 2-D features to allocate all the street IDs that the radius crosses from that point. I think of intersection operation equivalency, but even so, this discussion/documentation I've found seem to be brief:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/spatial-and-data-analysis/geometry/" target="_blank" rel="noopener"&gt;Geometry | ArcGIS Maps SDK for .NET | Esri Developer&lt;/A&gt;&amp;nbsp;- my guess is I would pick pint and polylines, but I am working with Feature Layers, and mostly likely import the physical Feature Layer directly from #C code (instead of getting it from Feature Service link)&lt;BR /&gt;&lt;BR /&gt;Can someone help me with more resource to read or example project to do, like intersection of 2 layers hand-on project utilizing .NET Maps SDK? I would need to get/import a Feature Layer into my .NET WPF Project first, is there such method and classes available if I am not given a Feature Service URL to invoke?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 22:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692083#M13897</guid>
      <dc:creator>KTT_Mercury</dc:creator>
      <dc:date>2026-03-25T22:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dot Net Methods to do Spatial Join operations</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692684#M13899</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;It would be helpful if you could explain the full workflow you need the spatial join for. You can manually implement a spatial join using the native maps sdks, but it could be quite slow depending on how many points and lines you are dealing with. If you do have many lines and points, and if the computation must be done for your full datasets all at once, it might be worthwhile to precompute the results in ArcGIS Pro. Implementing a join in the native sdks would make the most sense if you only need to do the spatial join using a few points at a time, or if your datasets are not large.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;In the meantime here are some links that should be useful:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;GeometryEngine: &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.GeometryEngine.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.GeometryEngine.html&lt;/A&gt;&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;This is the relevant class for geometry calculations. Check out the &lt;/SPAN&gt;&lt;SPAN&gt;Buffer()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and &lt;/SPAN&gt;&lt;SPAN&gt;BufferGeodetic()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;functions in particular&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;FeatureTable.QueryFeaturesAsync(): &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.FeatureTable.QueryFeaturesAsync.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.FeatureTable.QueryFeaturesAsync.html&lt;/A&gt;&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;This function has support for querying features based on geometry relationships&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Offline data files documentation: &lt;A href="https://developers.arcgis.com/net/offline-maps-scenes-and-data/work-with-data-files/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/offline-maps-scenes-and-data/work-with-data-files/&lt;/A&gt;&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;We do not support opening file geodatabases directly, but you can create a mobile geodatase, geopackage, or shapefile from your data using Pro&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Here is some example code for what a spatial join could look like. This appends data from a point to surrounding lines, though after re-reading what you said I imagine you want the opposite (line data to points). The basic concept should still hold, though.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Other notes on the code:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;A full join would loop through all the points, not just take the first&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Using &lt;/SPAN&gt;&lt;SPAN&gt;BufferGeodetic()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;was probably overkill, and &lt;/SPAN&gt;&lt;SPAN&gt;Buffer()&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;would be more performant if there are many points&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I switched to a &lt;/SPAN&gt;&lt;SPAN&gt;FeatureCollectionTable&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;for the final joined table, but there are several options, including writing back to the original mobile geodatabase file&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;This does not include any logic for when a line might be in range of multiple points, but that may not be an issue depending on the use case&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="csharp"&gt;var databasePath = @"";
var pointTableName = "";
var lineTableName = "';

// Open geodatabase
var mobileGeodatabase = await Geodatabase.OpenAsync(databasePath);

// Make point buffer
var pointFeatureTable = mobileGeodatabase.GetGeodatabaseFeatureTable(pointTableName)!;
var pointQueryResult = await pointFeatureTable.QueryFeaturesAsync(new QueryParameters() { WhereClause = "1=1" });
var pointFeature = pointQueryResult.First(); // With multiple points you would want to loop through all the points, not just take the first one
var pointBuffer = GeometryEngine.BufferGeodetic(pointFeature.Geometry!, 1000, LinearUnits.Feet);

// Query lines that intersect the buffer
var lineFeatureTable = mobileGeodatabase.GetGeodatabaseFeatureTable(lineTableName)!;
var linesAroundPoint = await lineFeatureTable.QueryFeaturesAsync(new QueryParameters() { Geometry = pointBuffer, SpatialRelationship = SpatialRelationship.Intersects });

// Create line layer and select intersecting lines
var lineLayer = new FeatureLayer(lineFeatureTable);
lineLayer.SelectFeatures(linesAroundPoint);

// Join attributes
var joinedFields = lineFeatureTable.Fields.ToList();
joinedFields.Add(pointFeatureTable.Fields.Where((f) =&amp;gt; f.Name != "OBJECTID").First());
var joinedCollectionTable = new FeatureCollectionTable(joinedFields, GeometryType.Polyline, lineFeatureTable.SpatialReference);
var joinedLineFeatures = new List&amp;lt;Feature&amp;gt;(linesAroundPoint.Count());
foreach (var lineFeature in linesAroundPoint)
{
    var joinedLineFeature = joinedCollectionTable.CreateFeature();
    joinedLineFeature.Geometry = lineFeature.Geometry;
    foreach (var attribute in lineFeature.Attributes)
    {
        // You may want to do something special with the OBJECT id field rather than just ignore it
        if (attribute.Key != "OBJECTID" &amp;amp;&amp;amp; joinedLineFeature.Attributes.ContainsKey(attribute.Key))
            joinedLineFeature.Attributes[attribute.Key] = attribute.Value;
    }
    foreach (var attribute in pointFeature.Attributes)
    {
        if (attribute.Key != "OBJECTID" &amp;amp;&amp;amp; joinedLineFeature.Attributes.ContainsKey(attribute.Key))
            joinedLineFeature.Attributes[attribute.Key] = attribute.Value;
    }
    joinedLineFeatures.Add(joinedLineFeature);
}
await joinedCollectionTable.AddFeaturesAsync(joinedLineFeatures);

// Get the features out of the collection table to verify its contents
var joinedFeaturesQueryResult = await joinedCollectionTable.QueryFeaturesAsync(new QueryParameters() { WhereClause = "1=1" });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 22:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692684#M13899</guid>
      <dc:creator>imalcolm_esri</dc:creator>
      <dc:date>2026-03-25T22:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dot Net Methods to do Spatial Join operations</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692691#M13900</link>
      <description>&lt;P&gt;I've found this tutorial&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/perform-spatial-operations/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/wpf/sample-code/perform-spatial-operations/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;From my end, the collection of points is coming from the result of using "XY Table to Point" geoprocessing tool in Arcgis Pro given a set of longitudes and latitudes table fed in tool. So now I have a point feature class in Arcgis Pro environment. Anyhow, first thing first, (1) where do I go about getting the operation of "XY Table to Point" programmed in C#? Almost each geoprocessing tool has its equivalent operation described in Python, but not readily in C#, so is .NET Map SDK the resource I can count on to do the equivalent things so that the result may be recognized as&amp;nbsp; Feature Layer by the NET Map SDK platform, which may be equivalent to Feature class of Argis, pro, I am hopign they will have the same columns/objects as a result?&lt;BR /&gt;&lt;BR /&gt;The same thing with Spatial Join geoprocessing tool, it needs a Target Feature Class and a Join Feature Class passed into form, and one can get the Python code equivalent of this operation, however in .NET (2.a) how doI go about to import an Arcgis Pro Feature Class&amp;nbsp; programmatically so that the C# WPM program would convert it to Feature Layer? (2.b) What are the equivalent C# methods to perform Spatial Join?&lt;BR /&gt;&lt;BR /&gt;(3) Am I limited to Feature Layer data type? This is the type I had worked with before through a published Feature Service link given to me, there a C# method to invoke the link and I do query against the result (which is a&amp;nbsp; Feature Layer)&lt;BR /&gt;&lt;BR /&gt;But now I move on to do 2 more operations: one is&amp;nbsp; "XY Table to Point" described above, followed by a "Spatial Join" operation.&amp;nbsp; I'm not sure how to start with the point being defined as longitude and latitude (the attribute table behind the resulted Feature Class after doing&amp;nbsp;XY Table to Point geoprocessing tool in Argis Pro does reserve 2 columns longitude and latitude but no other data, do you think I can redefined the geometry point using these same long/lats? rather than what illustrated in the example link above? geometry or feature layer?&lt;BR /&gt;&lt;BR /&gt;Any feed back in appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 23:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692691#M13900</guid>
      <dc:creator>KTT_Mercury</dc:creator>
      <dc:date>2026-03-25T23:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dot Net Methods to do Spatial Join operations</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692702#M13901</link>
      <description>&lt;P&gt;To answer your questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;There are two different .NET SDKs in the ArcGIS ecosystem. This forum covers the ArcGIS Maps SDK for .NET, which it does sound like you are using given your WPF app. The other SDK is the&amp;nbsp;ArcGIS Pro SDK for .NET. The Pro SDK is similar to arcpy in that it can be used for scripting using existing geoprocessing tools from Pro, though unlike arcpy it can also be used to modify Pro itself (more information &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/index.html" target="_blank"&gt;here&lt;/A&gt;). The use cases are different, and as a result the&amp;nbsp;ArcGIS Maps SDK for .NET does not implement all of the geoprocessing tools provided by Pro. If all you want to do make scripts for geoprocessing workflows, arcpy is probably your best bet. Otherwise if you need to do geoprocessing in your WPF app directly, you will have to implement some functionality manually.&lt;/LI&gt;&lt;LI&gt;Based on the answer to 1:&lt;BR /&gt;&lt;OL class="lia-list-style-type-lower-alpha"&gt;&lt;LI&gt;To read a csv file (or similar) for use in the Maps SDK for .NET you will need to parse the file yourself and read its data into one of the subclasses of &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.FeatureTable.html" target="_blank"&gt;FeatureTable&lt;/A&gt;. &lt;A href="https://developers.arcgis.com/net/wpf/sample-code/feature-collection-layer/" target="_blank"&gt;This sample&lt;/A&gt;&amp;nbsp;has code demonstrating how to create FeatureCollectionTables using known lat/long values (which you would read from the csv).&lt;/LI&gt;&lt;LI&gt;There is no direct equivalent to spatial join in the&amp;nbsp;Maps SDK for .NET&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;There are several different formats for feature data in the&amp;nbsp;Maps SDK for .NET. As in 2a, see the subclasses of&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.FeatureTable.html" target="_blank"&gt;FeatureTable&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;The sample linked in 2a should help with using the lat/long points to make geometry objects and populate layers.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 25 Mar 2026 23:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1692702#M13901</guid>
      <dc:creator>imalcolm_esri</dc:creator>
      <dc:date>2026-03-25T23:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dot Net Methods to do Spatial Join operations</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1693229#M13903</link>
      <description>&lt;P&gt;Hello! I think I hit the reply button on my second post just about the same time I saw the notification, and wondering perhaps my original post got reply. And it did! but I had to attend an other urgent matter, so I logged off.&lt;BR /&gt;&lt;BR /&gt;Thank you for the pointers. I will get back to your 2b shortly .&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 21:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/dot-net-methods-to-do-spatial-join-operations/m-p/1693229#M13903</guid>
      <dc:creator>KTT_Mercury</dc:creator>
      <dc:date>2026-03-27T21:09:22Z</dc:date>
    </item>
  </channel>
</rss>

