I am trying to transform a shapefile of polygons projected on CRS: EPSG:26918 to EPSG:4326 so that I can perform a spatial join in GeoPandas over two shapefiles.
My previous code allowed me to simply set the CRS as:
gdf.crs = {'init': 'epsg:4326'}
However, with GeoPandas now using a new version of proj that reverses how it reads long,lat, my map is now completely reversed after that operation -- it is upside down and backwards.
I get the warning:
..\crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated.
'<authority>:<code>' is the preferred initialization method.
When making the change, be mindful of axis order changes:
https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 return _prepare_from_string(" ".join(pjargs))
Is there an easy way to handle this?
More info on gdf.crs before conversion:
<Projected CRS: EPSG:26918>
Name: NAD83 / UTM zone 18N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: North America - 78°W to 72°W and NAD83 by country
- bounds: (-78.0, 28.28, -72.0, 84.0)
Coordinate Operation:
- name: UTM zone 18N
- method: Transverse Mercator
Datum: North American Datum 1983
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
CRS of shapefile I'd like to spatial join with:
<Geographic 2D CRS: +init=epsg:4326 +type=crs>
Name: WGS 84
Axis Info [ellipsoidal]:
- lon[east]: Longitude (degree)
- lat[north]: Latitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich