Closed psychemedia closed 5 years ago
Hi !
I encountered the same Issue with Vega that enforces count clockwise oriented polygon. I don't know the geojson_rewind
library, but shapely
library provides a somehow hidden method to perform the rewind see :
import shapely
# Orient the shape counter clockwise to be Vega conform
df.geometry = df.geometry.map(lambda polygon: shapely.ops.transform(shapely.geometry.polygon.orient)
Thanks for reporting this to you both! I'm not familiar with this particular problem, but it sounds like something that we won't have to include in the folium library, since it is already solved by other libraries. I'm therefore closing the issue, but feel free to add more comments on this topic. We can always reopen if someone wants to make the case for something that has to be done in folium.
@Conengmo Not a folium
issue per se, but for non-expert users using folium
as an easy way of plotting maps, this may be an issue that they encounter but cannot necessarily identify from folium
error messages or fix themselves?
Trying to create a choropleth map using shapes created by the https://github.com/WZBSocialScienceCenter/geovoronoi/ package, folium was was unable to generate valid geojson from a geopandas dataframe created around the voronoi boundaries.
However, I was able to explicitly generate valid geojson from my dataframe as:
I don't have a small reproducible example offhand - just filing this here in case it's useful for others or perhaps merits a guard that will automatically rewind the geojson shapes.