0

How can I stretch a PNG raster coming from GMT (Generic Mapping Tools 4.5.6) in such a way that does align with Google satellite or bing?

Such raster is in wgs84 and crosses two UTM zones (17 and 18 south). I think this is the problem of the misalignment. I use gdalwarp to convert the PNG to GeoTiff. The raster is served by mapserver 5.6.7 and displayed by openlayers 2.11 as WMS over Google or Bing. I use epsg:4326 and epsg:3857.

Other WMS in wgs84 (ie. epsg:4326) are served by mapserver, they don't have this misalignment problem with Google or Bing, but only with the GeoTiff.

I appreciate any support with this, thanks!

Trinimon
  • 13,839
  • 9
  • 44
  • 60
Gery
  • 8,390
  • 3
  • 22
  • 39

2 Answers2

0

Please clarify:

  1. what is the EPSG code of you raster? Is it in geographic coordinates (e.g. EPSG 4326)?
  2. what do you mean "I use epsg:4326 andepsg:3857"? You mean that you use two "PROJECTION" in your mapserver mapfile?
  3. do you use epsg:900913 in mapserver's output projection?

I suggest:

  1. Make sure your raster in correctly projected in epsg:4326 using gdalwarp
  2. Double check that the original coordinate system has the same DATUM (i.e. WGS84) as epsg:4326: different DATUMS (e.g. NAD27-NAD83) need grid files to avoid "misalignment" (see NTV2 specifications here for more on that)
  3. If none of the above works post a screenshot of the misalignment!
Francesco
  • 47
  • 1
  • 7
  • I can suggest a further check: clip your big image to a small tile (maybe around your checkpoint) and process again: of position of smaller tile is ok then you are right, if error still exists then the original image might have a problem. – Francesco May 05 '13 at 09:08
0

Just some other questions for diagnosis :-) Question 0: your big image has bounds -82 -5 -74 -17, but 1° at those latitudes corresponds to about 25 km in west-east direction and so are you sure the bounds have no decimals? Question 1: how much smaller are your small tiles? I see your big image has bounds -82 -5 -74 -17 , what about the small ones? Question 2: did you do exactly the same process for big image and small images? It seems to me that you are forcing a geographic coordinate system (epsg:4326) reference in an image which is actually in a projected coordinate system. That might be causing the deformation. Are you sure that the image coming out of GMT is in lat/long coordinates (i.e. epsg:4326)?

Francesco
  • 47
  • 1
  • 7