Scripting: "Unable to project currently loaded data for export"

gilbertdrgilbertdr Global Mapper UserPosts: 12
edited February 2012 in Bug Report
Hi,

I've been successfully running Global Mapper scripts from the command-line but today encountered an issue when attempting to generate KML for UTM GeoTIFFs which are in the southern hemisphere.

The KML was generated but I then discovered that the LatLonBox and LatLonAltBox fields were not reprojected from UTM to LatLon.

In order to debug I launched the Global Mapper GUI, selected "File->Run Script..." and then monitored the output. I discovered that Global Mapper displays a warning about being "Unable to project currently loaded data for export":

Removed all loaded overlays.
Importing file D:\KML_Testing\Volcano\volcano_subset.tif...
Exporting raster data to file D:\KML_Testing\Volcano\from_gm_script\volcano_subset.kml...
WARNING: Unable to project currently loaded data for export.
Script processing COMPLETED.


The odd thing is if I then hit "Run Script" again it exports properly, even though the first line in my script is UNLOAD ALL:

Removed all loaded overlays.
Importing file D:\KML_Testing\Volcano\volcano_subset.tif...
Exporting raster data to file D:\KML_Testing\Volcano\from_gm_script\volcano_subset.kml...
Script processing COMPLETED.


I attempted to specify the EPSG projection in the script to see if that would make a difference but it didn't make any difference.

In order to verify that it wasn't an issue with my UTM GeoTIFFs (generated via some processing code) I downloaded a UTM GeoTIFF from http://earthobservatory.nasa.gov. (http://eoimages.gsfc.nasa.gov/images/imagerecords/51000/51020/puyehue_ast_2011192_lrg.tif)

I've attached the simple script and test GeoTIFF.

I'm running with Global Mapper 13, 64bit version.

Could you please see if you can reproduce this issue?

Thanks,

-- Dan

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Dan,

    I am so far unable to get it to fail for me and your script looks correct. The error would imply that the file came in with the wrong projection system so it wasn't properly placed and couldn't be reprojected. I would first suggest getting the latest v13 build to see if that fixes the problem. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • gilbertdrgilbertdr Global Mapper User Posts: 12
    edited February 2012
    Thanks for your quick reply. I grabbed the latest 64bit build but am unfortunately still getting the same results.

    Here are some screen grabs.

    This one shows the initial result:

    first_run.jpg

    Here are the results after immediately hitting the "Run Script" button again:

    second_run.jpg

    Here are the results of running "gdalinfo" on the test image:

    Driver: GTiff/GeoTIFF
    Files: volcano_subset.tif
    Size is 400, 400
    Coordinate System is:
    PROJCS["WGS 84 / UTM zone 18S",
    GEOGCS["WGS 84",
    DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
    AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-75],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32718"]]
    Origin = (741395.946266112500000,5505701.240294898900000)
    Pixel Size = (15.000000000000000,-15.000000000000000)
    Metadata:
    TIFFTAG_SOFTWARE=Adobe Photoshop CS5 Macintosh
    TIFFTAG_DATETIME=2011:06:14 17:06:13
    TIFFTAG_XRESOLUTION=1
    TIFFTAG_YRESOLUTION=1
    TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
    AREA_OR_POINT=Area
    Image Structure Metadata:
    INTERLEAVE=PIXEL
    Corner Coordinates:
    Upper Left ( 741395.946, 5505701.240) ( 72d 8'54.91"W, 40d33'51.44"S)
    Lower Left ( 741395.946, 5499701.240) ( 72d 8'46.65"W, 40d37'5.79"S)
    Upper Right ( 747395.946, 5505701.240) ( 72d 4'40.08"W, 40d33'45.07"S)
    Lower Right ( 747395.946, 5499701.240) ( 72d 4'31.61"W, 40d36'59.41"S)
    Center ( 744395.946, 5502701.240) ( 72d 6'43.31"W, 40d35'25.45"S)
    Band 1 Block=400x6 Type=Byte, ColorInterp=Red
    Band 2 Block=400x6 Type=Byte, ColorInterp=Green
    Band 3 Block=400x6 Type=Byte, ColorInterp=Blue


    I'm not sure if it is strictly a problem with UTM GeoTIFFs in the Southern Hemisphere, but so far I have only experienced this issue with these files. Running similar tests on UTM GeoTIFFs in the Northern Hemisphere work as expected. I first encountered the problem w/ a GeoTIFF for the Sydney, Australia area that I downloaded and converted from LatLon to UTM using gdalwarp. To rule out anything that I fat fingered during the conversion I grabbed the volcano test image as it was already in UTM.

    Please let me know if there is anything else I can try.

    Thanks,

    -- Dan
  • gilbertdrgilbertdr Global Mapper User Posts: 12
    edited February 2012
    Another data point....

    For grins I used gdalwarp to reproject to UTM zone 16N (gdalwarp -t_srs "+proj=utm +zone=16 +datum=WGS84" volcano_subset.tif volcano_subset_16n.tif)

    gdalinfo for the new file is:

    Driver: GTiff/GeoTIFF
    Files: volcano_subset_16n.tif
    Size is 451, 451
    Coordinate System is:
    PROJCS["WGS 84 / UTM zone 16N",
    GEOGCS["WGS 84",
    DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
    AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-87],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32616"]]
    Origin = (1758449.115270152000000,-4597831.446423642300000)
    Pixel Size = (15.283789786198495,-15.283789786198495)
    Metadata:
    AREA_OR_POINT=Area
    Image Structure Metadata:
    INTERLEAVE=PIXEL
    Corner Coordinates:
    Upper Left ( 1758449.115,-4597831.446) ( 72d 9'29.64"W, 40d33'56.00"S)
    Lower Left ( 1758449.115,-4604724.436) ( 72d 8'40.73"W, 40d37'32.07"S)
    Upper Right ( 1765342.104,-4597831.446) ( 72d 4'46.38"W, 40d33'18.67"S)
    Lower Right ( 1765342.104,-4604724.436) ( 72d 3'57.23"W, 40d36'54.66"S)
    Center ( 1761895.610,-4601277.941) ( 72d 6'43.49"W, 40d35'25.37"S)
    Band 1 Block=451x6 Type=Byte, ColorInterp=Red
    Band 2 Block=451x6 Type=Byte, ColorInterp=Green
    Band 3 Block=451x6 Type=Byte, ColorInterp=Blue


    Everything works as expected with this reprojected file:

    reproject_to_16n.jpg

    Thanks,

    -- Dan
  • gilbertdrgilbertdr Global Mapper User Posts: 12
    edited February 2012
    I actually meant to reproject to 18N, but the results are still valid...
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    For some reason I was able to easily reproduce the problem today. The error was an unnecessary one caused by the export being done with nothing loaded in the main view. I fixed the problem and all is right now. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • gilbertdrgilbertdr Global Mapper User Posts: 12
    edited February 2012
    Mike,

    I grabbed the new build and the issue is resolved. Thanks!

    Just curious, but why did this appear to only affect southern hemisphere UTM GeoTIFFs?

    -- Dan
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Dan,

    It had to do with the default rectangle being used when no data was loaded in the main view not projecting in the southern hemisphere. Strange problem, wouldn't have happened if running in the context of the main map view.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
Sign In or Register to comment.