Skip to main content
Post Closed as "Not suitable for this site" by ahmadhanb, Vince, Kadir Şahbaz, TomazicM, Bera
improved edit suggestion
Source Link
MrXsquared
  • 35.6k
  • 22
  • 71
  • 121

I have two GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID.

I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there are no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe.

Is there any simple solution to this problem  ?

I have two GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID.

I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there are no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe.

Is there any simple solution to this problem  ?

I have two GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID.

I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there are no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe.

Is there any simple solution to this problem?

I've got toI have two GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID. I'm

I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there isare no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe. 

Is there any simple solution to this problem I'm missing?

I've got to GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID. I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there is no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe. Is there any simple solution to this problem I'm missing?

I have two GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID.

I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there are no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe. 

Is there any simple solution to this problem ?

Source Link

How to use Geopandas sjoin_nearest() while only comparing to rows with certain value

I've got to GeoDataframes (gdf_1 and gdf_2). Both of these GeoDataframes have a UID. I'm trying to use sjoin_nearest from geopandas to find the nearest point from gdf_2 for each point from gdf_1, but only look at those points from gdf_2 where the UID (minus the last n characters) equals the UID of the comparison point from gdf_1.

If there is no points with an equal UID in gdf_2 the point can be dropped from the GeoDataframe. Is there any simple solution to this problem I'm missing?