Re: [gdal-dev] geotransform rotation and gdal_merge

2012-07-21 Thread Chaitanya kumar CH
Dave,

You said that you have lat/lon values for each pixel. Can you explain?

On Fri, Jul 20, 2012 at 8:44 PM, David Hoese  wrote:

>  I'm attempting to put aircraft scan data into geotiffs (1-3 scanlines
> each) and then use gdal_merge.py to combine them into one large geotiff
> that has the entire aircraft's path.  The scan lines are 15 pixels wide and
> taken every 10 seconds, the geotiffs are wgs84 lat/lon, and I have lat/lon
> values for each pixel.  To handle the case when the aircraft isn't flying
> straight north I think I have to use the 2 rotation parameters in the
> affine geotransform, is that right?  I don't have any test cases, but I
> think if I don't use rotation anything that reads the geotiff will think
> that the image is square(aligned) in lat/lon space.
>
> Whether or not I need to use this, can someone explain to me how to use
> the rotation coefficients?  What are the actual values of the coefficients
> supposed to be?  I couldn't find a good example and I couldn't get any
> basic situations to make sense, like a 2x3 array turned 45 degrees.  I used
> these equations:
>
> Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
> Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5)
>
>
> And lastly, does gdal_merge.py handle rotation?  I checked the source and
> it doesn't ever seem to use elements 2 and 4 in its calculations.
>
> Thanks for any help.
>
> -Dave
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotransform rotation and gdal_merge

2012-07-22 Thread David Hoese
Sure, pixels were probably not the best word to use. I have 15 
points(elements) per scan line per "variable" directly from an aircraft 
instrument.  So I might have a 15 element array of brightness 
temperatures, a 15 element array of latitudes corresponding to those 
points in the BT array, and another 15 element array of longitudes 
corresponding to those points in the BT array.  So the first element in 
the brightness temperature(BT[0]) array represents an area of the earth 
located at lon[0],lat[0] (I'm actually not sure if its the center of the 
area or the corner, but at the moment that doesn't matter).


Does that make sense?

-Dave

On 7/21/12 9:46 AM, Chaitanya kumar CH wrote:

Dave,

You said that you have lat/lon values for each pixel. Can you explain?

On Fri, Jul 20, 2012 at 8:44 PM, David Hoese > wrote:


I'm attempting to put aircraft scan data into geotiffs (1-3
scanlines each) and then use gdal_merge.py to combine them into
one large geotiff that has the entire aircraft's path.  The scan
lines are 15 pixels wide and taken every 10 seconds, the geotiffs
are wgs84 lat/lon, and I have lat/lon values for each pixel.  To
handle the case when the aircraft isn't flying straight north I
think I have to use the 2 rotation parameters in the affine
geotransform, is that right?  I don't have any test cases, but I
think if I don't use rotation anything that reads the geotiff will
think that the image is square(aligned) in lat/lon space.

Whether or not I need to use this, can someone explain to me how
to use the rotation coefficients?  What are the actual values of
the coefficients supposed to be?  I couldn't find a good example
and I couldn't get any basic situations to make sense, like a 2x3
array turned 45 degrees.  I used these equations:

 Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
 Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5)


And lastly, does gdal_merge.py handle rotation?  I checked the
source and it doesn't ever seem to use elements 2 and 4 in its
calculations.

Thanks for any help.

-Dave

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/gdal-dev




--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotransform rotation and gdal_merge

2012-07-23 Thread Chaitanya kumar CH
Dave,

The reason you have lat/lon values for each pixel is because they may not
be aligned exactly.
Even though it is not very 'efficient', you have to define the GCPs for
each pixel with the lat/lon values of that pixel. Then you use gdalwarp
while forcing use of these GCPs to combine all the images.

How are the lat/lon values stored?

On Sun, Jul 22, 2012 at 7:44 PM, David Hoese  wrote:

>  Sure, pixels were probably not the best word to use. I have 15
> points(elements) per scan line per "variable" directly from an aircraft
> instrument.  So I might have a 15 element array of brightness temperatures,
> a 15 element array of latitudes corresponding to those points in the BT
> array, and another 15 element array of longitudes corresponding to those
> points in the BT array.  So the first element in the brightness
> temperature(BT[0]) array represents an area of the earth located at
> lon[0],lat[0] (I'm actually not sure if its the center of the area or the
> corner, but at the moment that doesn't matter).
>
> Does that make sense?
>
> -Dave
>
>
> On 7/21/12 9:46 AM, Chaitanya kumar CH wrote:
>
> Dave,
>
> You said that you have lat/lon values for each pixel. Can you explain?
>
> On Fri, Jul 20, 2012 at 8:44 PM, David Hoese  wrote:
>
>>  I'm attempting to put aircraft scan data into geotiffs (1-3 scanlines
>> each) and then use gdal_merge.py to combine them into one large geotiff
>> that has the entire aircraft's path.  The scan lines are 15 pixels wide and
>> taken every 10 seconds, the geotiffs are wgs84 lat/lon, and I have lat/lon
>> values for each pixel.  To handle the case when the aircraft isn't flying
>> straight north I think I have to use the 2 rotation parameters in the
>> affine geotransform, is that right?  I don't have any test cases, but I
>> think if I don't use rotation anything that reads the geotiff will think
>> that the image is square(aligned) in lat/lon space.
>>
>> Whether or not I need to use this, can someone explain to me how to use
>> the rotation coefficients?  What are the actual values of the coefficients
>> supposed to be?  I couldn't find a good example and I couldn't get any
>> basic situations to make sense, like a 2x3 array turned 45 degrees.  I used
>> these equations:
>>
>> Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
>> Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5)
>>
>>
>> And lastly, does gdal_merge.py handle rotation?  I checked the source and
>> it doesn't ever seem to use elements 2 and 4 in its calculations.
>>
>> Thanks for any help.
>>
>> -Dave
>>
>> ___
>> gdal-dev mailing list
>> gdal-dev@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
> --
> Best regards,
> Chaitanya kumar CH.
>
> +91-9494447584
> 17.2416N 80.1426E
>
>
>


-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotransform rotation and gdal_merge

2012-07-23 Thread David Hoese

Chaitanya,

I attempted a few small examples with GCPs and gdalwarp told me:
"ERROR 1: Failed to compute GCP transform: Transform is not solvable

I tried it with 2 GCPs at the sides from a 1x15 image array and another 
with every point's GCP defined, both failed with that error.  Sorry I 
forgot to mention this, I'll be using the python API and the data is 
provided as 3 numpy arrays, image/lat/lon. I've tried using rotation now 
then running it through gdalwarp which seems to work (although you lose 
a lot of data with the settings I was using).  And by work I mean that 
gdalwarp recognizes the rotation of the data and puts it into an 
aligned/square grid.  Another thing I may not have mentioned is that 
I'll eventually be putting this data into MapServer for WMS viewing.


If I'm not missing something, doesn't gdalwarp essentially do the same 
thing as gdal_merge.py, at least in this case?  It's even better if it 
actually uses the rotation in its calculations.


Also, I know the pixels won't be aligned exactly because the instrument 
is on an aircraft that's moving/turning.  It's more important that the 
data gets shown, not that its in the exact location.


-Dave

On 7/23/12 7:02 AM, Chaitanya kumar CH wrote:

Dave,

The reason you have lat/lon values for each pixel is because they may 
not be aligned exactly.
Even though it is not very 'efficient', you have to define the GCPs 
for each pixel with the lat/lon values of that pixel. Then you use 
gdalwarp while forcing use of these GCPs to combine all the images.


How are the lat/lon values stored?


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev