2

I want to import an elevation layer into GeoServer for later WMS access. This is the base layer I would like to import - http://en.wikipedia.org/wiki/File:Srtm_ramp2.world.21600x10800.jpg . What I'd like to do is reproject the layer to Mercator so it looks like this http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Mercator_projection_SW.jpg/350px-Mercator_projection_SW.jpg , then somehow convert it to GeoTIFF so that I can import it into GeoServer.

How should I proceed?

I tried using gdal_warp to reproject my layer but it warps the layer completely leaving nothing behind. I had some success reprojecting the layer using G.Projector, but it doesn't work for bigger images and it doesn't georeference the image anyway (GeoServer reports no layers in GeoTIFF file).

4
  • 1
    What software do you have access to?
    – Aaron
    Nov 21, 2012 at 18:31
  • Why don't you look for georeferenced srtm sources? Don't bother with this jpeg!
    – underdark
    Nov 21, 2012 at 19:59
  • If you are hoping to be able to access the elevation heights from the JPEG after reprojection you won't be able to. A jpeg is an 8 bit raster file, which will only hold a value up to 255. Reprojecting the jpeg to TIFF will not make the pixel values from the source jpeg any different. Underdark is correct, grab the source DEM data, like SRTM or GTopo30 if you are looking for global DEMs. Nov 22, 2012 at 3:42
  • The trick is I don't need huge detail, so 8bit precision might just be enough, the reason I want a TIFF is so that I can import it into GeoServer as a WMS layer.
    – haxx
    Nov 22, 2012 at 17:01

1 Answer 1

1

A reprojection means that you want to go from CRS.a to CRS.b . So to reproject an image you can use gdal_translate to assign the said image a CRS.

Un-reprojected images are in pixel-domain which their coordinate system is not making any sense geographically.

The whole world in φ,λ coordinates start from -180 degress to 180 degrees latitude and 90 degrees to -90 degress longtitude.

So you can use gdal_translate to assign the upper left corner their coordinates (ulx,uly) = (-180,90) and lower right (lrx,lry) = (180,-90) and a CRS. For the whole world you can use the common World Sinusoidal

So first you should assign a CRS with gdal_translate :

C:\>gdal_translate -of GTiff -a_srs EPSG:54008 -a_ullr -180 90 180 -90 "Srtm_ramp2.world.21600x10800.jpg" "asdf2.tiff"

And then reproject if you wish to a desired CRS

gdal_warp -s_srs EPSG:54008 -t_srs EPSG:3395 "asdf.tiff" "reprojected.tiff"

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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