-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
country map for Iran #31989
Comments
سلام @MammadTavakoli! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue! To correctly map ISO 3166-2 codes with provinces on a country map for Iran, you can use the GeoJSON data provided in the Apache Superset repository. Each feature in the GeoJSON contains an "ISO" property that corresponds to the ISO 3166-2 code and a "NAME_1" property that represents the province name. You can use these properties to map the codes to the provinces on a map. Here's a sample code snippet to extract and map the ISO codes to province names: import json
# Load the GeoJSON data
geojson_data = '''{
"type": "FeatureCollection",
"name": "iran",
"features": [
{ "type": "Feature", "properties": { "ISO": "IR-02", "NAME_1": "West Azarbaijan" }, "geometry": { "type": "Polygon", "coordinates": [] } },
{ "type": "Feature", "properties": { "ISO": "IR-01", "NAME_1": "East Azarbaijan" }, "geometry": { "type": "Polygon", "coordinates": [] } },
{ "type": "Feature", "properties": { "ISO": "IR-03", "NAME_1": "Ardebil" }, "geometry": { "type": "Polygon", "coordinates": [] } }
// ... other features
]
}'''
# Parse the GeoJSON data
data = json.loads(geojson_data)
# Create a mapping of ISO codes to province names
iso_to_province = {feature['properties']['ISO']: feature['properties']['NAME_1'] for feature in data['features']}
# Example usage
print(iso_to_province) This code will output a dictionary mapping ISO codes to province names, which you can use to display the names on a map [1]. To display province names in languages other than English, you would need a translation of the province names. The GeoJSON data only provides the names in English, so you would need an additional data source that provides the translations. Once you have the translations, you can replace the "NAME_1" values with the translated names in your map visualization. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
If you're seeing HTML code instead of a rendered table or Markdown in GitHub, it likely means that the content is being misinterpreted. To ensure the correct rendering, use the following Markdown-friendly version of the table and content: Thanks, @dosu, for pointing this out! I checked the following resources:
Below is the mapping between the two sources for Iran: | Code | Wiki Subdivision Name (ISO 3166-2) | ISO (GitHub Content) | Name in GitHub Content |
|--------|------------------------------------|-----------------------|----------------------------------|
| IR-01 | Gilan | IR-01 | East Azarbaijan |
| IR-02 | Mazandaran | IR-02 | West Azarbaijan |
| IR-03 | East Azerbaijan | IR-03 | Ardebil |
| IR-04 | West Azerbaijan | IR-04 | Esfahan |
| IR-05 | Kermanshah | IR-05 | Ilam |
| IR-06 | Khuzestan | IR-06 | Bushehr |
| IR-07 | Fars | IR-07 | Tehran |
| IR-07 | Fars | IR-07 | Alborz |
| IR-08 | Kerman | IR-08 | Chahar Mahall and Bakhtiari |
| IR-10 | Isfahan | IR-10 | Khuzestan |
| IR-11 | Sistan and Baluchestan | IR-11 | Zanjan |
| IR-12 | Kurdistan | IR-12 | Semnan |
| IR-13 | Hamadan | IR-13 | Sistan and Baluchestan |
| IR-14 | Chaharmahal and Bakhtiari | IR-14 | Fars |
| IR-15 | Lorestan | IR-15 | Kerman |
| IR-16 | Ilam | IR-16 | Kordestan |
| IR-17 | Kohgiluyeh and Boyer-Ahmad | IR-17 | Kermanshah |
| IR-18 | Bushehr | IR-18 | Kohgiluyeh and Buyer Ahmad |
| IR-19 | Zanjan | IR-19 | Gilan |
| IR-20 | Semnan | IR-20 | Lorestan |
| IR-21 | Yazd | IR-21 | Mazandaran |
| IR-22 | Hormozgan | IR-22 | Markazi |
| IR-23 | Tehran | IR-23 | Hormozgan |
| IR-24 | Ardabil | IR-24 | Hamadan |
| IR-25 | Qom | IR-25 | Yazd |
| IR-26 | Qazvin | IR-26 | Qom |
| IR-27 | Golestan | IR-27 | Golestan |
| IR-28 | North Khorasan | IR-28 | Qazvin |
| IR-29 | South Khorasan | IR-29 | South Khorasan |
| IR-30 | Alborz | IR-30 | Razavi Khorasan | Suggestions for Improvement:
Let me know if I can assist further! 😊 |
Hey @MammadTavakoli! It looks like you're diving deep into some mapping and data alignment. While I can help with technical questions, bugs, and engineering knowledge, I'm not quite equipped to handle suggestions for documentation improvements or data corrections. If you think I should be able to help with this, feel free to reach out to the Dosu Team. They'll be happy to hear your thoughts! 😊 To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosuy tanks, as i see there is two IR-07 (for tehran and alborz) but thy are difrence. also there is not IR-09 that one of then can replace with it |
I use ISO 3166-2:IR for creating ISO 3166-2 for Iran and create a country map, but it not correctly mapping code with province in map.
How can solve this problem?
Also is there a way to show the name of province name in other than the English?
The text was updated successfully, but these errors were encountered: