<?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: problem with spatial queries in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17230#M397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Do Until pPointF Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pPointF.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim topoOp As ITopologicalOperator
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set topoOp = pPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bufferPoly As IPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set bufferPoly = topoOp.Buffer(pMxDoc.SearchTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSF As ISpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSF = New SpatialFilter

&amp;nbsp;&amp;nbsp;&amp;nbsp; With pSF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = bufferPoly
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "Shape"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelIntersects
&amp;nbsp;&amp;nbsp;&amp;nbsp; End With
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:41:28 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2021-12-10T20:41:28Z</dc:date>
    <item>
      <title>problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17224#M391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My company just changed my computer and my program is now having problems performing spatial queries.&amp;nbsp; Old computer had 9.3sp1 and new computer has 9.3.1.&amp;nbsp; I am intersecting a point with lines and returning a selectionset.&amp;nbsp; On the old computer, I might get a selectionset of 2 features.&amp;nbsp; On the new computer I will get 1.&amp;nbsp; The program is a COM tool using ArcObjects in ArcMap.&amp;nbsp; I still have access to my old computer, so I have been able to test THE SAME program on both computers and check my debug output for features returned.&amp;nbsp; Any ideas on what could be going on?&amp;nbsp; Snap tolerance in ArcMap is set the same...anything else I should check?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another tidbit is that if I run debug/compile the program on the new computer then I cannot download using an .msi on a 3rd computer without having these issues.&amp;nbsp; However, If I compile the SAME program on my old computer &amp;amp; download on the same 3rd computer, no problems! ALL esri dependencies are removed from the references because I am assuming that the user has ArcMap and the needed dlls.&amp;nbsp; THE 3rd COMPUTER HAS 9.3sp1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&amp;nbsp; In addition, it seems that there is not as much traffic in these forums since the new format was introduced...anyone have suggestions to another forum where I may ask questions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 18:02:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17224#M391</guid>
      <dc:creator>LisaT</dc:creator>
      <dc:date>2011-02-09T18:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17225#M392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sounds like a spatial reference issue.&amp;nbsp; If your code that performs the spatial query is not accounting for differences in coordinate systems then you may get incorrect query results.&amp;nbsp; An example of how this can happen is this:&amp;nbsp; your map's coordinate system is different than that of the layer you're querying.&amp;nbsp; Your code takes an envelope sketched by the user as the query geometry.&amp;nbsp; That envelope will have the same coordinate system as the map so if you don't project that envelope into the layer's coordinate system you may get incorrect results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for deploying to other computers - you can only deploy to computers that are running the same version of ArcGIS (including service pack) as the computer on which you compiled the code.&amp;nbsp; In some cases (but not all) you can deploy to computers that are running a higher version.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 19:34:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17225#M392</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-02-09T19:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17226#M393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your quick response!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, I have changed the point to "snaptospatialreference" of the layer I am querying, which seems to help a lot.&amp;nbsp; However, I am still having a bit of the issue.&amp;nbsp; It seems that when the selectionset does not have a line, it is because the point does not intersect a vertex on the line.&amp;nbsp; I need to be able to pull all lines that the point intersects, even if there is not currently a vertex there!&amp;nbsp; My code will actually split the line at that point...but I need to get the line first!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISpatialFilter pSelSetFilter = new SpatialFilterClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSelSetFilter.Geometry = myPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSelSetFilter.GeometryField = "SHAPE";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSelSetFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISelectionSet pSelSet = lineFeatureClass.Select(pSelSetFilter, esriSelectionType.esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, pWSOut);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anything that I need to do differently??&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, for a little more background, the point is actually the "fromPoint" of a line.&amp;nbsp; I have the lines snapping to line, vertex, and end.&amp;nbsp; So, the "fromPoint" should be snapped to the line I am trying to get.&amp;nbsp; When I zoom in, I do not see any gap between the line endpoint (frompoint) and the line it is touching (the one I am trying to get).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 22:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17226#M393</guid>
      <dc:creator>LisaT</dc:creator>
      <dc:date>2011-02-09T22:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17227#M394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using a point as a selection geometry is not your best bet.&amp;nbsp; If you were selecting polygons then it wouldn't be much of a problem but to select lines or points the point coordinates must match exactly or nothing will be returned.&amp;nbsp; For instance, if the coords of your point are 1.0, 1.0 and the nearest point on the line you're trying to select has coords 1.00000001, 1.00000001 then it won't select it because those points aren't the same.&amp;nbsp; Try using a small tolerance to buffer your point and use the resulting buffer polygon as your search geometry.&amp;nbsp; I would recommend using ArcMap's selection tolerance to buffer your point.&amp;nbsp; You can use ITopologicalOperator to buffer the point and use IMxDocument.SearchTolerance to get your buffer radius.&amp;nbsp; Note that SearchTolerance returns a value in map units, so if the map units differ from the units specified by the query layer's coordinate system you'll need to convert (use IUnitConverter interface).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 12:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17227#M394</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-02-10T12:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17228#M395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like this is working so far!&amp;nbsp; I'll keep testing and will post if I encounter any more problems.&amp;nbsp; The only thing different was that I had to create an IPointCollection = new MultiPointClass() and add the point in order to cast it to a topologicaloperator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 18:08:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17228#M395</guid>
      <dc:creator>LisaT</dc:creator>
      <dc:date>2011-02-10T18:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17229#M396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone is still watching this thread...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having the exact same problem described here. I am trying to split a line fc at a point fc by using an esrispatialrelintersects spatial filter to find all lines intersecting with a point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that it is skipping over some lines that are a fraction of a millimetre away from intersecting the line. It occurred to me to use some kind of buffer, or tolerance when finding intersecting features, but I could really use some guidance in implementing this in VBA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both the feature classes and the data frame are all in the same projection (NAD83 UTM Zone 17N).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have had a look at the ITopologicalOperator and IMxDocument.SearchTolerance interface/property as Neil suggested but am really at a loss as to how to implement it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the full code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank-you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Sub SplitLineAtPoint_Click()

Dim pEditor As IEditor
Set pEditor = Application.FindExtensionByName("ESRI Object Editor")

If pEditor.EditState &amp;lt;&amp;gt; esriStateEditing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox ("Start editing your line feature before proceeding...&amp;nbsp; ALSO - Make sure the lines you are editing are in a different workspace than your intersecting points.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
End If

Dim pEL As IEditLayers
Set pEL = pEditor

If pEL.CurrentLayer.FeatureClass.ShapeType &amp;lt;&amp;gt; esriGeometryPolyline Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox ("Target layer must be a line feature.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
End If

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMap As IMap
Set pMap = pMxDoc.FocusMap

Dim pPointL As IFeatureLayer
Set pPointL = pMap.Layer(0) 'point layer to split lines with

Dim pLineL As IFeatureLayer
Set pLineL = pMap.Layer(1) 'line layer to be split

Dim pLineFC As IFeatureClass
Set pLineFC = pLineL.FeatureClass

Dim pLineGDS As IGeoDataset
Set pLineGDS = pLineFC

Dim pPointFC As IFeatureClass
Set pPointFC = pPointL.FeatureClass 'point feature class to split lines with

Dim pPointCursor As IFeatureCursor
Set pPointCursor = pPointFC.Search(Nothing, False)

Dim pPointF As IFeature
Set pPointF = pPointCursor.NextFeature 'the point feature to split lines with

Dim pointCount As Integer
pointCount = 1
Debug.Print pointCount
Dim pointFeatureCount As Integer
pointFeatureCount = pPointFC.FeatureCount(Nothing)

Do Until pPointF Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pPointF.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSF As ISpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSF = New SpatialFilter

&amp;nbsp;&amp;nbsp;&amp;nbsp; With pSF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "Shape"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelIntersects
&amp;nbsp;&amp;nbsp;&amp;nbsp; End With
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLineCursor As IFeatureCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLineCursor = pLineFC.Search(pSF, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLineF As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLineF = pLineCursor.NextFeature

&amp;nbsp;&amp;nbsp;&amp;nbsp; Do Until pLineF Is Nothing&amp;nbsp;&amp;nbsp; ' &amp;lt;---- &lt;STRONG&gt;The problem lines don't get past this point&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPolyCurve As IPolycurve
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPolyCurve = pLineF.Shape

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pToPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pToPoint = pPolyCurve.ToPoint 'end point of the line

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFromPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFromPoint = pPolyCurve.FromPoint&amp;nbsp; 'start point of the line

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Show something in status bar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pStatus As IStatusBar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pStatus = Application.StatusBar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pStatus.Message(0) = "Splitting at point:" &amp;amp; pointCount &amp;amp; "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " &amp;amp; ((pointCount / pointFeatureCount) * 100) &amp;amp; "% done"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Round(pFromPoint.X, 6) = Round(pPoint.X, 6) And Round(pFromPoint.Y, 6) = Round(pPoint.Y, 6)) Then&amp;nbsp; 'do nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf (Round(pToPoint.X, 6) = Round(pPoint.X, 6) And Round(pToPoint.Y, 6) = Round(pPoint.Y, 6)) Then&amp;nbsp; 'do nothing
&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; Dim pFeatureEdit As IFeatureEdit
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureEdit = pLineF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatureEdit.Split pPointF.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "split at point " &amp;amp; pointCount
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLineF = pLineCursor.NextFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointCount = pointCount + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPointF = pPointCursor.NextFeature
Loop

MsgBox ("Lines have been split at intersecting points..." &amp;amp; vbNewLine &amp;amp; vbNewLine &amp;amp; "SAVE Your EDITS before closing..")

End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17229#M396</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2021-12-12T15:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17230#M397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Do Until pPointF Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pPointF.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim topoOp As ITopologicalOperator
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set topoOp = pPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bufferPoly As IPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set bufferPoly = topoOp.Buffer(pMxDoc.SearchTolerance)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSF As ISpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSF = New SpatialFilter

&amp;nbsp;&amp;nbsp;&amp;nbsp; With pSF
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = bufferPoly
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "Shape"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelIntersects
&amp;nbsp;&amp;nbsp;&amp;nbsp; End With
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17230#M397</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2021-12-10T20:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17231#M398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you so much for your quick reply,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I am now finding another issue. I have been getting "split line will result in zero length polygon" errors and have found that these are happening where the point doesn't intersect with the line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code will find all intersecting lines for a point using searchtolerance, and then split all lines that do not have the same start or end point coordinates as the point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In editor options, I have set the snapping tolerance to 0.01 map units (metres), but have found a point that is trying to split a line that is 2 metres away.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question is, where does the searchtolerance value come from?&amp;nbsp; It tells me it is 5.211... but I don't what the units are, or how pixels come in to play with vector data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you could explain this to me it would be highly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank-you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 15:02:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17231#M398</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2011-03-07T15:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17232#M399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The search tolerance is a document property.&amp;nbsp; You set it in the options dialog (Selection menu-&amp;gt;Options) - it affects such things as the Select Features tool, Identify tool, etc.&amp;nbsp; In many cases it's a good idea to use the search tolerance because it's something the user can change on their own but in your case you probably do want to use a tighter tolerance.&amp;nbsp; Also, I'm not sure if the snap tolerance will automatically be used when you split your line.&amp;nbsp; You may have to use IProximityOperator to get the actual point on the line and use that point in your split operation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 15:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17232#M399</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-07T15:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17233#M400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still not sure where the tolerance comes from, but I have managed, more or less, to get the code to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now the code loops through all points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;loops through all lines intersecting the point within the tolerance (1 pixel)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gets the point on the line closest to the input point (iproximityoperator.returnnearestpoint)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if that point is within 0.001 meters of the line start or end point it gets ignored&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else the line gets split&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;next line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;next point&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But now all of a sudden &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Set BufferPoly = pTopoOp.Buffer(pMxDoc.SearchTolerance) &lt;/SPAN&gt;&lt;SPAN&gt;is giving my a type mismatch error and I am at a loss as to why.&amp;nbsp; It was working before and I really don't think anything in the code above that point has been changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions are much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Do Until pPointF Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPoint As IPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pPoint = pPointF.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTopoOp As ITopologicalOperator
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTopoOp = pPoint
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim BufferPoly As esriGeometry.IPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set BufferPoly = pTopoOp.Buffer(pMxDoc.SearchTolerance)
...&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...I changed it to Set BufferPoly = pTopoOp.Buffer(0.5) and it works&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17233#M400</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2021-12-10T20:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17234#M401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm still not sure where the tolerance comes from&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcMap, choose Options from the Selection menu.&amp;nbsp; The tolerance is displayed on this dialog and is an editable value for the user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're creating very small buffers you may be running into the limits of the coordinate system's resolution.&amp;nbsp; You may want to use IBufferConstruction instead of ITopologicalOperator to create your buffer.&amp;nbsp; You will also want to set the spatial reference on the buffer polygon so that it has the same coordinate system as the layer you're querying.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 12:51:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17234#M401</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-03-08T12:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem with spatial queries</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17235#M402</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'm wondering if this is still the best solution as this thread is a bit dated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a poly line feature class that should snap to point features. I need to know what point feature class the end points (From and To) of the poly line have snapped to. When drawing the poly line I visually see the snapping dialog indicate that the end point of the poly line has snapped to the point feature but yet when I attempt to determine the point using spatial queries the point isn't found. I suspect the problem is related to Neil's comment about the point not being exact. But still wondering if there is a better approach at 10.1?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2012 22:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-spatial-queries/m-p/17235#M402</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2012-12-26T22:52:47Z</dc:date>
    </item>
  </channel>
</rss>

