New answers tagged projection-conversions
The error itself means that GDAL fails when it tries to transform coordinates from the source srs into target srs. The source srs is supposed to be EPSG:4326 but by looking at the corner coordinates it can't be right. Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0,12698.0) Upper Right ( 1091.0, 0.0) Lower Right ( 1091.0,12698.0) ...
You might run into a problem with the antipodal point of the projection. If you clip your raster to the area of validity (that is Europe), it works: gdal_translate -projwin -26 75 44 28 -of GTiff bluemarble.tif bluemarble-Europe.tif gdalwarp -overwrite -s_srs EPSG:4326 -t_srs EPSG:3035 -of GTiff bluemarble-Europe.tif bluemarble-3035.tif You might take ...
This script converts lat/lon coordinates to mercator coordinates using mercator scale r = 6378137; scale = cos(lat * pi / 180.0); x = scale * lon * pi * r / 180; y = scale * r * log( tan((90+lat) * pi / 360) );
It's been a few months since I posted this. @michael-miles-stimson suggested that the correct way to do this would be to sample points along each edge of the bounding box, project them, then build an encompassing bounding box on those points. The drop-in Python/GDAL code below does this and allows you to select the number of interpolating points you'd like ...
You could just coerce the extent into a SpatialPolygons object and then use "spTransfrom". library(sp) ( e <- raster::extent(-5559753, -4447753, -4447852, -3335852) ) e <- as(e, "SpatialPolygons") sp::proj4string(e) <- "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" e.geo <- sp::...
Looks like this can be done using the raster package. There is a projectExtent function that returns a warped raster object. Then just need to extract extent(). extent(projectExtent(raster_object,"+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")) Thanks to mdsumner's comment!
Top 50 recent answers are included