I have received a geocoded .png image (2380 x 2396 pixels) that comes with a world file containing georeferencing information in UTM format:

worldFileParams = [0.5,0.0,0.0,-0.5,690920.0,5335407.5]

Now, I would like to overlay this image with map data. I thought about using OSM data for that purpose. In order to solve the task, I tried the following workflow:

  1. Download shapefile of OpenStreetMap data from https://mapzen.com/data/metro-extracts/
  2. Load both shapefile(s) and .png raster image in QGIS.

However, this surely naive approach hasn't worked, as both datasets are not co-located in QGIS, which is probably caused by the fact that QGIS data is provided in WGS84 (EPSG:4326) coordinates, while the png world file data is in UTM32N (EPSG:32632). When I try to reproject the png file, I receive the error

ERROR 1: latitude or longitude exceeded limits ERROR 1: Too many points (2401 out of 2401) failed to transform, unable to compute output bounds.

Thus, long story short: What can I do to reach my goal? Although using GDAL, QGIS, MATLAB and OpenStreetMap would come in handy for me, I am not bound to using these things.

  • How did you try to reproject the png file? There should be no problem if you do it right and the top-left coordinate should change into 11.5666096466514 48.1432449377215 as long-lat coordinates.
    – user30184
    Jan 11, 2018 at 11:58
  • Apparently I made a mistake before. Now I have used gdalwarp -overwrite -s_srs EPSG:32632 -t_srs EPSG:4326 -of GTiff imageUTM.png imageWGS.tif and it worked...
    – Michael
    Jan 11, 2018 at 12:16
  • Still, the shape file representation of OpenStreetMap does look nothing like the original online OSM product. How can one generate a raster map from OSM data?
    – Michael
    Jan 11, 2018 at 12:25
  • 1
    the OSM data is in raw WGS84 (EPSG:4326) CRS and, depending on your on-the-fly-projection settings in QGIS but I assume, is displayed as such. the OSM webmap is projected in Spherical Mercator ('WebMercator', e.g. EPSG:3857). try setting the on-the-fly-projection (bottom far-right button in QGIS) to EPSG:3857 to get the same visual representation. generating raster data from OSM data is a whole different topic...quite unlikely to be what you want and rather unusual.
    – geozelot
    Jan 11, 2018 at 12:40

2 Answers 2


What you did is correct, it is just missing a small part.

Your problem is that QGIS 'thinks' that your image is in wgs84 as there comes no projection information with it. Go into the properties for the file (in QGIS) and set the crs and voila!

Also make sure that your project is set to using a CRS (you probably also wants UTM32N there)

(I do not have QGIS available here, so I cannot give you the details)

As your question on how to style OSM shape files, please ask that as a separate one - we try to keep one topic per tread here.


I just solved a similar problem, trying to import several geocoded JPEGs with lon/lat-Values from exif-header to qgis.

I parsed the exif-headers and created world-files and prj-files for every image with epsg 4326, f. e.:


Importing my 5312 x 2988 pixel image to qgis an measuring with srid 25832 the above resx/resy-Values (0.000001/-0.000001) create an extent ca. 37 x 33 km for each image.

Looking at your resx/resy-parameters 0.5/-0.5 would create a huge extent for your 2380 x 2396 pixel-image with 2380 x 0.5 = 1190 degrees width and 1198 degrees height, probably the reason for the error-message "latitude or longitude exceeded limits"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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