SDM re-projected for Google Earth, OSM with gdal2tile

I think I have stumbled upon the solution for tiling the png image.
To re-project the PNG image, we can geo-reference the images with GDAL, then warp the geo-referenced image to the correct projection, also with GDAL.
The process is described here:
First, enter “gdalinfo Abies_fraseri.png” into terminal to get the bounds of the PNG image.
This yields the following output:
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1302.0)
Upper Right ( 2899.0,    0.0)
Lower Right ( 2899.0, 1302.0)
Center      ( 1449.5,  651.0)
A template and implementation for our PNG files is demonstrated here:
Template:
gdal_translate -of VRT -a_srs EPSG:4326 -gcp 0 0 ULlong ULlat -gcp UPPERRIGHTPx 0 URlong URlat -gcp LOWERRIGHTPx LOWERRIGHTPy LRlong LRlat Abies_fraseri.png Abies_fraseri.vrt
Implementation: 
gdal_translate -of VRT -a_srs EPSG:4326 -gcp 0 0 -84.000683874 35.7889383688 -gcp 2899.0 0 -83.0424855 35.7889383688 -gcp 2899.0 1302.0 -83.0424855 35.426963641 Abies_fraseri.png Abies_fraseri.vrt

For “ULlong” (Upper Left Long) and so forth I used a bounding box tool (http://boundingbox.klokantech.com) to determine the following bounds of the PNG – however, if there is a more “official” known boundary, it would be wise to use that instead.
                                35.426963641,-84.000683874 – bottom left / lower left
                                35.426963641,-83.0424855 bottom right / lower right
                                35.7889383688,-83.0424855 – top right / upper right
                                35.7889383688,-84.000683874 – top left / upper left
Next, take the .vrt file and warp it:
    gdalwarp -of VRT -t_srs EPSG:4326 Abies_fraseri.vrt Abies_fraseri_2.vrt
This creates a folder with tiles for a KML network link.
see “doc.kml” in the attached zip folder which you may open in Google Earth.
There is also an Open Map Layers HTML page in the attached zip folder.
To add trails in Google Earth
My opinion is it would be more interesting and informative to have the species occurrences added as a separate layer.  Therefore, I would prefer to create placemarkers / waypoints for species locations rather than black squares on the images.  Is it possible to generate PNG images with the likely distribution but not the black squares?  If so, would that take a long time to re-do to make these tiled overlays?
Also, although I “hacked” the PNG bounds, I’m still worried it the overlay’s georeferencing be “off” a bit and would love to use a more trustworthy set of coordinates than those derived from my best judgement and http://boundingbox.klokantech.com.
From here, I think it would be smart to document a workflow for doing a lot of PNG to VRT to KML at a time.  I haven’t tried processing a whole directory of images at once yet – just playing with the Abies_fraseri.png for now.
The doc.kml and virtual raster dataset work with Google Map API and Open Layers map.  I think they both run on Javascript.
Advertisements

About Tanner Jessel

I am a recent M.S. in Information Science graduate from the University of Tennessee School of Information Science. I was formerly a graduate research assistant funded by DataONE (Data Observation Network for Earth). Prior, I worked for four years as a content lead and biodiversity scientist with the U.S. Geological Survey's Biodiversity Informatics Program. Building on my work experience in biodiversity and environmental informatics, my work with DataONE focused on exploring the nature of scientific collaborations necessary for scientific inquiry. I also conducted research concerning user experience and usability, and assisted in development of member nodes with an emphasis on spatial data and infrastructure. I assisted with research designed to understand sociocultural issues within collaborative research communities. Through August 1, 2014, I was based at the Center for Information and Communication Studies at the University of Tennessee School of Information Science in Knoxville, Tennessee.

Posted on March 12, 2014, in Practicum, Research, Uncategorized and tagged , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: