Tom MacWright closed this discussion
on 04 Oct, 2011 04:42 PM.
Jonathan Zalger re-opened this discussion
on 06 Oct, 2011 12:09 AM
6 Posted by Jonathan Zalger on 06 Oct, 2011 12:09 AM
I understand this discussion may have closed regarding adding GeoTiff images, and I believed it was working, however I still seem to be have a lot of trouble getting some GeoTiffs to show.
I have attached an image in case you had a moment to see if there is anything wrong with the image. Gdalinfo seems to indicate its in the correct format (I believe..)
Sorry for opening the discussion again, but I am really struggling with this…
Support Staff7 Posted by Dane on 06 Oct, 2011 04:50 AM
That file appears to have spherical mercator (the right target
projection) assigned but the data does not appear to actually be in
that projection, based on the gdalinfo output below (which shows
corner coordinates that look more like degrees than meters). So, to
help more you may need to list the exact commands you used so we
can deduce where you went wrong in handling projections.
8 Posted by Jonathan Zalger on 06 Oct, 2011 10:46 AM
Thanks again for looking into it. The image was first exported (from a program called Grads), as a jpeg. Then I tried a few things to get it to read in tileMill.
I was under the impression that the original image was in a mercator project, and just needed to be geoReferenced. The first thing I did was to use gdal_translate to convert to geoTiff, adding the corner control points, and assign the projection:
gdal_translate -of GTiff -a_srs EPSG:3785 -gcp 0 0 269.329 48.657 -gcp 0 1582 269.329 39.532 -gcp 2048 0 283.363 48.657 -gcp 2048 1582 283.363 39.532 tmpsfc.jpg tmpsfc.tif
This did not seem to help, so I also tried gdalwarp,
gdalwarp -s_srs EPSG:3785 -t_srs EPSG:3875 -r bilinear tmpsfc.tif tmpMerc.tif
Which stretched the image a bit, but still does not seem to load correctly.
If you have any ideas that may help, I would really appreciate it.
Support Staff9 Posted by Dane on 06 Oct, 2011 05:30 PM
Your control points do not look like mercator. How did you come
upon those? It seems like it would be best/easiest to try to get
the image out of this Grads program in wgs84/long-lat,
georeference, then warp to mercator. Are you sure that Grads was
producing mercator originally? If it is producing mercator then I
bet it is standard world mercator (epsg:3395) not spherical
Lastly, since this is not a TileMill issue, I would recommend
finding some data you know your image should line up with, open it
in QGIS and doing the rectification there before trying to get
things loaded in TileMill.