@MahouTsukai0,
Welcome to Plotly forum!
It seems that your geojson file is corrupted. I tried with another geojson file derived from a shapefile
and with a dataframe with synthetic data I got the following map:
To restrict the map to SAU you can update the layout as follows:
fig.update_geos(center ={'lon': 45.0792, 'lat': 23.9959},
lataxis_range= [15, 32], lonaxis_range=[33, 57])
With the same dataframe (synthetic data), but your geojson file it was displayed a map like in your posted image.
The geojsonfile I derived from a shapefile, can be downloaded
here: https://github.com/empet/Datasets/blob/master/SAU-geo.zip
This file already has an id key.
file['features'][0]['properties']
is the dict:
{'GID_0': 'SAU',
'NAME_0': 'Saudi Arabia',
'GID_1': 'SAU.1_1',
'NAME_1': '`Asir',
'VARNAME_1': 'Asir|Aseer|Assyear',
'NL_NAME_1': None,
'TYPE_1': 'Emirate|Mintaqah',
'ENGTYPE_1': 'Region',
'CC_1': None,
'HASC_1': 'SA.AS',
'id': 0}
The region name is the value associated to the key ‘NAME_1’.
The list of all regions contains some longer names:
region=[]
for feat in file['features']:
region.append(feat['properties']['NAME_1'])
and the regions are:
['Asir',
'Al Bahah',
'Al Hudud ash Shamaliyah',
'Al Jawf',
'Al Madinah',
'Al Quassim',
'Ar Riyad',
'Ash Sharqiyah',
"Ha'il",
'Jizan',
'Makkah',
'Najran',
'Tabuk']
```
I hope it helps.