Hi, I am trying to make a go.Choroplethmapbox but waheve I do it turns out blank.
the geodata I use (here) are epsg:4326, the keys are: dict_keys(['type', 'geometry', 'properties']) , and the properties contains a geo ID I can use (fylkesnummer).
When I plot this with a simple df with corresponding ID’s:
Hi @NRVA,
It doesn’ t show because you didn’ t pass
featureidkey=‘properties.geoID’
to the `go.Choroplethmapbox` constructor.
Please replace geoID with the right key listed in properties. I didn't understand if this one is the id or the norwegian(?!) word between parantheses.
These coordinates aren’t lons and lats.
If you converted a shapefile to geojson, then repeat the conversion process as follows:
import geopandas as gpd
import json
gdf = gpd.read_file("shapefile_name.shp", encoding='utf-8')
file_CRS= gdf.crs
print(file_CRS)
#if the CRS is not epsg:4326, or its equivalent name WGS84
#then change it as follows:
gdf.to_crs(epsg=4326)
#convert gdf to geojson:
gdf.to_file('geojsfile.json', driver = 'GeoJSON')
with open('geojsfile.json') as geofile:
geojson_data = json.load(geofile)
geojson_data is the geojson dict to be used for choroplethmapbox.