So the problem is this line from the docs:
hres (float) – The horizontal resolution of the generated grid, given in the same units as the x and y parameters. Default 50000.
Here you pass
hres=5000, which is saying “generate a grid with 5000 units between points”. For points coming through a map projection, this is generally meters, except that you’re using
PlateCarree(), where the points are given in degrees. So for your current map projection, you should use an
hres value in degrees, so maybe 0.25 or 0.1. You’ll also want to adjust
search_radius to a value in degrees (rather than the current 40km) as well–or leave it out and it will try to calculate something sensible.
CLICK HERE to find out more related problems solutions.