Reputation: 7832
I'm having a bit of trouble with projecting a DataFrame in GeoPandas from EPSG:4326 to EPSG:3857 in a notebook. My original dataset looks like this:
0 POLYGON ((-97.44573128938707 25.889635, -97.35...
1 POLYGON ((-97.61263173798922 25.995165, -97.57...
2 POLYGON ((-97.583158 25.96192090708935, -97.58...
3 POLYGON ((-97.461286 25.89270423248976, -97.46...
4 POLYGON ((-97.33941 25.926101719766, -97.33941...
...
4971 POLYGON ((-102.906172 36.475082, -102.906172 3...
4972 POLYGON ((-102.772786 36.481234, -102.772786 3...
4973 POLYGON ((-102.639385 36.48728000000001, -102....
4974 POLYGON ((-102.50597 36.49322100000001, -102.5...
4975 POLYGON ((-102.37254 36.499056, -102.37254 36....
Name: geometry, Length: 4976, dtype: object
visualized:
When I attempt to reproject this to EPSG:3857:
reprojected = texas.to_crs(epsg=3857)
I'm getting some huge numbers as an output (which obviously aren't correct coordinates):
0 POLYGON ((-10847609.18711273 2985418.174237921...
1 POLYGON ((-10866188.46006429 2998482.12034216,...
2 POLYGON ((-10862907.45855956 2994365.44865411,...
3 POLYGON ((-10849340.7295776 2985797.960665139,...
4 POLYGON ((-10835773.55531768 2989931.200110516...
...
4971 POLYGON ((-11455462.66652503 4366190.37784271,...
4972 POLYGON ((-11440614.20492607 4367042.077273317...
4973 POLYGON ((-11425764.07353476 4367879.167666097...
4974 POLYGON ((-11410912.38367058 4368701.784074328...
4975 POLYGON ((-11396059.02401403 4369509.784691155...
Name: geometry, Length: 4976, dtype: object
Any ideas as to why such a simple reprojection wouldn't be working correctly? I've tried using various forms of the to_crs
function including texas.to_crs({'init': 'epsg:3857'})
and have triple checked that texas.crs
is set to {'init': 'epsg:4326'}
.
For reference I'm using GeoPandas 0.5.1 and PyProj 2.3.1. Edit: I've also tried upgrading to GeoPandas 0.6 just for funsies, but no dice :(.
Thanks in advance!
Upvotes: 1
Views: 1660
Reputation: 191
I think those numbers are correct. If you take a look at this site (https://epsg.io/3857) you see that your values are in the projected bounds.
Upvotes: 4