Skip to content

Add possibility to have unembedded GeoJSON.#290

Merged
ocefpaf merged 2 commits intopython-visualization:masterfrom
BibMartin:issue285
Dec 5, 2015
Merged

Add possibility to have unembedded GeoJSON.#290
ocefpaf merged 2 commits intopython-visualization:masterfrom
BibMartin:issue285

Conversation

@BibMartin
Copy link
Copy Markdown
Contributor

Addresses #285.
Instead of having an embed option as @ocefpaf suggested, the user shall pass data=open(filename) if he wants to have the file embedded, and data=filename otherwise.

Note that the style_function cannot be applyed in the latter case, because the file won't be openned.

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Dec 5, 2015

Note that the style_function cannot be applied in the latter case, because the file won't be opened.

How difficult would it be to read the style from the file and still not embed? We do not need to do this in this PR, but I want to keep that idea around.

@ocefpaf ocefpaf self-assigned this Dec 5, 2015
@ocefpaf ocefpaf added the enhancement Feature request or idea about how to make folium better label Dec 5, 2015
@ocefpaf ocefpaf added this to the v0.2.0 milestone Dec 5, 2015
Comment thread folium/features.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not opposed to this pattern: read in dir(x), but I think hasattr(object, name) is more common? Any special reason for doing that?

@BibMartin
Copy link
Copy Markdown
Contributor Author

@ocefpaf

I am not opposed to this pattern: read in dir(x), but I think hasattr(object, name) is more common? Any special reason for doing that?

I guess this has few importance ; I'm just a goldfish who forgot the clean syntax. Corrected.

Same as above. I see isinstance(object, dict) more that type(object) is dict. Again, not opposed, just curious.

This one is more important ; for instance, someone may be willing to provide an OrderedDict instead of a dict ; yet type(OrderedDict()) is dict is False while isinstance(OrderedDict(),dict) is True. So, your (official) syntax is better.

I've corrected both lines.

@ocefpaf
Copy link
Copy Markdown
Member

ocefpaf commented Dec 5, 2015

I guess this has few importance

I just asked for shear curiosity. Sometimes I learn new things by asking 😉

So, your (official) syntax is better.

I suspected so, but haven't tested it. Good to know!

Thanks! Merging this...

ocefpaf added a commit that referenced this pull request Dec 5, 2015
Add possibility to have unembedded GeoJSON.
@ocefpaf ocefpaf merged commit 15b3a0d into python-visualization:master Dec 5, 2015
@BibMartin BibMartin deleted the issue285 branch December 7, 2015 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request or idea about how to make folium better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants