To obtain polygons of Moscow districts for use in a Folium map, you can follow these steps:
1. Official Sources
-
Moscow Government Open Data Portal
Visit data.mos.ru (official source for Moscow city data). Search for datasets like:
- "Administrative boundaries of Moscow districts" (Административные границы районов Москвы).
- "Moscow City Districts" (Районы города Москвы).
- Look for datasets in GeoJSON, KML, or Shapefile formats.
Example dataset:
- Administrative boundaries of Moscow.
-
Rosreestr (Russian Federal Service for State Registration)
Use the Public Cadastral Map to export boundaries manually (limited to small areas).
2. OpenStreetMap (OSM)
-
Use Overpass API to extract Moscow districts:
Example query for Moscow districts:
[out:json][timeout:25];
area["name"="Москва"]->.searchArea;
relation["type"="boundary"]["admin_level"="6"](area.searchArea);
out body;
Run this in the Overpass Turbo IDE and export as GeoJSON.
-
GeoFabrik
Download the Russia OSM dataset, then filter districts using GIS tools (e.g., QGIS).
3. GitHub Repositories
Search GitHub for pre-processed GeoJSON files. Example queries:
4. GIS Tools for Processing
-
QGIS
If you find Shapefiles (e.g., from data.mos.ru), convert them to GeoJSON:
- Load the Shapefile in QGIS.
- Right-click the layer → Export → Save Features As.
- Choose
GeoJSON as the output format.
-
Online Converters
Use tools like MyGeodata Converter or QGIS Cloud for conversion.
5. Example Usage in Folium
Once you have a GeoJSON file, load it into Folium:
import folium
# Load GeoJSON (replace with your file path)
geojson_path = "moscow_districts.geojson"
# Create a map centered on Moscow
m = folium.Map(location=[55.7558, 37.6173], zoom_start=10)
# Add GeoJSON layer
folium.GeoJson(geojson_path, name="Moscow Districts").add_to(m)
# Save or display
m.save("moscow_map.html")
Notes:
- Licensing: Ensure the data is free to use (e.g., OSM uses Open Database License).
- Accuracy: Administrative boundaries may change over time; verify the dataset's update date.
- Simplification: Large GeoJSON files can slow down Folium. Simplify geometries using tools like Mapshaper.
Let me know if you need help processing the data! 🗺️