dosubot[bot] commented on issue #30607:
URL: https://github.com/apache/superset/issues/30607#issuecomment-2413448167

   <!-- Greeting -->
   Hey @tienhung2812, I'm here to help you with any bugs, questions, or 
contributions you have. Let's tackle this issue together!
   
   <!-- Answer -->
   To correct the incorrect Vietnam province names in the country map chart, 
you need to update the `NAME_1` property in the GeoJSON data. For example, to 
change "Đông Nam Bộ" to "Đồng Nai", you would modify the relevant feature in 
the GeoJSON file. Similarly, update the other incorrect names as follows:
   
   1. Change "Đông Nam Bộ" to "Đồng Nai" for ISO code VN-39.
   2. Change "Đông Bắc" to "Bắc Kạn" for ISO code VN-53.
   3. Change "Đồng Bằng Sông Hồng" to "Hưng Yên" for ISO code VN-66.
   
   You can automate this process using a Python script with GeoPandas:
   
   ```python
   import geopandas as gpd
   
   # Load your GeoJSON file
   vietnam = gpd.read_file('path_to_your_geojson_file')
   
   # Function to replace names
   def replace_name(gdf, old_name, new_name):
       gdf.loc[gdf['NAME_1'] == old_name, 'NAME_1'] = new_name
   
   # Replace incorrect names
   replace_name(vietnam, 'Đông Nam Bộ', 'Đồng Nai')
   replace_name(vietnam, 'Đông Bắc', 'Bắc Kạn')
   replace_name(vietnam, 'Đồng Bằng Sông Hồng', 'Hưng Yên')
   
   # Save the updated GeoJSON
   vietnam.to_file('path_to_updated_geojson_file', driver='GeoJSON')
   ```
   
   This script will help ensure that all province names are correctly updated 
in your GeoJSON file 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-plugin-chart-country-map/src/countries/vietnam.geojson)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-plugin-chart-country-map/scripts/Country%20Map%20GeoJSON%20Generator.ipynb)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to