<?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 Multipoint(do['geometry']) key error from data frame but key exist. Key Error: 13 geopandas in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multipoint-do-geometry-key-error-from-data-frame-but-key-exist-Key-Error-13/m-p/209448#M6012</link>
    <description>&lt;P&gt;data source:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="johnstandard" href="https://apkstandard.com/" target="_self" rel="nofollow noreferrer"&gt;johnstandard&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried looking for a similar problem but I can't find an answer and the error does not help much. I'm kinda frustrated at this point. Thanks for the help. I'm calculating the closest distance from a point.&lt;/P&gt;&lt;PRE&gt;df_subway = pd.read_csv(&lt;SPAN class=""&gt;'/content/drive/MyDrive/Despliegue_de_modelos/NYC_Transit_Subway_Entrance_And_Exit_Data.csv'&lt;/SPAN&gt;)

geometry = [Point(xy) &lt;SPAN class=""&gt;for&lt;/SPAN&gt; xy &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;zip&lt;/SPAN&gt;(df_subway[&lt;SPAN class=""&gt;'Station Longitude'&lt;/SPAN&gt;], df_subway[&lt;SPAN class=""&gt;'Station Latitude'&lt;/SPAN&gt;])]

&lt;SPAN class=""&gt;# Coordinate reference system :&lt;/SPAN&gt;
crs = {&lt;SPAN class=""&gt;'init'&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'EPSG:4326'&lt;/SPAN&gt;}

&lt;SPAN class=""&gt;# Creating a Geographic data frame &lt;/SPAN&gt;
gdf_subway_entrance_geometry = gpd.GeoDataFrame(df_subway, crs=crs, geometry=geometry).to_crs(&lt;SPAN class=""&gt;'EPSG:5234'&lt;/SPAN&gt;)
gdf_subway_entrance_geometry

df_yes_entry = gdf_subway_entrance_geometry[gdf_subway_entrance_geometry.Entry==&lt;SPAN class=""&gt;'YES'&lt;/SPAN&gt;]
df_yes_entry

&lt;SPAN class=""&gt;from&lt;/SPAN&gt; shapely.geometry &lt;SPAN class=""&gt;import&lt;/SPAN&gt; Point, MultiPoint
&lt;SPAN class=""&gt;from&lt;/SPAN&gt; shapely.ops &lt;SPAN class=""&gt;import&lt;/SPAN&gt; nearest_points
pts = MultiPoint(df_yes_entry[&lt;SPAN class=""&gt;'geometry'&lt;/SPAN&gt;]) &lt;SPAN class=""&gt;#it fails in this line&lt;/SPAN&gt;
pt = Point(gpdPoint.x, gpdPoint.y)
&lt;SPAN class=""&gt;#[o.wkt for o in nearest_points(pt, pts)]&lt;/SPAN&gt;
&lt;SPAN class=""&gt;for&lt;/SPAN&gt; o &lt;SPAN class=""&gt;in&lt;/SPAN&gt; nearest_points(pt, pts):
  &lt;SPAN class=""&gt;print&lt;/SPAN&gt;(o)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jul 2022 12:28:56 GMT</pubDate>
    <dc:creator>johnsatndard</dc:creator>
    <dc:date>2022-07-30T12:28:56Z</dc:date>
    <item>
      <title>Multipoint(do['geometry']) key error from data frame but key exist. Key Error: 13 geopandas</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Multipoint-do-geometry-key-error-from-data-frame-but-key-exist-Key-Error-13/m-p/209448#M6012</link>
      <description>&lt;P&gt;data source:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="johnstandard" href="https://apkstandard.com/" target="_self" rel="nofollow noreferrer"&gt;johnstandard&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried looking for a similar problem but I can't find an answer and the error does not help much. I'm kinda frustrated at this point. Thanks for the help. I'm calculating the closest distance from a point.&lt;/P&gt;&lt;PRE&gt;df_subway = pd.read_csv(&lt;SPAN class=""&gt;'/content/drive/MyDrive/Despliegue_de_modelos/NYC_Transit_Subway_Entrance_And_Exit_Data.csv'&lt;/SPAN&gt;)

geometry = [Point(xy) &lt;SPAN class=""&gt;for&lt;/SPAN&gt; xy &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;zip&lt;/SPAN&gt;(df_subway[&lt;SPAN class=""&gt;'Station Longitude'&lt;/SPAN&gt;], df_subway[&lt;SPAN class=""&gt;'Station Latitude'&lt;/SPAN&gt;])]

&lt;SPAN class=""&gt;# Coordinate reference system :&lt;/SPAN&gt;
crs = {&lt;SPAN class=""&gt;'init'&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'EPSG:4326'&lt;/SPAN&gt;}

&lt;SPAN class=""&gt;# Creating a Geographic data frame &lt;/SPAN&gt;
gdf_subway_entrance_geometry = gpd.GeoDataFrame(df_subway, crs=crs, geometry=geometry).to_crs(&lt;SPAN class=""&gt;'EPSG:5234'&lt;/SPAN&gt;)
gdf_subway_entrance_geometry

df_yes_entry = gdf_subway_entrance_geometry[gdf_subway_entrance_geometry.Entry==&lt;SPAN class=""&gt;'YES'&lt;/SPAN&gt;]
df_yes_entry

&lt;SPAN class=""&gt;from&lt;/SPAN&gt; shapely.geometry &lt;SPAN class=""&gt;import&lt;/SPAN&gt; Point, MultiPoint
&lt;SPAN class=""&gt;from&lt;/SPAN&gt; shapely.ops &lt;SPAN class=""&gt;import&lt;/SPAN&gt; nearest_points
pts = MultiPoint(df_yes_entry[&lt;SPAN class=""&gt;'geometry'&lt;/SPAN&gt;]) &lt;SPAN class=""&gt;#it fails in this line&lt;/SPAN&gt;
pt = Point(gpdPoint.x, gpdPoint.y)
&lt;SPAN class=""&gt;#[o.wkt for o in nearest_points(pt, pts)]&lt;/SPAN&gt;
&lt;SPAN class=""&gt;for&lt;/SPAN&gt; o &lt;SPAN class=""&gt;in&lt;/SPAN&gt; nearest_points(pt, pts):
  &lt;SPAN class=""&gt;print&lt;/SPAN&gt;(o)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2022 12:28:56 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Multipoint-do-geometry-key-error-from-data-frame-but-key-exist-Key-Error-13/m-p/209448#M6012</guid>
      <dc:creator>johnsatndard</dc:creator>
      <dc:date>2022-07-30T12:28:56Z</dc:date>
    </item>
  </channel>
</rss>

