I am new to GIS and I am writing a program that should work with a cartesian coordinate system, ENU. Therefore my plan is convert all point coordinates from WGS84/Pseudo-Mercator to ECEF and then to ENU.

I can get an OSM map in WGS84/Pseudo-Mercator as geotiff via an API.

How can I reproject the raster map image from WGS84/Pseudo-Mercator to ECEF and then to ENU using python?

Or can I neglect the error on a square map of 50kmˆ2 and avoid reprojecting the raster image.

  • EPSG:3857 is a terrible ProjCRS to do analysis in. You don't need to convert to ECEF to reproject to another ProjCRS that would be better. Does the raster actually have elevations? If not, no need to use ENU. – mkennedy Jan 7 at 21:50
  • The map raster itself has no elevation data but I want to put several other raster images on top of the map which give me a DEM. – sehan2 Jan 7 at 22:26

I would recommend using rioxarray.

An example of reprojecting a raster is here.

ECEF - https://epsg.io/4978

import rioxarray

rds = rioxarray.open_rasterio("path_to_raster.tif")
crs = "EPSG:4978" # this depends on the exact projection you want to use
projected = rds.rio.reproject(crs)
|improve this answer|||||
  • When I run the code on my .tif file I get a white raster as my output. Do you have an idea what I am doing wrong? – sehan2 Jan 8 at 18:48
  • What version of GDAL are you using? rio --gdal-version – snowman2 Jan 8 at 19:59
  • I have GDAL version 2.4.3, on a macOS Catalina – sehan2 Jan 8 at 20:22
  • How did you install? – snowman2 Jan 8 at 20:29
  • brew install gdal – sehan2 Jan 8 at 20:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.