I have a JPG image and the corresponding geospatial information on a JFW wolrd file in a ETRS89 geodesical system and UTM coordinates (EPSG:25830)


I want to create a GeoTIFF on a SRS EPSG:4326 and extract the edge lat/lon coordinates [ulx uly lrx lry]. I am using the folowing command without success which maybe requires to do a warp before (although I don't think so because line 2 and 3 are null on JFW file), and I do not know how to extract the edge values on that projection.

gdal_translate -of GTiff -a_srs EPSG:4326 -projwin 0 0 [width_jpg] [height_jpg] [from_file_jpg] [to_file_tif]

Does someone know how to do it? It is necessary to define width and height of image if I am using the whole image?


The code used to display the tile is the following one:

//WMS overlay
var format = 'image/png8';
var tiled = new OpenLayers.Layer.WMS(
           "Show Layer", "http://<IPaddress>:8080/geoserver/" + workSpace + "/wms",
               LAYERS: layerName,
               STYLES: '',
               TRANSPARENT: true,
               VERSION: '1.3.0',
               format: format,
               tiled: true
               sphericalMercator: true,
               buffer: 0,
               displayOutsideMaxExtent: true,
               isBaseLayer: false,
               opacity: 1.0,
               yx: { 'EPSG:4326': true }
  • What happens when you run the command? – til_b Jun 4 '15 at 16:03
  • First thing, rename the .JFW into .JGW (or WLD. which is generic for GDAL). Extrension of .JFW is for image file named as *.J*F, in your case it probable means JFIF. Second, your image can't be in EPSG:4326 with those corner coordinates 484752.5000000000 4811767.5000000000 and therefore assigning projection without warping is wrong. Easiest way for getting the corner coordinates is to run gdalinfo. But rename the worldfile first. – user30184 Jun 4 '15 at 16:07
  • @user30184 you are right. I had the name wrong. And about second point, I was trying to have a GeoTiff with EPSG:4326 SRS but as my image is in EPSG:25830 first I have to translate it and then warp to the new SRS that I was looking for. So the correct commands are: gdal_translate -of GTiff -a_srs EPSG:25830 [from_file_jpg] [to_file_tif] and later use gdalwarp – iblasi Jun 4 '15 at 16:18
  • Or give the source srs in the command gdalwarp -of GTiff -s_srs EPSG:25830 -t_srs EPSG:4326 input.jpg output.tif – user30184 Jun 4 '15 at 16:31
  • However, something that I have checked is that when using OpenLayers to show the layer, when I add the layer it doesn't give error if "yx" attribute is defined EPSG:25830 or EPSG:4326, which is strange because they are different. – iblasi Jun 4 '15 at 16:32

Your Answer

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

Browse other questions tagged or ask your own question.