• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Geopandas dataframe to select certain ID and find geometries within specified distance

Resolved: Geopandas dataframe to select certain ID and find geometries within specified distance

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have created a test shapefile containing 15 point features in EPSG:2157 and exported it geojson. Each point has been assigned an ID – e.g. 1, 2 ,3 , etc. They look like so:
I now want to use Python to essentially:
  • Specify the ID of the point of interest
  • Add a search distance in metres
  • Print the ID’s of the points within the specified distance and their total distance from the point of interest

I have tried geopandas so far to get me going as per https://gis.stackexchange.com/questions/349637/given-list-of-points-lat-long-how-to-find-all-points-within-radius-of-a-give
But this is just printing my original geopandas dataframe with all 15 IDs and longitude/latitudes,
I need a way of specifying which ID I want from the dataframe, set the 10 metre buffer on it and from that print whichever of the remaining 14 points ID and distance from that point.
How do I go about such a thing?

Answer:

This approach first calculates the distance from the selected point and then filters to the search distance:

If you have better answer, please add a comment about this, thank you!

python python-3.x
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Resolved: How to scroll bottom of div at launch?

02/04/2023

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.