<?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 GeoSeriesAccessor snap_to_line example? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1663738#M11773</link>
    <description>&lt;P&gt;I'm trying to figure out a way to use the GeoSeriesAccessor snap_to_line function so that I can return a geometry where a point snaps to the nearest line.&amp;nbsp; I have the geometry for both an example point and polyline contained within separate Spatial Enabled DataFrames (created from FeatureSets).&lt;/P&gt;&lt;LI-CODE lang="python"&gt;snap = point_sdf.SHAPE.geom.snap_to_line((polyline_sdf.SHAPE.geom))&lt;/LI-CODE&gt;&lt;P&gt;But when I try to apply snap_to_line on the point SeDF, I get an error:&lt;/P&gt;&lt;P&gt;TypeError: Type not known: &amp;lt;class 'numpy.ndarray'&amp;gt; vs &amp;lt;class 'arcgis.features.geo._accessor.GeoSeriesAccessor'&amp;gt;&lt;/P&gt;&lt;P&gt;When I check the type of both point_sdf.SHAPE.geom and polyline_sdf.SHAPE.geom, they are both&lt;BR /&gt;&amp;lt;class 'arcgis.features.geo._accessor.GeoSeriesAccessor'&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I then tried using a Polyline object as the parameter:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;polyline = Polyline({'paths': [[[1241715.1635674685, 460269.8582556397], [1241717.2567391396, 460272.0662564784], [1241724.025098309, 460279.2214258909], [1241739.3006583005, 460295.40643289685], [1241768.2212041318, 460326.0494162291], [1241796.472459972, 460355.9843957275], [1241818.4445288926, 460380.5283098966]]], 'spatialReference': SpatialReference({'wkid': 2248})})

point_sdf.SHAPE.geom.snap_to_line(polyline)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got this as an error:&lt;BR /&gt;TypeError: &amp;lt;geoprocessing describe geometry object object at 0x00000198CAA74A80&amp;gt;&lt;BR /&gt;&lt;BR /&gt;The&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.features.toc.html?highlight=snap#arcgis.features.GeoSeriesAccessor.snap_to_line" target="_self"&gt;documentation for this tool&lt;/A&gt;&amp;nbsp;says that the parameter for the tool should be a Geometry object.&lt;BR /&gt;&lt;BR /&gt;I can't find any examples of this tool being used in the docs, tutorials, or boards to help me figure out the right way to apply this tool.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone know what might be wrong with what I'm doing?&amp;nbsp; Or are there any examples of how to use this tool that I can use?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Nov 2025 22:27:55 GMT</pubDate>
    <dc:creator>epugliano</dc:creator>
    <dc:date>2025-11-05T22:27:55Z</dc:date>
    <item>
      <title>GeoSeriesAccessor snap_to_line example?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1663738#M11773</link>
      <description>&lt;P&gt;I'm trying to figure out a way to use the GeoSeriesAccessor snap_to_line function so that I can return a geometry where a point snaps to the nearest line.&amp;nbsp; I have the geometry for both an example point and polyline contained within separate Spatial Enabled DataFrames (created from FeatureSets).&lt;/P&gt;&lt;LI-CODE lang="python"&gt;snap = point_sdf.SHAPE.geom.snap_to_line((polyline_sdf.SHAPE.geom))&lt;/LI-CODE&gt;&lt;P&gt;But when I try to apply snap_to_line on the point SeDF, I get an error:&lt;/P&gt;&lt;P&gt;TypeError: Type not known: &amp;lt;class 'numpy.ndarray'&amp;gt; vs &amp;lt;class 'arcgis.features.geo._accessor.GeoSeriesAccessor'&amp;gt;&lt;/P&gt;&lt;P&gt;When I check the type of both point_sdf.SHAPE.geom and polyline_sdf.SHAPE.geom, they are both&lt;BR /&gt;&amp;lt;class 'arcgis.features.geo._accessor.GeoSeriesAccessor'&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I then tried using a Polyline object as the parameter:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;polyline = Polyline({'paths': [[[1241715.1635674685, 460269.8582556397], [1241717.2567391396, 460272.0662564784], [1241724.025098309, 460279.2214258909], [1241739.3006583005, 460295.40643289685], [1241768.2212041318, 460326.0494162291], [1241796.472459972, 460355.9843957275], [1241818.4445288926, 460380.5283098966]]], 'spatialReference': SpatialReference({'wkid': 2248})})

point_sdf.SHAPE.geom.snap_to_line(polyline)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got this as an error:&lt;BR /&gt;TypeError: &amp;lt;geoprocessing describe geometry object object at 0x00000198CAA74A80&amp;gt;&lt;BR /&gt;&lt;BR /&gt;The&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.features.toc.html?highlight=snap#arcgis.features.GeoSeriesAccessor.snap_to_line" target="_self"&gt;documentation for this tool&lt;/A&gt;&amp;nbsp;says that the parameter for the tool should be a Geometry object.&lt;BR /&gt;&lt;BR /&gt;I can't find any examples of this tool being used in the docs, tutorials, or boards to help me figure out the right way to apply this tool.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone know what might be wrong with what I'm doing?&amp;nbsp; Or are there any examples of how to use this tool that I can use?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 22:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1663738#M11773</guid>
      <dc:creator>epugliano</dc:creator>
      <dc:date>2025-11-05T22:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: GeoSeriesAccessor snap_to_line example?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1663989#M11774</link>
      <description>&lt;P&gt;I can reproduce this issue when calling snap_to_line on the point with the line as the second geometry. The reverse is successful. Try snapping the point to the line.&lt;/P&gt;&lt;P&gt;point_geom(line_geom) = GP error&lt;/P&gt;&lt;P&gt;line_geom(point_geom) = Success (point geometry is returned)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like this is expected although the Python API documentation is somewhat confusing. The snapToLine method doc states that a point feature should be argument passed.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;"""Geometry.snapToLine(in_point)&lt;/P&gt;&lt;P&gt;Returns a new point based on in_point snapped to this geometry.&lt;/P&gt;&lt;P&gt;in_point(PointGeometry):&lt;BR /&gt;A point ( PointGeometry or Point ) to be snapped to the line."""&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 17:02:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1663989#M11774</guid>
      <dc:creator>KenGalliher1</dc:creator>
      <dc:date>2025-11-06T17:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: GeoSeriesAccessor snap_to_line example?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1664199#M11775</link>
      <description>&lt;P&gt;I just switched the variables for that and it worked!&amp;nbsp; Thank you for pointing that out!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 15:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/geoseriesaccessor-snap-to-line-example/m-p/1664199#M11775</guid>
      <dc:creator>epugliano</dc:creator>
      <dc:date>2025-11-07T15:25:48Z</dc:date>
    </item>
  </channel>
</rss>

