[gdal-dev] "Syncing" two rasters together...
Kurtis Nelson
knelson at usgs.gov
Mon Mar 31 09:11:24 PDT 2014
We've done quite a bit of time series stacking of Landsat data for
change detection using the method you are testing.
We determine the output frame of either the minimum bounding box of all
the input scenes (gdalinfo each scene, save corner coordinates, compute
bounding box) or we have also pre-defined tiling systems and used those
corners. We then use gdalwarp on each scene, specify the output frame
with -te, specify the resolution with -tr, and the output coordinate
system with -t_srs. This will produce a stack of images with the same
number of lines/samples and the same output extent that should overlay
correctly.
__________________________________________________
Kurtis Nelson
Physical Scientist - Wildland Fire Science Team
United States Geological Survey (USGS)
Earth Resources Observation & Science (EROS) Center
47914 252nd Street
Sioux Falls, SD 57198
(605) 594-2805 (phone)
(605) 594-6529 (fax)
knelson at usgs.gov
"For every complex problem there is an answer that is clear, simple, and
wrong"
Henry Louis Mencken
On 3/27/2014 5:37 PM, Jonathan Greenberg wrote:
> Hi Tim:
>
> Not quite -- all I'm trying to do is basically crop (or expand) one
> raster to another's extent, but given two images may have their upper
> left coordinates somewhat "out of sync" (so the pixels don't line up
> perfectly with one another), I'm a bit unclear on how to do this --
> the goal is to have two rasters with identical geographic information
> (same projection, pixel size, row and column numbers) -- this then
> allows me to "stack" them together to create an e.g. time series.
>
> I'm thinking using gdalwarp with the te, t_srs, and ts/tr set to the
> "reference" file may accomplish the task -- running a test now.
>
> This is a common problem with a lot of raster analyses -- data from a
> wide variety of sources/resolutions/projections need to be coerced to
> a common set of spatial references so models can be applied to them
> (e.g. species distribution models). This is a common enough task that
> it would be nice to see this as a feature in e.g. gdalwarp, if it
> isn't already.
>
> --j
>
> On Thu, Mar 27, 2014 at 5:27 PM, Tim Keitt <tkeitt at utexas.edu> wrote:
>>
>>
>> On Thu, Mar 27, 2014 at 4:26 PM, Jonathan Greenberg <jgrn at illinois.edu>
>> wrote:
>>> GDALers:
>>>
>>> What is the most efficient way, given a "reference raster", and an
>>> arbitrary raster (we'll call it "unsynced") synced together to allow
>>> them to be stacked: the output of this should be the unsynced raster
>>> with the same number of rows, columns, pixel size, upper left
>>> coordinates, and projection as the reference raster.
>>>
>>> Here are the assumptions:
>>> - both rasters already have the same pixel size and projection, but
>>> the offset of the upper left coordinate may not be "perfect"
>>>
>>> - for each pixel location defined by the reference raster, the output
>>> should have the closest (nearest neighbor) pixel from the unsynced
>>> raster. It should have some NA value in regions where the reference
>>> and unsynced do not overlap.
>>>
>>> Thoughts? The application of this would be e.g. taking a set of
>>> Landsat images from different time periods (each image has slightly
>>> different numbers of rows and columns), and stacking them together to
>>> perform time series analysis.
>>
>> If I read right you are trying to estimate the x,y offset error in one
>> image. You can assign GCPs by picking identical pixels in each image and
>> then warp one of them to the other. OSSIM has some capability for image
>> matching I believe. If you convolve the two images, you should get an
>> impulse at the correct offset, but this is tricky in practice. Panorama
>> software may be able to compute the exact matching of the images.
>>
>> THK
>>
>>>
>>> Cheers!
>>>
>>> --j
>>>
>>> --
>>> Jonathan A. Greenberg, PhD
>>> Assistant Professor
>>> Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
>>> Department of Geography and Geographic Information Science
>>> University of Illinois at Urbana-Champaign
>>> 259 Computing Applications Building, MC-150
>>> 605 East Springfield Avenue
>>> Champaign, IL 61820-6371
>>> Phone: 217-300-1924
>>> http://www.geog.illinois.edu/~jgrn/
>>> AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>>> _______________________________________________
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>>
>>
>> --
>> http://www.keittlab.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140331/5ff04bbe/attachment.html>
More information about the gdal-dev
mailing list