I'm trying to reproject a map to EPSG:900913 The image I'm reprojecting is the following http://i.imgur.com/HmfLW.png

I'm using the cities as reference points obtaining the coordinates from Google Maps.

I'm entering the coordinates for each of the reference point this way:

Reference points

So X is longitude in degrees and Y is latitude in degrees.

I'm using the following transformation settings and target srs:

Trasformation settings

Target SRS

Given these settings the "Generate GDAL script" action gives me the following script:

gdal_translate -of GTiff -gcp 39.084 83.0534 12.9639 55.6032 -gcp 569.16 509.313 24.0161 49.838 -gcp 109.924 489.771 14.3701 50.1065 -gcp 420.153 334.656 20.9839 52.2413 -gcp 426.26 581.374 21.2256 48.7345 -gcp 549.618 142.901 23.8623 54.9019 miasta.bmp miasta_translated.bmp
gdalwarp -t_srs epsg:900913 -r near -order 1 -co COMPRESS=NONE  miasta_translated.bmp miasta_modified.tif

It is strange it is not adding the -t_srs parameter to the gdalwarp command, so I've added it myself.

I expect the miasta_modified.tif to contain the Google Maps projection of the original map but instead it contains the following which doesn't look like the Google Maps projection the most noticeable difference being that it is compressed in the vertical direction: http://i.imgur.com/9DMyT.png (I've converted it to PNG for the image hosting to accept the file)

What am I doing wrong?

  • so are you manually georeferencing the orginal image to ll?
    – Brad Nesom
    Jul 31 '11 at 3:37
  • Yes, manually georferencing to Latidude, Longitude (if that's what you mean by ll). I expect gdal_translate to produce a georeferenced image, then gdalwarp to reproject the image based on the info imbedded in the image by gdal_translate and the provided traget SRS to the Google Mercator (EPSG:900913). I suppose it is the same as generating a World file in QGIS and using it to reproject the original image with gdalwarp. I guess something is wrong with my gdal_translate step.
    – axk
    Jul 31 '11 at 9:04
  • you should always georeference an image to it's original creation crs (or as close to it as you can guess). Just a tiny point that usually gets overlooked.
    – Brad Nesom
    Aug 1 '11 at 14:22
  • 1
    @Brad, thanks! It finally got through to me when Pablo answered that one should specify the X,Y coordinates in meters and not in degrees and therefor the coordinates are reference system specific. It is only the question of determining what the reference system is now.
    – axk
    Aug 1 '11 at 16:32

Thats an unusual application of the georreferencing tool.

Google Mercartor is a projected coordinate system, so the units are in meters and you don't actualy need t_srs becouse dstX and dstY should be the target srs coordinates.

But in this case I think that you also need to manualy define -s_srs in gdalwarp as unprojected lat long, oterwise the progran will think that you are working in meters.

  • Thanks! Do you know how to convert from lat/lon to this X,Y coordinate system? I googled for 'convert from lat lon to northing easting' but the calculators I found are zone specific(e.g. UTM with WGS84), as far as I understand they give the X,Y coordinate relative to a specified reference zone. I don't know where I can specify the zone in the referencer.
    – axk
    Jul 31 '11 at 17:32
  • 1
    One solution is to use the "OpenLayers" plugin in Qgis it will set the CRS to google mercartor and display the google map on the background, then use that map to set the control points.
    – Pablo
    Aug 1 '11 at 13:09

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .