The folium documentation for a circle says that the radius parameter is "Circle radius in pixels"
http://folium.readthedocs.org/en/latest/#circle-markers
The live example shows that it's calling L.circle() JavaScript method and passing the radius to that method.
Jumping over to Leaflet documentation, it says that radius is "... radius of a circle. Units are in meters."
http://leafletjs.com/reference.html#circle
So isn't the radius passed to folium actually the radius in meters? If that's the case, I can submit a PR to update the documentation. Otherwise, am I missing a conversion somewhere?
So isn't the radius passed to folium actually the radius in meters? If that's the case, I can submit a PR to update the documentation. Otherwise, am I missing a conversion somewhere?
Otherwise, am I missing a conversion somewhere?
You are probably right. I don't recall any conversion in the old API nor in the new one (@Bibmartin). If leaflet says meters it should be meters. Feel free to send that PR :wink:
Beware that Leaflet makes the distinction between circle whose radius is in meter, and circleMarker whose radius is in pixel (insensitive to zoom).
So this is not only a documentation mistake : we have bound folium.CircleMarker onto leaflet.circle. (My fault ; sorry) It would worth creating a second object (or an option?) to have both behaviors in folium.
Definitely both ;-)
Hi all..
Umm.. I am struck at the same problem..
I want to draw a circle with radius= 10 km.. But the function folium.CircleMarker still seems to be bound to a pixel version of it, as pointed by @BibMartin.
Any alternate help would be really appreciated. if not, I am also interested to change the code...PR
Thanks a lot.
For anyone else struck in this dilemma, Do a Ctrl+F of circleat http://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Quickstart.ipynb
Btw, @ocefpaf would like to bring to your attention (if not already), that the official doc at http://folium.readthedocs.io/en/latest/quickstart.html is still not mentioning about the distinction between Circle and CircleMarker. :)
Btw, @ocefpaf would like to bring to your attention (if not already), that the official doc at http://folium.readthedocs.io/en/latest/quickstart.html is still not mentioning about the distinction between Circle and CircleMarker. :)
PR welcomed :smile:
Oh wait. The docs are updated! ReadTheDocs is an old version that only @wrobstory has access and it is dangerously outdated.
@wrobstory can you take that down? We are publishing the docs at http://python-visualization.github.io/folium/quickstart.html for a while now.
Done, no more read-the-docs.
Great to see the continued work on this project!
Thanks @wrobstory!
Most helpful comment
Done, no more read-the-docs.
Great to see the continued work on this project!