0

I'm looking to create a custom projection based upon EPSG:4087 except instead of the center of the projection being lat 0, lon 0 I would like the projection to be centered around a chosen position.

This should be created on the fly with python as I'm using osgeo/geopandas/etc for to calculate intersections and would prefer not to have to deal with shapes that cross the boundary of the projection. What I would like to do is dynamically create a projection that is centered around my AOI and use that, then switch back once I'm done. My AOI could be anywhere in the world.

Is there any documentation for creating custom projections and, if so, where do I begin looking?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • Answer to this question might help: https://gis.stackexchange.com/questions/457754/using-geopandas-to-calculate-distances-across-continents?noredirect=1#comment747642_457754 – TomazicM Apr 18 '23 at 08:16
  • Thanks. This pointed me in the right direction! – user1671538 Apr 18 '23 at 13:44

1 Answers1

1

For anyone else looking. The answer was to use a proj4 string and edit the lat_0 and lon_0 values before importing.

e.g. This string takes EPSG:4087 and centers it on the antimeridian rather than the prime meridian

custom_crs = '+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=-180 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs'

world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres')) world = world.to_crs(custom_crs)

With this I can do calculations that cross the antimeridian safely.