Adding GeoTiff images

Jon's Avatar

Jon

25 Sep, 2011 09:47 PM

Hello,
I have followed the comments provided in this link
However I still cannot get the image to load. I used the natural earth sample and followed the reprojection commands as described.

Is there any other special steps that need to be taken?
Essentially, I would like to use a blue marble image for the base map, and add a rasterized layer on top.
Thanks again,
Jon

  1. Support Staff 2 Posted by AJ on 28 Sep, 2011 05:40 PM

    AJ's Avatar

    Are any errors in your console log when you try to do this?

    In the OS X TileMill app, Select "Console" from the Window menu. (On Linux tail /var/log/tilemill.log.)

  2. Support Staff 3 Posted by Dane on 03 Oct, 2011 11:03 PM

    Dane's Avatar

    Jon,

    Any news on this? Did you see AJ's question?

  3. 4 Posted by Jonathan Zalger on 03 Oct, 2011 11:45 PM

    Jonathan Zalger's Avatar

    Hi Dane,
    I have been able to resolve this. When I re-launched TileMill and tried everything again, it seemed to work OK.
    Thanks again for the support.

    Jon

  4. Support Staff 5 Posted by Tom MacWright on 04 Oct, 2011 04:42 PM

    Tom MacWright's Avatar

    Great, glad it's working now!

  5. Tom MacWright closed this discussion on 04 Oct, 2011 04:42 PM.

  6. Jonathan Zalger re-opened this discussion on 06 Oct, 2011 12:09 AM

  7. 6 Posted by Jonathan Zalger on 06 Oct, 2011 12:09 AM

    Jonathan Zalger's Avatar

    Hello,
    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…

    Thanks again,

    Jon

  8. Support Staff 7 Posted by Dane on 06 Oct, 2011 04:50 AM

    Dane's Avatar

    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.

    $ gdalinfo tmpMerc.tif
    Driver: GTiff/GeoTIFF
    Files: tmpMerc.tif
    Size is 2170, 1411
    Coordinate System is:
    PROJCS["Popular Visualisation CRS / Mercator",
        GEOGCS["Popular Visualisation CRS",
            DATUM["Popular_Visualisation_Datum",
                SPHEROID["Popular Visualisation Sphere",6378137,0,
                    AUTHORITY["EPSG","7059"]],
                AUTHORITY["EPSG","6055"]],
            PRIMEM["Greenwich",0],
            UNIT["degree",0.0174532925199433],
            AUTHORITY["EPSG","4055"]],
        PROJECTION["Mercator_1SP"],
        PARAMETER["central_meridian",0],
        PARAMETER["scale_factor",1],
        PARAMETER["false_easting",0],
        PARAMETER["false_northing",0],
        UNIT["metre",1,
            AUTHORITY["EPSG","9001"]],
        EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],
        AUTHORITY["EPSG","3785"]]
    Origin = (269.328999999999951,48.656999998270649)
    Pixel Size = (0.006468559277941,-0.006468559277941)
    Metadata:
      AREA_OR_POINT=Area
    Image Structure Metadata:
      INTERLEAVE=PIXEL
    Corner Coordinates:
    Upper Left  (     269.329,      48.657) (  0d 0' 8.71"E,  0d 0' 1.56"N)
    Lower Left  (     269.329,      39.530) (  0d 0' 8.71"E,  0d 0' 1.27"N)
    Upper Right (     283.366,      48.657) (  0d 0' 9.16"E,  0d 0' 1.56"N)
    Lower Right (     283.366,      39.530) (  0d 0' 9.16"E,  0d 0' 1.27"N)
    Center      (     276.347,      44.093) (  0d 0' 8.94"E,  0d 0' 1.42"N)
    Band 1 Block=2170x1 Type=Byte, ColorInterp=Red
    Band 2 Block=2170x1 Type=Byte, ColorInterp=Green
    Band 3 Block=2170x1 Type=Byte, ColorInterp=Blue
    
  9. 8 Posted by Jonathan Zalger on 06 Oct, 2011 10:46 AM

    Jonathan Zalger's Avatar

    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.

    Thanks again,

    Jon

  10. Support Staff 9 Posted by Dane on 06 Oct, 2011 05:30 PM

    Dane's Avatar

    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 mercator (epsg:3857).

    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.

  11. 10 Posted by Jonathan Zalger on 07 Oct, 2011 12:52 AM

    Jonathan Zalger's Avatar

    Thanks for the response.
    I played around with the translations with GDAL and I believe I have it working reliably now.

    Thanks again for your help,

    Jon

  12. Will White closed this discussion on 24 Oct, 2011 03:50 PM.

Comments are currently closed for this discussion. You can start a new one.