I've come up against an issue which I believe involves misalignments between the spherical projection and the auxiliary sphere projection:
e.g. see https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/
https://support.esri.com/en/technical-article/000013950
Trying to convert coordinates from WGS84 Web Mercator Auxiliary Sphere to WGS84
I'm using GeoPandas to load a gdb file that was created in ArcGIS using what I believe is the WKID 3857 coordinate reference system. Because it was created in ArcGIS, the coordinates are meant to be interpreted in the context of the auxiliary sphere.
Without changing the data, I then create a geopackage file using geopandas:
data.to_file("file_name.gpkg", driver="GPKG")
but can't for the life of me figure out how to use set_crs to specify the auxiliary sphere version of EPSG 3857. Instead, it specifies it as the spherical version:
Here's how I set the CRS:
data = data.set_crs(epsg=3857, allow_override=True)
Then to see the crs:
data.crs
<Derived Projected CRS: EPSG:3857>
Name: WGS 84 / Pseudo-Mercator
Axis Info [cartesian]:
- X[east]: Easting (metre)
- Y[north]: Northing (metre)
Area of Use:
- name: World between 85.06°S and 85.06°N.
- bounds: (-180.0, -85.06, 180.0, 85.06)
Coordinate Operation:
- name: Popular Visualisation Pseudo-Mercator
- method: Popular Visualisation Pseudo Mercator
Datum: World Geodetic System 1984 ensemble
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
Even if I don't explicitly set the CRS, reading out the CRS in GeoPandas right after loading the original gdb file, it shows it as the same pseudo Mercator version.
When this gpkg file is loaded by ArcGIS, it is interpreting the coordinates as if they were associated with the spherical projection, rather than the auxiliary sphere projection, and is causing a slight misalignment (on the order of a few km).
Using the Define Projection tool in ArcGIS to re-label the data as being associated with the auxiliary sphere projection does not work. It gives an Error (000146: Cannot alter the spatial reference of [filename].
Is there anything that can be done here? I know that it's possible to create a CRS file and then use the set_crs() function to take in a pyproj.CRS object, rather than specifying it as an EPSG number:
(https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.set_crs.html)
but I'm not fluent enough with these tools to figure out how to create a CRS object that has the auxiliary sphere projection version of 3857.