python: elegant way to find the locations inside the radius of provided location using Latitude and Longitude

341 Views Asked by At

I have a set of coordinates (Longitude and Latitude) in decimal notation, and I'm looking for a way to find the coordinates in a circle with variable radius around each location.

enter image description here

  1. Here in above figure you shown clearly red location, first we want do draw a circle around the center point (red location) here we only know the latitude and longitude of that point so my question is, how to draw circle if we only know the latitude and longitude. (in python without using any module or library )
  2. Second if draw the circle then how to get all the location that are inside the circle.

Please help me to achieve these two points in Python without any use of library or any other module.

1

There are 1 best solutions below

0
Ευάγγελος Γρηγορόπουλος On

You ask a question for drawing etc but you never mentioned on what you plotting on. It sounds a pretty good usecase for matplotlib.basemap(have done a pretty big project embeded in PyQt5).Starting from what you using to visuallize ,plotting a circle is really easy.Also for your second question finding all points in a circle can be infinite depending on what your coordinates decimal number is , i think you just want to check after if a point belongs in this circle witch is fairly easy too. I suggest you take a look to basemap or cartropy libraries. Have fun.