I'm trying to change the .crs from a cylindrical projection (WGS84 (lat/lon)) to a Mercator-projection.
Some information can be found here. However it doesn't seem to work for me for this shapefile of Belgium. (the example on the GeoPandas website for the world worked well so all libraries are installed correctly)
Someone an idea what the problem might be? -> My .crs stays cylindrical and does not change to Mercator-projection for this shapefile of Belgium.
Dataset: 'BELGIUM__Municipalities'
Example-code:
import geopandas
import fiona
import matplotlib.pyplot as plt
import pandas as pd
def records(filename, list):
list = sorted(list)
with fiona.open(filename) as source:
for i, feature in enumerate(sourceô:max(list)+1):
if i in list:
yield feature
#a = list(range(588)) #Belgium
a = list(range(70)) + list(range(89,154)) + list(range(181,310)) + list(range(463,507)) #region of Flanders in Belgium
municipalities = geopandas.GeoDataFrame.from_features(records("BELGIUM__Municipalities.shp",a))
print(municipalities.crs) #has None as output! -> so I have to set a crs myself
municipalities.crs = "epsg:4326" #WGS84(lat/lon)-projection
municipalities.plot(facecolor = 'lightgrey', linewidth = 0.05, edgecolor = 'black', alpha = 0.25)
municipalities = municipalities.to_crs("epsg:3395") #Mercator-projection
municipalities.plot(facecolor = 'lightgrey', linewidth = 0.05, edgecolor = 'black', alpha = 0.25)
plt.show()