I am trying to use a shapefile of Great Britain to display some heatmap results on top of it. My data is in EPSG 4326 (longitude, latitude), but the shapefile is in EPSG 27700. I tried re-projecting it, but somehow this goes wrong for England. I have only just started working with geopandas (and spatial data), so maybe this is an obvious mistake.
Shapefile from https://data.gov.uk/dataset/3fd8d2d2-b591-42ff-b333-c53a6a513e96/countries-december-2017-full-clipped-boundaries-in-great-britain
Code:
import pandas as pd
import numpy as np
import geopandas as gpd
UK_map = gpd.read_file(r'C:\Users\Downloads\Countries__December_2017__Boundaries-shp\Countries__December_2017__Boundaries.shp')
UK_map = UK_map.to_crs(epsg=4326)
When I check UK_map with UK_map.crs
and UK_map.plot()
before transformation, everything seems fine.
But after transformation, England has lots of "inf" in geometry:
Can anyone help?
UK_map.crs
what is the result? – sutan Aug 26 '20 at 6:24