Hi,
For a project I need to draw a map from Belgium and itβs provinces.
I used the following geojson file:https://raw.githubusercontent.com/mathiasleroy/Belgium-Geographic-Data/master/dist/polygons/geojson/Belgium.provinces.WGS84.geojson
When I test the file on geojson.io I get the following result:
When I draw the map using plotly I get the following result:
The code I use to draw the map is the following:
import plotly.express as px
import json
import pandas as pd
df = pd.read_csv("data/resulted_data/kmeans/CLUSTER_PROVINCES.csv")
with open('geojson.json') as file:
be = json.load(file)
fig = px.choropleth(df, geojson=be, locations="PROVINCE", featureidkey="properties.NameDUT", projection="mercator", color="CLUSTER", hover_data=["PROVINCE", "INFECTION_RATE", "HOSPITALISATION_RATE", "TEST_POS_PERCENTAGE", "CLUSTER"])
fig.update_geos(fitbounds="locations")
fig.show()
I have no idea why it succeeds to draw one province and then fills the background with one color.